Running an application by U-Boot

This section describes the steps to write a bootable SDK bin file to TCM or DRAM with the prebuilt U-Boot image for the i.MX processor. The following steps describe how to use the U-Boot:

  1. Connect the DEBUG UART slot on the board to your PC through the USB cable. The Windows OS installs the USB driver automatically, and the Ubuntu OS finds the serial devices as well.

  2. On Windows OS, open the device manager, find USB serial Port in Ports (COM and LPT). Assume that the ports are COM9 and COM10. One port is for the debug message from the Cortex-A53 and the other is for the Cortex-M7. The port number is allocated randomly, so opening both is beneficial for development. On Ubuntu OS, find the TTY device with name /dev/ttyUSB* to determine your debug port. Similar to Windows OS, opening both is beneficial for development.

    |

|

  1. Build the application (for example, hello_world) to get the bin file (hello_world.bin).

  2. Prepare an SD card with the prebuilt U-Boot image and copy bin file (hello_world.bin) into the SD card. Then, insert the SD card to the target board. Make sure to use the default boot SD slot and check the dipswitch configuration.

  3. Open your preferred serial terminals for the serial devices, setting the speed to 115200 bps, 8 data bits, 1 stop bit (115200, 8N1), no parity, then power on the board.

  4. Power on the board and hit any key to stop autoboot in the terminals, then enter to U-Boot command line mode. You can then write the image and run it from TCM or DRAM with the following commands:

    1. If the hello_world.bin is made from the debug/release target, which means the binary file will run at TCM, use the following commands to boot:

      • fatload mmc 1:1 0x48000000 hello_world.bin

      • cp.b 0x48000000 0x7e0000 0x20000

      • bootaux 0x7e0000

    2. If the hello_world.bin is made from the ddr_debug/ddr_release target, which means the binary file runs at DRAM, use the following commands:

      • fatload mmc 1:1 0x80000000 hello_world.bin

      • dcache flush

      • bootaux 0x80000000 Note: For m4 examples under the ddr target with Core A kernel boot, change the Linux dtb file specifically in U-Boot before the kernel starts. Use the following command:

    setenv fdtfile fsl-imx8mq-evk-m4.dtb
    save
    

    Note: For Linux release version L5.15.71-2.2.0 and later, the run prepare_mcore command must run before the bootaux command.

    |

|

|![](../images/u_boot_command_to_run_application_on_dram.png "U-Boot command to run application on DRAM")

|

  1. Open another terminal application on the PC, such as PuTTY and connect to the debug COM port (to determine the COM port number, see How to determine COM port). Configure the terminal with these settings:

    • 115200

    • No parity

    • 8 data bits

    • 1 stop bit

  2. The hello_world application is now running and a banner is displayed on the terminal. If this is not true, check your terminal settings and connections.

    |

|