[Getting Started] Running the i.MX 93 Cortex-M SDK Sample Code - [Part 3] Automatically Starting the M Core with a Bootloader (Japanese Blog) This three-part series provides hands-on instructions on how to build and run SDK sample code for the Cortex-M33 core in the NXP i.MX 93 applications processor.
In this article (Part 3), we will introduce the procedure for automatically starting the M Core using a bootloader as a way to automatically start a pre-built M Core image on an evaluation board.
[Part 1 ] Building a development environment and M core image
[Part 2] M-core execution using U-Boot and remoteproc
[ Part 3] Automatic startup of M-core using bootloader (this article)
Contents of the 3rd session
4. Automatic startup of M-core by bootloader
4.1 Single boot
4.2 Low Power Boot
4. Automatic startup of M-core by bootloader
This procedure assumes that imx-boot has already been built in Yocto.
To make the M33 boot automatically, you need to build a bootloader that includes the M core image . Therefore, copy the M core image to the imx-boot directory as follows:
$ cd ~/FRDM-93/6.6.36-2.1.0/frdm-imx93/tmp/work/imx93frdm-poky-linux/imx-boot/1.0/git
$ cp ディレクトリ>/boards/mcimx93evk/demo_apps/power_mode_switch/armgcc/debug/power_mode_switch_rtos_imx93.bin iMX93/m33_image.bin
*Replace with the actual path.
You will need to create a boot loader suitable for each of the following two boot methods. The following explains how to build and write each.
4.1 Single boot: Normal boot mode ( starting from Cortex-A55 ROM)
4.2 Low-power boot: Starting from low-power state (starting from Cortex-M33 ROM)
4.1 Single boot
In a single boot, the Cortex-A55 ROM loads all containers and images, then jumps to the A55's firmware (FW).
If the container contains a Cortex-M33 firmware image, the Cortex-A55 ROM first loads the Cortex-M33 firmware image, places it in shared RAM (the Cortex-M33 TCM), and requests the EdgeLock Secure Enclave to verify the image. It then writes the CM33 firmware entry point address to the SRC GPR19 register, launches the CM33 core, and continues the A55 ROM boot process. For details, see "9.6.5 Single Boot Flow (Cortex-A55)" in the i.MX 93 Applications Processor Reference Manual .
①Build the bootloader
Applied build scripts
flash_singleboot_m33: $(MKIMG) $(AHAB_IMG) u-boot-atf-container.img $(MCU_IMG) $(SPL_A55_IMG)
./$(MKIMG) -soc IMX9 -append $(AHAB_IMG) -c -m33 $(MCU_IMG) 0 $(MCU_TCM_ADDR) $(MCU_TCM_ADDR_ACORE_VIEW) \
-ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR) -out flash.bin
$(call append_container,u-boot-atf-container.img,1)
Build Procedure
$ make SOC=iMX93 flash_singleboot_m33
$ cd iMX93
$ cp flash.bin flash_frdm_singleboot_m33.bin
②Writing to SD card
If you use uuu:
Change BOOT_MODE to Cortex-A55 serial downloader[1000] and run the following:
$ sudo uuu -b sd
Using the dd command
This is a method to write an image directly from the host PC to the SD card. Connect the target SD card to the host PC using an SD card reader/writer.
$ sudo dd if=flash_frdm_singleboot_m33.bin of=/dev/sd[x] bs=1k seek=32 conv=fsync
dev/sd[x] is the device name of the SD card.
<参考記事>
How to build a Linux BSP and write the generated image to the target board
③ Check the startup on the console
For SD card boot, change BOOT_MODE to Cortex-A55 USDHC2 4-bit SD3.0[1100].
Turn on the EVK power and if you can see the following output on the PC console (teraterm/minicom, etc.), the setup was successful.
Verify that the console display looks like this:
A55 Console:
M33 Console:
4.2 Low Power Boot
In Low Power Boot (LPB), the Cortex-A55 core is asleep, so only the Cortex-M33 is running after POR (Power on Reset). The Cortex-M33 ROM loads the container and image, then jumps to the CM33 FW. For details, see " 9.6.6 Low Power Boot Flow (Cortex-M33) " in the i.MX 93 Applications Processor Reference Manual .
①Build the bootloader
Applied build scripts
flash_lpboot: $(MKIMG) $(AHAB_IMG) $(MCU_IMG)
./$(MKIMG) -soc IMX9 -append $(AHAB_IMG) -c \
-m33 $(MCU_IMG) 0 $(MCU_TCM_ADDR) -out flash.bin
Build Procedure
$ make SOC=iMX93 flash_lpboot
$ cd iMX93
$ cp flash.bin flash_frdm_lpboot.bin
②Writing to SD card
Posted by uuu
Change BOOT_MODE to Cortex-A55 serial downloader[1000] and run the following:
$ sudo uuu -b sd
Writing with the dd command
This is a method to write an image directly from the host PC to the SD card. Connect the target SD card to the host PC using an SD card reader/writer.
$ sudo dd if=flash_frdm_lpboot.bin of=/dev/sd[x] bs=1k seek=32 conv=fsync
dev/sd[x] is the device name of the SD card.
③Consider starting up
For SD card boot, change BOOT_MODE to Cortex-A55 USDHC2 4-bit SD3.0[1100].
Turn on the EVK power and check that the boot log is displayed on the PC console (teraterm/minicom, etc.).
Verify that the console display looks like this:
A55 Console:
Nothing is displayed
M33 Console:
In this article, we explained two configurations for automatically booting the M core using the bootloader : Single Boot and Low Power Boot.
○ This time : [Part 3] Automatic startup of M-core by boot loader (this article)
Previous article : [Part 2] M-core execution using U-Boot and remoteproc
←← Previous article : 【Part 1】Building a development environment and M core image
=========================
We are currently unable to respond to comments in the " Comment " section of this post . We apologize for the inconvenience, but when making inquiries, please refer to " How to contact NXP with technical questions ( Japanese blog ) " . (If you are already an NXP distributor or have a relationship with NXP , you may ask the person in charge directly.)
This series will cover three hands-on articles that explain how to build and run SDK sample code for the Cortex-M33 core in i.MX 93 using the low-cost, compact development board, the FRDM i.MX 93 Development Board .
[Part 1] Building a development environment and M core image
[Part 2] M-core execution using U-Boot and remoteproc
[Part 3] Automatic startup of M-core using bootloader (this article)
i.MX Processors Japanese blog
查看全文