Flexcan porting to FreeRTOS

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

Flexcan porting to FreeRTOS

2,253 Views
jay_zhang
Contributor II

Dear NXP dev team,

jiri.kral@nxp.comfanchang

I met a issue with CAN transmission sample, my goal is port the can send/recv function to my project, my project is based on FreeRTOS, but after porting the code from flexcan_encrypted sample, find the MCU reset forever.

I have attached the project source code.

I after debuging the issue, I find the below code maybe the root cause to produce the issue, 

pastedImage_5.png

After remove the FLEXCAN_DRV_Init code, the MCU can run normally.

But the flexcan_encrypted sample run successfully on my board.

Please help me to resolve my issue.

Thanks

Jay

6 Replies

1,638 Views
1085120422
Contributor I
  • Add total stack

1,638 Views
tim_ting89
Contributor II

How to add total stack? Could you show me the sample code. Thanks a lot! 

Thanks!

Tim

0 Kudos

1,638 Views
fuzeng
NXP Employee
NXP Employee

hi, zhang jie:

      I suggest you put the prvSetupHardware() in a task, because the sdk use some os api(osif).

0 Kudos

1,638 Views
jay_zhang
Contributor II

Hi Fu Zeng,

Thanks for your reply.

The issue is fixed.

In the FLEXCAN_DRV_Init function, I find if you use the RTOS, it will create 32 sema:

pastedImage_1.png

But the default RTOS environment only config 8192 bytes heap size, after increase the size can fix this issue

Thanks

Jay

1,638 Views
tim_ting89
Contributor II

Hi Jay,

I also met this problem.  How to  increase the heap size? Thanks!

Tim

0 Kudos

1,638 Views
jay_zhang
Contributor II

Anyone can help me on my issue?

0 Kudos