Run application on Cortex-M of Colibri imx7d

Dear Team,

I want to run an application on the Cortex-M core of the Colibri iMX7D processor using the Colibri Evaluation Board.

I have checked out the source code from GitHub by following the instructions at:
Running FreeRTOS on the Cortex-M4 of a Colibri iMX7 | Toradex Developer Center
and set up the toolchain as described here:
Setting Up MCUXpresso SDK and Toolchain for Cortex-M development | Toradex Developer Center

I successfully compiled and built the hello_world.bin and hello_world.elf files for the hello_world example program. I’m trying to copy the output file using a USB drive in U-Boot. I have also disabled UART2 in the Linux device tree.

To load the binary, I am following the steps from this page:
How to Load Compiled Binaries into Cortex-M | Toradex Developer Center

I stopped the auto-boot process in U-Boot and executed the following commands:

setenv m4image hello_world.bin
setenv load_cmd “fatload usb 0:1”
setenv loadm4image “${load_cmd} ${loadaddr} ${m4image}”
setenv m4boot “${loadm4image}; dcache flush; bootaux ${loadaddr}”
run m4boot
setenv bootcmd “run m4boot; ${bootcmd}”
saveenv
reset

After executing the above commands, the Linux kernel hangs during boot.
Please help us resolve this issue.

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello!

For setting up FreeRTOS on the Cortex-M4 of a Colibri iMX7 with eMMC, please follow these steps:

  1. Configure UART_B: Ensure that UART_B is properly configured for FreeRTOS debug output. Set the debug console to a baud rate of 115200. This configuration is crucial for monitoring the system’s behavior. You can find more details in the Toradex documentation.

  2. Disable UART_B in Linux: To prevent conflicts, disable UART_B in the Linux device tree by setting its status property to “disabled.” This can be achieved by applying device tree overlays. This step ensures that the Linux kernel does not interfere with the UART_B used by FreeRTOS.

  3. Load Firmware Using ext4load: Instead of using fatload, use the ext4load method to load the firmware. The correct U-Boot commands are:

    > ubi part ubi
    > fatload mmc 0:1 ${loadaddr} hello_world.elf
    > ubi write ${loadaddr} m4firmware ${filesize}
    

    This method is recommended as it has been tested and validated for running FreeRTOS alongside Linux on the Colibri iMX7.

  4. Set Up Automatic Loading: Configure automatic loading of the firmware with the following commands:

    > setenv m4boot 'ubi read ${loadaddr} m4firmware && bootaux ${loadaddr}'
    > saveenv
    

    This setup ensures that the firmware is loaded automatically on boot.

If you are experiencing issues with the Linux kernel hanging, it may be due to improper handling of resource domain allocation between the A7 and M4 cores. Ensure that the Resource Domain Controller (RDC) is correctly configured, as it manages access to peripherals and memory areas for different bus masters.

I hope this helps you set up your system successfully. If you have any further questions, feel free to ask.

Best regards, Toradex AI Assistant.

Im using Colibri Imx7D 1GB emmc module , so i can’t use ubi tools to update . I have diasbled Uart2 in linux device tree as well . I configure Uart2 with SODIMM_36 AND SODIMM_38 pins , and GND on X10 connector of COLIBRI EVALUATION BOARD V3.2B

Hi @SHEKAR_REDDY_N,
Which BSP you are using?
Also, are you able to see the hello world output when you run hello_world.bin from u-boot?
Its just that when you load kernel, the booting process hangs, right?
Can you also share the debug output?