Hi all,
I have an MCUXpresso project to control GPIO1 port and blink some LEDs connected to a custom board. I have built the binary with the default TCM+DDR configuration.
On U-Boot, I have successfully loaded and run the firmware on M4; using bootaux 0x7E00000.
Later, I found out while booting into Linux, the program stops.
There are some discussions about clock sources. So I've checked if their registers are configured correctly. I've also checked M4 SRC RCR register if the CPU is in reset. I tend to use PLL2 DIV5 according to the reference manual since it's arm_m4_core's source clock. MCUXpresso project had PLL1 DIV3 as default. After I checked the reference manual, I've switched to PLL2 DIV5. Maybe there's something to do with AHB and AXI clocks, idk.
0x3039000C: 0xA8 (After running firmware and boot)
0x303809D0: 0x32 (After running firmware and boot)
1) M4 FreeRTOS FW:
CLOCK_SetRootDivider(kCLOCK_RootM4, 1U, 1U);
CLOCK_SetRootMux(kCLOCK_RootM4, kCLOCK_M4RootmuxSysPll2Div5);
CLOCK_SetRootDivider(kCLOCK_RootAhb, 1U, 1U);
CLOCK_SetRootMux(kCLOCK_RootAhb, kCLOCK_AhbRootmuxSysPll1Div6);
CLOCK_SetRootDivider(kCLOCK_RootAxi, 3U, 1U);
CLOCK_SetRootMux(kCLOCK_RootAxi, kCLOCK_AxiRootmuxSysPll1);
CLOCK_EnableClock(kCLOCK_Rdc);
2) In the DTS file, I have reserved TCM and DDR memories for M4 for Linux to not interfere with. Here is the imx8mq-cm4 node:
imx8mq-cm4 {
compatible = "fsl,imx8mq-cm4";
rsc-da = <0xb8000000>;
clocks = <&clk IMX8MQ_CLK_M4_DIV>;
mbox-names = "tx", "rx", "rxdb";
mboxes = <&mu 0 1
&mu 1 1
&mu 3 1>;
memory-region = <&vdevbuffer>, <&vdev0vring0>, <&vdev0vring1>, <&rsc_table>, <&m4_tcm_reserved>, <&m4_ddr_reserved>;
syscon = <&src>;
fsl,startup-delay-ms = <50000>; // Experimental, maybe it could delay the occuring interference with M4
status = "disabled"; // Prevent Linux from interfering with M4
};
I'm planning to support RPMessage too, that's why I need this configuration.
Basically, I'm going to need to start the M4 firmware on U-boot, check the M4 core's status and communicate with the core on Linux. What am I missing?
Thanks,
Onur