Difference between revisions of "IoTGateway/BSP/FreeRTOS IMX8ULP"

From ESS-WIKI
Jump to: navigation, search
(Created page with " Set up imx8 cortex m4 MCUxpress SDK environment = 1.Download the SDK = Download the SDK package according to the model of the chip or board from the following website [htt...")
 
Line 1: Line 1:
  
Set up imx8 cortex m4 MCUxpress SDK environment
+
Set up imx8ulp cortex m33 MCUxpress SDK environment
  
 
= 1.Download the SDK =
 
= 1.Download the SDK =
  
Download the SDK package according to the model of the chip or board from the following website
+
Download the SDK package from Advantech azure git server.
  
[https://mcuxpresso.nxp.com/ https://mcuxpresso.nxp.com/]
+
[https://AIM-Linux@dev.azure.com/AIM-Linux/RISC_MCU_SDK/_git/SDK_2_14_0_EVK9-MIMX8ULP [1]]
  
It can be search by board model or imx processor, the latest SDK package available for imx8m-board is EVK-MIMX8MQ.
+
 
  
 
= 2.Setup the cross compiler =
 
= 2.Setup the cross compiler =
Line 16: Line 16:
 
[https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads]
 
[https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads]
  
1.It is best to download the latest version cross-compiler gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 from the site and decompression it to get the directory gcc-arm-none-eabi-9-2019-q4-major.
+
1.It is best to download the latest version cross-compiler arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz from the site and decompression it to get the directory arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.
  
 
2.Create a new system environment variable and name it ARMGCC_DIR.
 
2.Create a new system environment variable and name it ARMGCC_DIR.
Line 22: Line 22:
 
The value of this variable should point to the Arm GCC Embedded tool chain installation path. For this example, the path is:
 
The value of this variable should point to the Arm GCC Embedded tool chain installation path. For this example, the path is:
  
$ export ARMGCC_DIR=/work/platforms/tmp/gcc-arm-none-eabi-9-2019-q4-major
+
$ export ARMGCC_DIR=/work/platforms/tmp/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi
  
 
= 3.Compile the demo code =
 
= 3.Compile the demo code =
Line 28: Line 28:
 
To build an example application, follow these steps.
 
To build an example application, follow these steps.
  
1.Extract the SDK package&nbsp;and&nbsp;change the directory to the example application project directory, which has a path similar to the following:&nbsp;<install_dir>/boards/<board_name>/<example_type>/<application_name>/armgcc.
+
1.Extract the SDK package and change the directory to the following application project directory&nbsp;:
  
For this example, the exact path is: <install_dir>/boards/evkmimx8mq/demo_apps/hello_world/armgcc
+
<install_dir>/boards/evk9mimx8ulp/demo_apps/'''adv_rtdfull'''/armgcc
  
2.Run the build_debug.sh script&nbsp;in the armgcc directory to perform the build. The output is shown in this figure:<br/> chmod u+x build_debug.sh<br/> ./build_debug.sh
+
2.&nbsp;Because some contents&nbsp;of adv_rtdfull are written considering the testing and applications of the A core, users need to ensure that their modifications do not affect these parts. Otherwise, they might encounter A core boot failures
  
-- BUILD_TYPE: debug -- Configuring done -- Generating done -- Build files have been written to: /home/jinmin/nvme/imx8/mcu/boards/evkmimx8mq/rtos_examples/freertos_hello/armgcc [ 3%] Building C object CMakeFiles/freertos_hello.elf.dir/home/jinmin/nvme/imx8/mcu/boards/evkmimx8mq/rtos_examples/freertos_hello/freertos_hello.c.obj [ 7%] Building C object CMakeFiles/freertos_hello.elf.dir/home/jinmin/nvme/imx8/mcu/boards/evkmimx8mq/rtos_examples/freertos_hello/pin_mux.c.obj
+
3.Run the build_debug.sh script&nbsp;in the armgcc directory to perform the build. The output is shown in this figure:<br/> chmod u+x build_debug.sh<br/> ./build_debug.sh
  
< skip--line >
+
Built target '''sdk20-app.bin'''
  
[100%] Linking C executable debug/freertos_hello.elf [100%]
+
= 4. Package M33 image to flash.bin =
  
Built target freertos_hello.elf
+
1.&nbsp;Get imx-boot tarball from our server. Here we use ROM-2620 VC0064 as an example:
  
= 4.Run the demo application =
+
$ tar xzvf 2620A1AIM34LIVC0064_iMX8ULP_1G_imx-boot.tgz
  
Connect the development platform to your PC via USB cable between the USB-UART connector and the PC USB connector.
+
2.&nbsp;Replace the m33 image by pre-build sdk20-app.bin file.
  
1.Open the terminal application on the PC, such as PuTTY or TeraTerm, and connect to the debug serial port number. Configure the terminal with these settings:<br/> &nbsp; a. 115200 baud rate, depending on your board (reference BOARD_DEBUG_UART_BAUDRATE variable in board.h file)<br/> &nbsp; b. No parity<br/> &nbsp;&nbsp;c. 8 data bits<br/> &nbsp; d. 1 stop bit
+
$ cp sdk20-app.bin 2620A1AIM34LIVC0064_iMX8ULP_1G_imx-boot/MX8ULP/m33_image.bin
  
2.Copy the compiled freertos_hello.elf to emmc's first partition
+
3.&nbsp;Change directory to imx-boot folder, and start packaging flash.bin.
  
3.Start the demo under uboot
+
$ cd 2620A1AIM34LIVC0064_iMX8ULP_1G_imx-boot/
  
In iMX8MQ:
+
$ make SOC=iMX8ULP REV=A1 flash_singleboot_m33
  
&nbsp; emmc:
+
Built target '''flash.bin''' in iMX8ULP subfolder.
  
&nbsp; U-Boot > fatload mmc 0:1 0x7e0000 freertos_hello.bin
+
&nbsp;
  
&nbsp; U-Boot > bootaux 0x7e0000
+
= 5. Burn flash.bin int eMMC =
  
&nbsp;sd card:
+
1.&nbsp;Config boot switch to serial download mode.
  
&nbsp; U-Boot > fatload mmc 1:1 0x7e0000 freertos_hello.bin
+
2.&nbsp;Connect OTG to PC side.
  
&nbsp; U-Boot > bootaux 0x7e0000
+
3.&nbsp;Use UUU command as below
  
In iMX8MM:
+
$ ./uuu -b emmc flash.bin
  
&nbsp;&nbsp; emmc:
+
&nbsp;
  
&nbsp; U-Boot > fatload mmc 1:1 0x7e0000 freertos_hello.bin
+
= 6. Run the demo application =
  
&nbsp; U-Boot > bootaux 0x7e0000
+
1.&nbsp;Config boot switch to eMMC boot mode.
  
&nbsp;&nbsp; sd card:
+
2.&nbsp;Connect COM (COM-E) to PC.
  
&nbsp; U-Boot > fatload mmc 0:1 0x7e0000 freertos_hello.bin
+
3.&nbsp;Power on system. And you will see below message&nbsp;:
  
&nbsp; U-Boot > bootaux 0x7e0000
+
&nbsp;
 
 
In iMX8MP:
 
 
 
*5.4.24_2.1.0 BSP
 
**emmc:
 
***U-Boot >&nbsp;fatload mmc 2:1 0x48000000 imx8mp_m7_TCM_hello_world.bin;cp.b 0x48000000 0x7e0000 20000;
 
***U-Boot > bootaux 0x7e0000 
 
**sd card:
 
***U-Boot >&nbsp;fatload mmc 1:1 0x48000000 imx8mp_m7_TCM_hello_world.bin;cp.b 0x48000000 0x7e0000 20000;
 
***U-Boot > bootaux 0x7e0000   
 
 
 
In iMX8QM and MX8QXP:
 
 
 
&nbsp; &nbsp;Need to disable the SCU debug for the ROM-5620
 
 
 
&nbsp;&nbsp; Put&nbsp;hello_world_m40.bin to first partition and rename m4_0.bin
 
 
 
&nbsp; &nbsp;U-Boot > run m4boot_0
 

Revision as of 05:30, 12 June 2024

Set up imx8ulp cortex m33 MCUxpress SDK environment

1.Download the SDK

Download the SDK package from Advantech azure git server.

[1]

 

2.Setup the cross compiler

Download and run the installer from launchpad.net/gcc-arm-embedded. This is the actual toolset (in other words, compiler,linker, and so on).

https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads

1.It is best to download the latest version cross-compiler arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz from the site and decompression it to get the directory arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.

2.Create a new system environment variable and name it ARMGCC_DIR.

The value of this variable should point to the Arm GCC Embedded tool chain installation path. For this example, the path is:

$ export ARMGCC_DIR=/work/platforms/tmp/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi

3.Compile the demo code

To build an example application, follow these steps.

1.Extract the SDK package and change the directory to the following application project directory :

<install_dir>/boards/evk9mimx8ulp/demo_apps/adv_rtdfull/armgcc

2. Because some contents of adv_rtdfull are written considering the testing and applications of the A core, users need to ensure that their modifications do not affect these parts. Otherwise, they might encounter A core boot failures

3.Run the build_debug.sh script in the armgcc directory to perform the build. The output is shown in this figure:
chmod u+x build_debug.sh
./build_debug.sh

Built target sdk20-app.bin

4. Package M33 image to flash.bin

1. Get imx-boot tarball from our server. Here we use ROM-2620 VC0064 as an example:

$ tar xzvf 2620A1AIM34LIVC0064_iMX8ULP_1G_imx-boot.tgz

2. Replace the m33 image by pre-build sdk20-app.bin file.

$ cp sdk20-app.bin 2620A1AIM34LIVC0064_iMX8ULP_1G_imx-boot/MX8ULP/m33_image.bin

3. Change directory to imx-boot folder, and start packaging flash.bin.

$ cd 2620A1AIM34LIVC0064_iMX8ULP_1G_imx-boot/

$ make SOC=iMX8ULP REV=A1 flash_singleboot_m33

Built target flash.bin in iMX8ULP subfolder.

 

5. Burn flash.bin int eMMC

1. Config boot switch to serial download mode.

2. Connect OTG to PC side.

3. Use UUU command as below

$ ./uuu -b emmc flash.bin

 

6. Run the demo application

1. Config boot switch to eMMC boot mode.

2. Connect COM (COM-E) to PC.

3. Power on system. And you will see below message :