cancel
Showing results for 
Search instead for 
Did you mean: 

FDCAN repeated transmissions - CAN memory altered after TX ?

LCE
Principal II

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 ?

1 ACCEPTED SOLUTION

Accepted Solutions
LCE
Principal II

... 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.

View solution in original post

6 REPLIES 6
mƎALLEm
ST Employee

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?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

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 ? 

The specification doesn't mention if we could/couldn't do that. So you need to test that ;)

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
LCE
Principal II

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...

That's why I said "The specification doesn't mention if we could/couldn't do that." ;)

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
LCE
Principal II

... 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.