MK64 + FreeRTOS + FlexCAN interrupt

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MK64 + FreeRTOS + FlexCAN interrupt

1,627 次查看
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

标签 (1)
0 项奖励
回复
2 回复数

1,242 次查看
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 项奖励
回复

1,242 次查看
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 项奖励
回复