2025-07-11 12:38 PM
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?
2025-07-11 2:14 PM
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.