[En-Nut-Discussion] ATCAN repeats messages on Error

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Sat Sep 16 14:14:38 CEST 2006


>>>>> "Henrik" == Henrik Maier <hmlists at focus-sw.com> writes:

    Henrik> Uwe Bonnes wrote:
    >> Hallo,
    >> 
    >> with my CAN Setup with a long, unterminated line, I can get the
    >> Ethernut AT90CAN128 to repeatedly send the message, hogging the CAN
    >> Bus.
    >> 
    >> My program definitly only sends the message once.
    >> 
    >> I know, an unterminated line is an user error, but the Ethernut
    >> driver should not hog the line in such an error.
    >> 
    >> Any ideas how to handle this error more gracefully?
    >> 

    Henrik> Never observed this issue and the controller should go bus-off
    Henrik> after repeated line faults to prevent exactly this.

I also thought that the Can tranceiver should go offline. Obvious it
doesn't. The Can Frame is repeated back by back, as seen on the scope. An
for sure it were more than 255 frames, as implied by the error counter.

Perhaps the Ethernut driver resets some error register by chance.

    Henrik> In case there is no other node on the bus, the unit should have
    Henrik> an ACK error and go error-passive after 127 failed transmissions
    Henrik> and bus-off after 255.

The bus has some special setup.In a 19  inch rack, only one device  acks as
physical interface and is connected to the physical bus. This interface
drive CANRX with a Totem Pole to the backplane. CAN TX is an Open Collecor
line. Every device (including the interface) connect to these two line and
drive the CANTX line with their own OC driver.

I had situations, where the interface happily printed out the preated
messages another device on the backplane repeated endless.

    Henrik> I am happy to assist with the fault analysis and also to improve
    Henrik> the driver if we find an issue in the driver.

    Henrik> Can you put some debug instrumentation in your
    Henrik> arch/avr/dev/atcan.c code in AtCanSendMsg and AtCanOutput to see
    Henrik> what the driver actually does?

I already tried with printfs to the serial driver, but that made the program
hang. Perhaps I will try to toggle port pins, also unused pins are rare on
my design, as is RAM memory, as I have only the internal 4 kiByte of the
At90CAN128. I will try to print out the status of TEC/REX/CANGSTA in the
program main loop

    Henrik> In particular I am interested if we get a TX interrupt and also
    Henrik> the status of the CAN Transmit Error Counter Register - CANTEC.


I'll keep you informed.
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------



More information about the En-Nut-Discussion mailing list