I try to integrate the CAN-interrupt-tx example code (frdmkw36_driver_examples_flexcan_interrupt_transfer) into my project, and I use the wireless-UART example code (frdmkw36_wireless_examples_bluetooth_w_uart_freertos) as my code-based, Unfortunately, It seems the CAN-BUS can't work and no any CAN interrupt can be generated. I have verified and confirmed that my CAN0_init() function can work fine, because I have added it to the CAN-interrupt-tx example code and it seems to work well, Now I have some questions, Is it impossible to execute interrupt ISR in NXP's FreeRots, or I missed some configuration for CAN's ISR, Can anyone share some useful experience to me,
Thank you very much.
You can check as well this application note with the implementation. I would recommend you to start with the CAN communication first and only adding the driver to receive/send a message through CAN and after that if you are interested adding the rest of the functionality mentioned there (security+LIN) .
I have tried adding CAN_init() to (frdmkw36_wireless_examples_bluetooth_w_uart_freertos) according to the instructions in the Application Note, but it seems that CAN-BUS still does not work. In order to confirm whether the CAN-Driver can run in the FreeRtos project, I tried to dump the register value after executing "FLEXCAN_WriteTxMb()" and compare it with (frdmkw36_driver_examples_flexcan_interrupt_transfer) , As shown in the figure below, we can see that the register value of the yellow item is wrong . Can anyone provide me with some suggestions, Many thanks.
Source Code :
Wrong memory content :
Correct memory content :
Sometimes the file changes so by any chance could you please first make a back up of the different Heap files? Once you have a back up of them, could you please try removing all of them but the heap4 ? You need to keep the heap4.
Also, you have an internal message.
Thank you for sharing your experience. I have referenced the Application Note for creating the CAN driver, and used "SDK Component Management window" to add the CAN Driver to my project, but it seems that there are some compiler errors. I remove some files as follows to fix the compiler's errors. Is it correct ? Thank you very much.