cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G4 CAN TX buffer

Moritz1
Associate III

Hello,

I'am currently programming on a STM32G473. I'am sending CAN Message via the FDCAN peripheral.
In generally everything works, all my messages I put into the Tx Buffer are sent.

But in one little detail I'am confused:

In Figure 669 its described, that the TX buffer consists of 3 elements.

But if I want to find out in which index I have to put the next message by reading the TXFQS_TFQPI field, I'am confused why the reference manual describes a range of 0-3 for this field. So it seems that there are 4 messages? But in the Add-Request Register (TXBAR_AR) there are only 3 Bits for adding transmission requests (and the RAM buffer has only space for 3 Messages).

  • If the put index is 0 --> I set the Bit 0 in TXBAR_AR
  • If the put index is 1 --> I set the Bit 1 in TXBAR_AR
  • If the put index is 2 --> I set the Bit 2 in TXBAR_AR
  • If the put index is 3 --> What should I do? There is no bit for a fourth request (and also no space in Buffer for a fourth message)

So is it maybe an error in the reference manual and the range of TXFQS_TFQPI is only 0-2 and in reality the peripheral will never give me a 3 in this field?

Or, if the range 0-3 is correct: What should I do if I get a put-Index of 3?

 

[Ref: RM0440, Rev. 8]

2 REPLIES 2
MHoll.2
Senior

Good catch!

I think You are right this is a error in the Reference manual.

At least the HAL driver uses the TFQPI field with out any check for values > 2 (this would write the Message outside of the Message RAM!).

Let's see if some one from ST has some insight.

Martin

Oleksii
Associate II

Perhaps 3 means the buffer is full.
And there is nowhere else to write))