cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_FDCAN_GetTxFifoFreeLevel always returns 0

killa-pixel
Associate

On the M4 core of a stm32mp157 I am using FIFO based FDCan communication.

Messages are sent and received just fine but I think when I send too many messages in a short time some messages are getting lost.

So I added a call to HAL_FDCAN_GetTxFifoFreeLevel before calling HAL_FDCAN_AddMessageToTxFifoQ to make sure there is space in the FIFO, but HAL_FDCAN_GetTxFifoFreeLevel always returns 0.

Here some parts of my fdcan configuration:

RxFifo0ElmtsNbr = 8;

RxFifo0ElmtSize = FDCAN_DATA_BYTES_8;

RxFifo1ElmtsNbr = 0;

RxFifo1ElmtSize = FDCAN_DATA_BYTES_8;

RxBuffersNbr = 0;

RxBufferSize = FDCAN_DATA_BYTES_8;

TxEventsNbr = 0;

TxBuffersNbr = 0;

TxFifoQueueElmtsNbr = 35;

TxFifoQueueMode = FDCAN_TX_FIFO_OPERATION;

TxElmtSize = FDCAN_DATA_BYTES_8;

 

 

What am I missing?


1 REPLY 1
Karl Yamashita
Principal

Create a queue to hold your Tx messages. When you successfully send a message then you can increment your pointer to the next queue to be transmitted.

I was told that if a devices starts to smoke, put the smoke back in. I guess I never got all the smoke because the device never worked afterwards.
Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.