I am now receiving CAN data through FreeRTOS implementation and printing data through Uart. The priority of the task receiving CAN data is higher than that of the task printed by the Uart. However, the vTaskDelay() function must be called to release the CPU for the task with a higher priority. However, some CAN data cannot be received during the suspended time of the task. So I'm going to use CAN to receive data, trigger interrupts, release binary semaphores in interrupt call-back functions, and get semaphores in data processing tasks.
But I don't know how interrupts are implemented?
CAN the callback function that fires first when the register receives CAN data be overwrite?
I hope you can help me!
Hi @A-Jay
Which MCU and SDK are you using?
Hi,
unfortunately I do not have example for your device directly. I can point to below example for MPC5748g, so maybe can be useful little bit.
https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/Example-MPC5748G-FlexCAN-TX-RX-FreeRTOS-S32DS2-1...
If you are loosing some data you can try to enable and use legacy or enhanced RXFIFO. Legacy RXFIFO can hold up to 6 CAN2.0 messages without reading it. Legacy RXFIFO can be used if CAN FD is not enabled. With CANFD enabled you have option to use enhanced RXFIFO which can hold up to 32 CANFD messages.
BR, Petr