cancel
Showing results for 
Search instead for 
Did you mean: 

Please advise on handling FDCAN Rxfifo.

taeun
Associate II

I am trying to receive CAN FD and save the data to the SD card, but I am having a problem .

Create and deliver an event structure in HAL_FDCAN_RXFifo0Callback, Receive the structure from the application area and call HAL_FDCAN_GetRxmessage. In this case , RxFIFOFULL accur .

IF HAL_FDCAN_GetRxmessage is called from callback, RXFIFOFULL does not occur. 

However i want to keep the callback statement as short as possible , Also idon't understand why tihs is a problem in the first case.

The place where HAL_FDCAN_GetRxMessage is called is cantoQueue(). 

There is no problem if place this function in  callback rather than app()

 

 

 

.

 

 

 

3 REPLIES 3
SofLit
ST Employee

Hello,

Sorry I didn't understand the case. 

Do you mean if you call HAL_FDCAN_GetRxmessage() inside the HAL_FDCAN_RXFifo0Callback() callback the calback doesn't fiire while if you remove HAL_FDCAN_GetRxmessage() call the callback is called?

 

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.
taeun
Associate II

When HAL_FDCAN_GetRxmessage is called in app(), RXfifoFULL occurs and CAN messages can no longer be received or the messages are lost.

 

 

RXfifoFULL when HAL_FDCAN_GetRxmessage() called?? are you sure it's called?

I think better to forget about SD card function for now and try with a simple CAN receiving project. 

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.