Skip to main content
ST Migration account
ST Community Manager
August 22, 2026
Solved

STM32L431: CAN Transmit cannot transmit message faster than every 3ms

  • August 22, 2026
  • 2 replies
  • 21 views

This account only shares restored community content posted by members between May 22 and June 9, 2026, who did not register for the new community.


Hello,

I am using a STM32L431 microcontroller. Bare-metal application in C using STM32CubeIDE and HAL library. 

I am trying to transmit an 8-byte CAN Message at 1Mbps baud rate every 1ms. The best I can do right now is successfully transmit one CAN message every 3ms (with every 13th or 14th message going out at 4ms interval.). Any transmission rate >3ms I do not have any issues.

 

The system Clock is set to 80Mhz, using external 8Mhz crystal. Every 1ms (based on 500us timer), I add a CAN message to a queue (size 128). I check for any available TxMailbox and try to transmit using HAL_CAN_AddTxMessage. I also have a CANTransmit function that calls HAL_CAN_AddTxMessage in the HAL_CAN_TxMailboxEmptyCallback in case all 3 mailboxes were full. At present, there are no other devices trying to send any CAN messages on the bus expect the STM32 microcontroller. The loop that does CAN message packing and queuing is ~ 330us. What am I missing?

My end goal is to transmit three 8-byte CAN messages every 1ms.

Thank you in advance for any pointers you may have.

Indy

Best answer by ST Migration account

I found an issue with the CAN message queue logic that prevented from sending data faster (i.e. every 1ms rate). This issue was not related to the CAN implementation of the STM32L431 microcontroller. I will be closing this issue.

2 replies

ST Migration account
ST Migration accountAuthorBest answer
ST Community Manager
August 22, 2026

I found an issue with the CAN message queue logic that prevented from sending data faster (i.e. every 1ms rate). This issue was not related to the CAN implementation of the STM32L431 microcontroller. I will be closing this issue.

This account only shares restored community content posted by members between May 22 and June 9, 2026, who did not register for the new community.
ST Migration account
ST Community Manager
August 22, 2026

Just to be clear, when I attempt to send a CAN message every 1ms, the fastest the message gets transmitted is 3ms. When I attempt to send a message every 2ms, the message gets transmitted every 2ms and 4ms alternating between these times after every message.

This account only shares restored community content posted by members between May 22 and June 9, 2026, who did not register for the new community.