2148816_en-US

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

2148816_en-US

2148816_en-US

[Introduction] Running the i.MX 93 Cortex-M SDK Sample Code - [Part 2] Running the M Core with U-Boot and remoteproc (Japanese blog)

This three-part series provides hands-on instruction on how to build and run SDK sample code for the Cortex-M33 core in the NXP i.MX 93 applications processor .

In this second article, we will explain how to run a pre-built M core image on an evaluation board using U-Boot and remoteproc .


Contents of the 2nd session


3. Running the M core image


There are two ways to run an M33 core image from A55: "running from U-Boot" and "running from remoteproc," as shown in the figure below.

yuher64908_1-1760516949951.png

Now, I'll explain each method.

3.1 Cortex-M33 TCM Memory Mapping


As stated in the ARM documentation below, M33 code must be run in Privileged/Secure mode.

The Cortex-M33 processor supports Secure and Non-secure security states, Thread and Handler operating modes, and can run in either Thumb or Debug operating states. In addition, the processor can limit or exclude access to some resources by executing code in privileged or unprivileged mode.

Code can execute as privileged or unprivileged. Unprivileged execution limits or excludes access to some resources appropriate to the current security state. Privileged execution has access to all resources available to the security state. Handler mode is always privileged. Thread mode can be privileged or unprivileged.

Check the address map of the i.MX 93 TCM (Tightly Coupled Memory) area and organize the access addresses from the Cortex-M33 and Cortex-A55.

The following is an excerpt from the i.MX 93 Applications Processor Reference Manual :

yuher64908_0-1754615965022.png

  • TCM address for M33 viewpoint:0x1FFE0000
  • TCM address for A55 viewpoint:0x201E0000

*For details, please refer to the following section in the i.MX 93 Applications Processor Reference Manual.

" 2.2 System memory map used by all initiators other than the Cortex-M33 core "

" 2.3 System memory map (Cortex-M33)"


3.2 Writing to the FAT partition of the SD card

This article explains how to write the M core image to an SD card using the uuu tool or the Ubuntu cp command . For
more information, please also refer to the article " How to build a Linux BSP and write the generated image to the target board ."

  • Posted by uuu

Set BOOT_MODE to "Cortex-A55 USDHC1 8-bit eMMC 5.1 [0100]" and start U-Boot.

eMMC_boot.png

②Start fastboot with U-Boot

Uboot=> fastboot 0

[ Tip ] : "fastboot 0" is a convenient command that allows you to switch to USB Serial Loader mode without changing the DIP SW.

③ Write to the SD card from the host PC with uuu -b fat_write

$ uuu -b fat_write power_mode_switch_rtos_imx93.bin mmc 1:1 power_mode_switch_rtos_imx93.bin

  • Writing using the cp command (Ubuntu)

Use an SD card reader and copy directly to the FAT partition

$ cp power_mode_switch_rtos_imx93.bin /media/xxx/boot
$ cp power_mode_switch_rtos_imx93_cm33.elf /media/xxx/boot

 

3.3 Running from U-Boot


This article explains how to load the M33 image on U-Boot and run it with the bootaux command. It also includes setting environment variables before starting Linux.

① Load the M33 image with U-Boot and run it

u-boot=> fatload mmc 1:1 ${loadaddr} power_mode_switch_rtos_imx93.bin
36484 bytes read in 6 ms (5.8 MiB/s)
u-boot=> cp.b ${loadaddr} 0x201e0000 ${filesize}
u-boot=> bootaux 0x1ffe0000 0
## Starting auxiliary core addr = 0x1FFE0000...

Before starting Linux, run prepare_mcore in U-Boot and add clk_ignore_unused to the U-Boot mmcargs environment variable.

u-boot=>run prepare_mcore
u-boot=>setenv mmcargs  setenv bootargs ${jh_clk} ${mcore_clk} clk_ignore_unused console=${console} root=${mmcroot}

③ Start Linux

u-boot=>boot

The following will be displayed on the M33 terminal.

power_switch.png

By performing the suspend/wakeup operation on the A55, you can check the cooperation with the M33.

On the A55, suspend it by running:

root@imx93frdm:~# echo mem > /sys/power/state

suspend.png

Enter the "W" command on the M33 to wake up the A55:

m33_wake.png

Confirmed return of A55:

a55_wake.png

 

3.4 What is remoteproc?

remoteproc (Remote Processor Framework) is a mechanism that allows the Linux kernel to control remote processors such as the Cortex-M33. It allows the M33 firmware to be loaded, started, and stopped from Linux, enabling flexible system design in multi-core SoCs.

With i.MX 93, remoteproc allows you to dynamically control the M33 from Linux, enabling designs that separate and execute real-time processing and safety functions.

  • Main functional configuration
function explanation
Loading Firmware Loads an ELF binary into the specified memory location.
Processor start/stop Start/stop control
Resource Management Shared memory and communication channel configuration using resource_table
IPC Collaboration Message communication between Linux and M33 using rpmsg
  • Components
component explanation
/lib/firmware/ M33 firmware location directory
resource_table Resource information structure in firmware
remoteproc driver Control driver in the Linux kernel (e.g. imx_rproc)
sysfs interface Can be controlled by /sys/class/remoteproc/remoteprocX/

 

3.5 Execution from remoteproc


Learn how to load, run, and stop M33 images using the remoteproc framework

① Run prepare_mcore in U-Boot , add clk_ignore_unused to the U-Boot mmcargs environment function, and start Linux.

u-boot=>run prepare_mcore
u-boot=>setenv mmcargs setenv bootargs ${jh_clk} ${mcore_clk} clk_ignore_unused console=${console} root=${mmcroot}
u-boot=>boot

After booting Linux, copy the M33 image to /lib/firmware/

root@imx93frdm:~# mount /dev/mmcblk1p1 /mnt
root@imx93frdm:~# cp /mnt/power_mode_switch_rtos_imx93_cm33.elf  /lib/firmware/

③ Specify the firmware to remoteproc

root@imx93frdm:~# echo /lib/firmware/power_mode_switch_rtos_imx93_cm33.elf >/sys/devices/platform/remoteproc-cm33/remoteproc/remoteproc0/firmware

④ Start the M33 image

root@imx93frdm:~# echo start > /sys/devices/platform/remoteproc-cm33/remoteproc/remoteproc0/state

The following will be displayed in the M33 terminal.

 single_boot_M.png


⑤Stop the execution of the M33 image from remoteproc.

root@imx93frdm:~# echo stop > /sys/devices/platform/remoteproc-cm33/remoteproc/remoteproc0/state

In this article, we introduced the steps to run a pre-built M core image on the FRDM-i.MX93 evaluation board using U-Boot and remoteproc .

In the next article, we will explain how to automatically start these binaries using the bootloader .


Next time : [ Part 3] Automatic startup of M-core using bootloader

○ This time : [Part 2] M-core execution using U-Boot and remoteproc (this article)


===========================

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 contact 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 (this article)
  • [Part 3] Automatic startup of M core using boot loader
i.MX ProcessorsJapanese blog
タグ(1)
評価なし
バージョン履歴
最終更新日:
‎11-23-2025 09:34 AM
更新者: