The reception of FlexCAN triggered by an interrupt

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The reception of FlexCAN triggered by an interrupt

1,211 Views
A-Jay
Contributor III

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!

Labels (1)
0 Kudos
Reply
3 Replies

1,198 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @A-Jay 

Which MCU and SDK are you using?

0 Kudos
Reply

1,186 Views
A-Jay
Contributor III
S32DS, S32R45's M7 core
0 Kudos
Reply

1,132 Views
PetrS
NXP TechSupport
NXP TechSupport

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

0 Kudos
Reply