This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS320F28379D: CAN Communication trouble (status and bus errors)

Part Number: TMS320F28379D
Other Parts Discussed in Thread: CONTROLSUITE

Tool/software: Code Composer Studio

Hello everyone,

I am currently working on CAN communication between to F28379D cards (one launchpad and one control card) via mcp2551 transceiver and I want send a message each second.

I've reached to send/receive messages between CAN A and B of the same card (both of them individually) so I think there is no problem of GPIO/hardware configuration but when I try to connect the two cards, there is a continuous emiting from the first speaking node. It's like there isn't acq from the receiver.

For information, my emitter's CANES reg has Ewarn and Epass bits active and LEC is equal to "011". I saw it in the TRM but I don't understand what is exactly the problem.

For me it's configuration/software problem, do you know first if different periphericals/interrupt may fault the CAN module ? (I am using ADC, PWM, Timers, run from flash and soon DMA and CLA). 

Other hint, the frames are spaced by 120us precisely.

For the moment I am using only RX interrupt, do you think is it essential to have TX interrupt for monitoring the bus ? (my future aim will be also to verifying nodes presence).

Finally, do you have code example/documention with help about CAN bus monitoring/faults management ?

Thank you very much for your help and have a nice day.

Best regards,

Jérémy

  • Hi Jeremy,

    From your description on the error flag status and values, this points to the CAN messages are not being received by the other node.  The messages will be available in the CAN bus until they are received.  This explains why you see the periodic messages in the CAN bus since it is not being received or acknowledged.  You mentioned CANA and CANB can communicate using the same card, but you see this issue you are describing between 2 cards.  Couple of questions for you:

    1.) Are you using the same physical interface (mcp2551 transceiver and CAN bus) with CAN communication on same card and on different card?

    2.) Are you using the same system speed and baud rate when you communicate with different cards?

    The only code examples for CAN SW are what we have in C2000 Ware / ControlSUITE.  For bus monitoring, one suggestion is to have a CAN interface to a PC as this enables you to see activities, errors, baudrates, and which nodes are active on a CAN bus.  For instance, if you work on LabView, a good tool to use will be USB 8473.

    Best regards,

    Joseph

  • Hi Joseph, Thank you for your answer.

    In fact I have tryed to configurations : Each card speak to itself via CANA and CANB. This configuration is working for the two card (one card by one, I'am using only two mcp2551).

    So I think we can eliminate bus and hardware problems.

    But now I am using only CAN A for each card and I am trying to make them to communicate : the first card speaking send msg continuously (probably an ACK problem like you said).

    I don't think it's a timing problem due to the bus length (about 2cm :) ). The baudrate are the same, but I am not sure about peripherical clocking (µC core and can core) and their isn't GPIO73 on the launchpad for verify it.

    Moreover I am using the quasi-same code for to cards except the use of PWM/ADC and other module for one, do you know if the UARTprintf can fault the CAN communication ?

    Thank you and have a nice day,

    Best regards,

    Jérémy

  • Hi Jeremy,

    I'm pretty sure you have checked the CAN pin (GPIO) configuration of the receiving card and it seems that you have already scoped the signal in the CAN bus and confirmed that the transmitted message periodically appears on the bus by ~120us. That is at least a confirmation that transmission is OK. On the receiving end, is the program looping in the receiving function, is it polling for the correct message number? Can you also observe the CAN_ES register contents of the receiving card and note the flags (BOff, RxOk,LEC,PER)?

    Thanks and regards,
    Joseph
  • Hi joseph,

    Sorry for my delayed answer, I am working on different projects at the same time ...

    Yes, I can see frame on a scope, when I start the emitter (launchpad) I can the the continous emiting after a short delay.

    This is CAN A registers of the receiver (control card) :

    I have interruption for RX frame with "CANIntStatus(CANA_BASE,CAN_INT_STS_CAUSE)" test (the result is always 32768 ...) then the getstatus function "98" (value that you can see in my screenshot).

    After I have two "if" in my main loop, one for my own application with control laws and one for the CAN communication with RX flag + status value condition (for the moment I have only one monitored RXmsgObject).

    I will try to verify #ifdef or other to see the "real" clock config of my cards.

    Now, you know everything :)

    Thank you very much for your help and have a nice day,

    Best regards,

    Jérémy