Skip to main content
Visitor II
February 7, 2025
Question

Sometimes, data does not flow on the CAN bus.

  • February 7, 2025
  • 2 replies
  • 546 views

Hi.

In my program, I am transmitting the following CAN IDs at a 20ms cycle:

1. 0x080
2. 0x100
3. 0x15B
4. 0x215
5. 0x315
6. 0x415
7. 0x515
8. 0x40D

When continuing the periodic transmission, I have observed that sometimes No 4-8 do not flow on the CAN bus and are not transmitted periodically.
I confirmed that when changing No 4-8 as follows, all data is transmitted periodically on the CAN bus:

1. 0x080
2. 0x100
3. 0x15B
4. 0x215→0x15C *changed
5. 0x315→0x15D *changed
6. 0x415→0x15E *changed
7. 0x515→0x15F *changed
8. 0x40D→0x160 *changed

Could you please explain why changing the CAN IDs allows for successful transmission?

I appreciate your assistance.

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    April 30, 2025

    Hi @coffeelover,

     

    The problem you encountered is likely related to the priority of messages in the transmission boxes (Tx mailboxes) of the CAN controller.

    According to the CAN protocol, the priority of messages is determined by the message identifier. The message with the lowest identifier has the highest priority:

    ELABI1_0-1746022258325.jpeg

    By changing the identifiers to lower values, the messages gain higher priority, allowing for successful transmission.

    Additionally, the transmission duration of 20 ms might be short, so maybe it's necessary to space out the transmissions also it is recommended to ensure that at least one transmission mailbox (Tx mailbox) is free to transmit a message.

    Thank you.

    ELABI.1

     

    Graduate II
    April 30, 2025

    More than likely due to how you're transmitting, checking HAL return status and if you are queuing your CAN messages. Show your relevant code.