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.

TMS320F28335: First CAN message randomly not received

Part Number: TMS320F28335


Recently, we have had a random error occur in the CAN communication of our device. About 50% of the time, the first CAN message is not received by the micro-controller. We have not changed the firmware or hardware in several years, yet only in the last couple months have we seen this error occur. After ruling out manufacturing errors, I am wondering if the issue lies in our micro-controller part: TMS320F28335ZJZA CA-98ZLL53 G1

When I measure the CANRXA input with an oscilloscope, I am always able to read out the correct CAN message that is supposed to be received. However, the data from the first CAN message does not always appear in the mailbox content, and when this happens the node fails to acknowledge the received message.

After the first CAN message is sent, there are no issues receiving subsequent CAN messages. It seems that the first message is needed to wake up the module, even though low-power mode is never requested (CANMC.11 and CANMC.9 are set to 0). Sending an initial wake-up message seems to be a good workaround to this issue.

Is it possible that the eCANA module goes into local power-down mode even if these bits are set to 0? 

  • In how many devices have you seen this issue?

    Is it possible that the device could be in IDLE mode? Does your firmware ever put the device in IDLE mode?

    Is it possible that the eCANA module goes into local power-down mode even if these bits are set to 0? 

    No.

  • Hello Hareesh,

    Thank you for your reply. We saw this issue on 5 devices this year, all in the same batch.

    It looks like the LPMCR0 register is never set, so I assume it is in the default IDLE mode. What should this register be set to when sending and receiving CAN messages?

    Regards,

    Stephen

  • What should this register be set to when sending and receiving CAN messages?

    Bits 1:0 of LPMCR0 could be any value. They take effect only when the IDLE instruction is executed. Upon reset, these bits are 00, so if/when IDLE is executed, that would put the device in IDLE mode. Note that when the device is in IDLE mode, CPU execution is frozen. I don't believe that is the case with your system.

    When I measure the CANRXA input with an oscilloscope, I am always able to read out the correct CAN message that is supposed to be received. However, the data from the first CAN message does not always appear in the mailbox content, and when this happens the node fails to acknowledge the received message.

    I get a feeling your node is not ready when the first frame is received. How do you ensure your node is ready when the first frame is received? Assuming it is easy to reproduce this  issue, can you please try this? After the device/CAN initialization is complete, toggle a GPIO pin. The GPIO toggle is indication that the CAN initialization is complete and it is ready to ACK/receive messages. Bear in mind that it should ACK any valid message, not just the ones it is supposed to receive. I have explained this in www.ti.com/lit/spra876

  • I have also wondered whether the node is not ready, but I ruled this out when I would see the issue even after the device was on for several seconds before receiving a CAN message. I will try your suggestion to confirm that the CAN initialization is complete before receiving messages.

  • I have a feeling your code is stuck waiting for the CCE bit to be set/cleared. In other words, your CAN initialization is not complete. Did  you look at my debug tips in SPRA876, specifically the one pertaining to 32-bit R/W?