Skip to main content

iMX93

Hardware

Terminal application

You need a terminal application (two instances of it to connect both to the Cortex-A side and the Cortex-M side). We recommend Tera Term, but you can use the terminal application of your choice. Connect to the virtual COM ports using 115200 as baud rate, 8 data bits, 1 stop bit, and no parity.

Install an application

When using the ea-image-base image two example applications have already been installed on the eMMC flash: cm_TCM_rpmsg_lite_str_echo_rtos.bin and cm_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin.

Change the device tree file

Some of the u-boot environment variables need to be updated.

  1. You must have booted into the U-Boot console.

  2. Change which device tree file to use by Linux. The example below sets the file to use for the iMX93 uCOM Developer’s Kit. If you are using a different board just use the same name as set by default in the fdt_file variable and append -mX.

    setenv fdt_file imx93-ea-ucom-kit-m33.dtb
    saveenv

Run from TCM

The U-boot contains variables starting with cm_ that, by default, will load and boot an application built for TCM memory.

note

To load an application other than the default, modify the cm_image variable.

   setenv extra_bootargs clk_ignore_unused
saveenv
run cm_boot

Remote communication (RPMsg)

Ping-pong application

The RPMsg ping-pong application is an example of communication between the Cortex-A core and the Cortex-M core using the RPMsg API.

  1. Make sure the cm_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin file is available on eMMC .
  2. Follow the instruction in the Run from TCM section for how to run an application from TCM memory, but use the file name cm_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin.
  3. Boot the Cortex-M application
    run cm_boot
  4. In the console for the Cortex-M you will now see the output below
    RPMSG Ping-Pong FreeRTOS RTOS API Demo...
    RPMSG Share Base Addr is 0xb8000000
  5. In the console for Cortex-A boot into Linux
    boot
  6. When Linux has booted you need to load the rpmsg pingpong module.
    modprobe imx_rpmsg_pingpong
  7. You will now see messages in both consoles / terminals.

TTY application

The RPMsg TTY application is an example of communication between the Cortex-A core and the Cortex-M core using the RPMsg API. A TTY channel will be setup making it possible to send messages from the Cortex-A core to the Cortex-M core from Linux user-space.

  1. Make sure the cm_TCM_rpmsg_lite_str_echo_rtos.bin file is available on eMMC.
  2. Follow the instruction in the Run from TCM section for how to run an application from TCM memory, but use the file name cm_TCM_rpmsg_lite_str_echo_rtos.bin.
  3. Boot the Cortex-M application
    run cm_boot
  4. In the console for the Cortex-M you will now see the output below
    RPMSG String Echo FreeRTOS RTOS API Demo...
  5. In the console for Cortex-A boot into Linux
    boot
  6. When Linux has booted you need to load the rpmsg tty module. You will see a confirmation that a channel has been created (similar as below).
    modprobe imx_rpmsg_tty
    [   17.860278] imx_rpmsg_tty virtio0.rpmsg-virtual-tty-channel-1.-1.30: new channel: 0x400 -> 0x1e!
    [ 17.870207] Install rpmsg tty driver!
  7. From Linux you can now send a message to the Cortex-M side by using the new TTY channel (dev/ttyRPMSG0)
    echo hello > /dev/ttyRPMSG30

Software Development Kit (SDK)

NXP provides SDK’s for the iMX93 family of processors. These can be downloaded from NXP’s MCUXpresso website.

Download SDK

Follow these instructions to download an SDK from NXP’s website.

  1. Go the https://mcuxpresso.nxp.com (you must have an account to create and download an SDK).
  2. Click on Select Development Board and you will get to the MCUXpresso SDK Builder as shown the first figure below.
  3. Choose the i.MX processor you are using. In the first figure below the MCIMX93_EVK is selected under Boards > i.MX.
  4. Click Build SDK. This button is shown to the right in first figure below.
  5. When the SDK is ready select Host OS (we use Linux in this example) and then click on "Build SDK" as shown in the second figure below.

Select board - iMX93 EVK in this example

Download SDK

Setup a Linux host

These instructions are tested on an Ubuntu 18.04 Linux host. You can also run on other Linux hosts or on a Windows host. The SDK contains a "Getting Started" document with more instructions. This document can be found in the docs folder.

  1. Install toolchain
    sudo apt-get install gcc-arm-none-eabi binutils-arm-none-eabi
  2. Install cmake and make
    sudo apt-get install cmake make

Build in Linux

Once the toolchain has been installed you can unpack the SDK and build an application.

  1. Unpack the downloaded SDK (replace <download dir> with the directory where you downloaded the SDK.
    cd ~
    mkdir 93_sdk
    cp <download dir>/SDK_2_16_000_MCIMX93-EVK.tar.gz 93_sdk
    cd 93_sdk
    tar -xzvf SDK_2_16_000_MCIMX93-EVK.tar.gz
  2. The build scripts expect there to be an environment variable called ARMGCC_DIR pointing to the toolchain directory.
    export ARMGCC_DIR=/usr
  3. Go the armgcc directory of the application you want to build.
    cd boards/mcimx93evk/rtos_examples/freertos_hello/armgcc
  4. Run the build_debug.sh script to build the debug version of the RAM/TCM target.
    ./build_debug.sh
  5. Now the application will be available in the debug directory.
    ls debug
    freertos_hello.bin  freertos_hello.elf
  6. You can now copy and run freertos_hello.bin on target.