IoTGateway/BSP/FreeRTOS IMX8ULP

From ESS-WIKI
Jump to: navigation, search

Set up imx8ulp cortex m33 MCUxpress SDK environment

1.Download the SDK

Download the SDK package from Advantech azure git server.

https://AIM-Linux@dev.azure.com/AIM-Linux/RISC_MCU_SDK/_git/SDK_2_14_0_EVK9-MIMX8ULP

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=A2 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 :

--~~~~--~~~~##################### Power Mode Switch Task --~~~~--~~~~#####################
        Build Time: Jun 27 2023--09:44:46
        Core Clock: 160000000Hz
        Boot Type: Single Boot Type

Select the desired test mode
<Need system reboot first if you want to change to another mode>

Press  C for test mode of CAN bus
Press  Q for test mode of QSPI
Press  M for test mode of LPSPI master
Press  S for test mode of LPSPI slave
Press  U for test mode of LPUART

Waiting for mode select...