MK64 + FreeRTOS + FlexCAN interrupt

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

MK64 + FreeRTOS + FlexCAN interrupt

904 Views
wfwf
Contributor II

Hello,

I'm trying to make the FlexCan (KSDK 1.3.0) driver work under FreeRTOS (8.2.2) on a Kinetis K64 cpu. In order to configure the CAN, I'm succesfully following the example in C:\Freescale\KSDK_1.3.0\examples\twrk64f120m\driver_examples\flexcan\flexcan_network  in a baremetal configuration.

The problem arises using instead FreeRTOS since I'm not getting any interrupt on any incoming CAN message. I'm not putting external API inside the "CAN0_ORed_Message_buffer_IRQHandler" interrupt, but just using the standart IRQ handler provided (See FreeRTOS - Open Source RTOS Kernel for small embedded systems , point 5.)

The configuration of the CAN peripheral using  is done before the main thread and the scheduler starts, just after the PE_Low_Level.

According to the FreeRTOS FAQ page I set up the

"#define configASSERT( ( x ) ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }"
for debug purposes

 

Any Idea on it? how can I double check if the interrupt priority is correct?

Is there any tutorial or link on integrating the CAN on FreeRTOS?

 

Other interesting discussion FreeRTOS and K64 Interrupt Priority 

thank you

Walter

Labels (1)
0 Kudos
2 Replies

519 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I think all the driver of serial bus have the same architecture in SDK, I suggest you refer to the example in Freertos:

C:\Freescale\SDK2.0_FRDM_K64F\boards\frdmk64f\rtos_examples\freertos_uart\kds

BR

Xiangjun Rong

0 Kudos

519 Views
wfwf
Contributor II

news: by repeating the full initialization inside the CAN thread, I succeded in receiving a CAN message. I'll further investigate which initialization part in particular must be repeated. Furthermost, even with this second initialization the "SendBlocking" method doesn't work. The  "Send" method works outside the thread but doesn't worh IN the thread. Which is the difference between the two methods?

thank you

0 Kudos