2025-12-02 4:23 AM
Heyho,
question about FDCAN and repeating / timed transmission of the same messages:
(this is neither about TT CAN nor auto re-transmission, but e.g. for messages which need to be sent every 100 ms repeatedly and "manually")
After the first setting of the TX buffer or TX FIFO, and after the first successful transmission, is the TX buffer (incl. the 2 "control" words) somehow altered / changed?
If not, can the same message simply be sent again by setting the corresponding bit in the register TXBAR ?
Solved! Go to Solution.
2025-12-02 9:10 AM
... and I would have tried anyway! :D
It's working!
Once a TX buffer in CAN memory is set, nothing is changed, so the same buffer can be sent by setting the corresponding buffer bit in TXBAR.
That saves the CPU some data copying time.
Which is not that important on a H7 at >= 400 MHz, but if that works on "slower" STM32 types, this might be interesting - if it's working there the same way.
2025-12-02 7:11 AM
Hello,
Could you please elaborate more about this statement?
@LCE wrote:
After the first setting of the TX buffer or TX FIFO, and after the first successful transmission, is the TX buffer (incl. the 2 "control" words) somehow altered / changed?
and what is the use case for it?
And do you mean, you need to transmit the same message only by toggling the corresponding bit in TXBAR register?
2025-12-02 8:02 AM
The usual TX procedure is:
1) in CAN RAM:
- setting the TX buffer's 2 control words (ID, DLC, BRS, ...)
- copy message to TX buffer
(in HAL: HAL_FDCAN_AddMessageToTxBuffer() )
2) start TX by setting the bit in TXBAR (add request register)
(in HAL: HAL_FDCAN_EnableTxBufferRequest() )
So... after step 1) CAN RAM TX buffer is set.
If nothing changes in that buffer because of the transmission, and if the exact same message shall be sent again (e.g. every 10 ms):
-> can step 1) be omitted ?
and the same message is sent by simply doing step 2) -> setting the buffer index bit in TXBAR ?
2025-12-02 8:09 AM
The specification doesn't mention if we could/couldn't do that. So you need to test that ;)
2025-12-02 8:11 AM
Okay, working on it.
I couldn't find anything in the RM that says that any data is changed in the buffers, I'll find out...
2025-12-02 8:17 AM
That's why I said "The specification doesn't mention if we could/couldn't do that." ;)
2025-12-02 9:10 AM
... and I would have tried anyway! :D
It's working!
Once a TX buffer in CAN memory is set, nothing is changed, so the same buffer can be sent by setting the corresponding buffer bit in TXBAR.
That saves the CPU some data copying time.
Which is not that important on a H7 at >= 400 MHz, but if that works on "slower" STM32 types, this might be interesting - if it's working there the same way.