i.MX8MP M7 CAN application stops when Linux boots

In our project, we are working on the i.MX8MPlus EVK board and have implemented a CAN communication program using CAN1 running on the M7 core. It’s working well, but when we boot up Linux, this interface stops working for FreeRTOS. We tested the program by booting up only the M7 core with the CAN binary, and it was able to send/receive CAN messages. However, the moment we continue and boot up Linux, CAN1 stops working for FreeRTOS. It appears that Linux might be overriding the settings that FreeRTOS made for CAN1.

We need to use CAN1 for FreeRTOS (M7 core) and CAN2 for Linux (A53 core).

We tried the following methods:

  • We disabled the CAN1 node in both the U-boot and kernel device tree files.
  • We added clk_ignore_unused to the U-Boot environment to avoid Linux from turning off the m7 clocks.
  • We also removed the clock settings for CAN1 in the clk driver file in Linux (clk-imx8mp.c).
  • In the IMX8MPRM document, we found out about the RDC, which provides a mechanism to allow boot-time configuration code to dedicate peripherals to specific cores. By referring to that, we modified the imx8mp_bl31_setup.c (ATF code) and imx8mp-evk-u-boot.dtsi (U-boot code) by adding the line: RDC_PDAPn(RDC_PDAP_CAN_FD1, D1R | D1W).

Despite all the above changes, CAN1 used for FreeRTOS on the M7 core still stops working after we boot Linux.

Additionally, we modified our code to delay CAN1 communication running on M7 core until Linux boots. And in Linux, we have disabled CAN1. In this case, the CAN application on the M7 core works fine even after Linux boots.

Note: We are using cm_addr 0x80000000 to load our cm_image binary. We are using Linux kernel version 6.1.57 on the board.

Please suggest us with any solution or provide any other possible methods we can try to solve the issue where our FreeRTOS application using CAN1 on the M7 core should work even after Linux boots up without any delay.

Thank you.

Hello @murugavelr,

Welcome to the Toradex Community!

Your steps of disabling a peripheral in the Linux kernel, u-boot and the RCD configuration on the ATF are correct when you want to use the peripheral on the Cortex-M7 of an i.MX8M Plus.

Maybe our Heterogeneous Multi-core Processing devicetree overlay can provide some insights about how we usually enable the use of the Cortex-M7 on our Verdin iMX8M Plus board.

Unfortunately, as you are using the NXP i.MX8MPlus EVK, which is not supported by Toradex, I cannot give you further advice on how to debug this problem.

Best Regards,
Bruno