i.MX8MP M7 application stops when Linux boots

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

i.MX8MP M7 application stops when Linux boots

480 Views
Prajwal_M18
Contributor I

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.

0 Kudos
Reply
1 Reply

428 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,


All your steps look correct, even I would say that its similar to what we have done for the EVK, where it is enough to select the RPMSG based device tree when running both Cortex-A and Cortex-M at the same time.

https://github.com/nxp-imx/linux-imx/blob/lf-6.6.y/arch/arm64/boot/dts/freescale/imx8mp-evk-rpmsg.dt...

What else does it run on the cortex-M side?

Best regards/Saludos,
Aldo.

0 Kudos
Reply