リネオブログ

OpenAMP on i.MX8 - Yocto Linux with FreeRTOS #3

2020 年 06 月 08 日   Linux 技術ネタ

Build and Setup

For i.MX8MQ Yocto, Prebuilt binaries for M4 cores will available in deploy/images/ directory. This can be used for testing the RPMsg functionality in i.MX8MQ EVK.

Here we are not mentioning the yocto setup and compilation. There are well made documentations from NXP available on this subject.

For downloading the latest source code of FreeRTOS for i.MX8MQ, we have to use MCUExpresso SDK generator online tool. Below is the link:

NXP : Login

Using this online SDK builder, we will be able to make a freeRTOS SDK with options to select the compiler (GCC/ IAR) as well as components and capabilities required in FreeRTOS.

Here we select FreeRTOS for GCC with USB and multicore communications as option.

Steps included:

  1. Downloading the FreeRTOS SDK for GCC,
  2. Download toolchain that supports FreeRTOS.

The compiler tested is gcc-arm-none-eabi-9-2019. This can be downloaded from https://launchpad.net/gcc-arm-embedded.

Toolchain setup

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=/home/lineo/i.MX8MQ/FreeRTOS/platforms/tmp/gcc-arm-none-eabi-9-2019-q4-major
$ export PATH= $PATH:/home/lineo/i.MX8MQ/FreeRTOS/platforms/tmp/gcc-arm-none-eabi-9-2019-q4-major/bin

Building RPMSG-lite sample application

Steps include:

  1. Change the directory to the application project directory, which has a path similar to the following:
<install_dir>/boards/boards/evkmimx8mq/multicore_examples/rpmsg_lite_str_echo_rtos/armgcc
  1. Run "./build_all.sh"

This will compile and create binaries. The binaries will be available as /home/lineo/i.MX8MQ/SDK_2.6.0_EVK-MIMX8MQ/boards/evkmimx8mq/multicore_examples/rpmsg_lite_str_echo_rtos/armgcc/release/rpmsg_lite_str_echo_rtos_imxcm4.bin

Testing

Make sure that Debug cable is connected. There will be two ttyUSB devices available. One will be for A53 and other for M4 cores.

  1. Stop at u-boot to boot the RPMsg binary in M4 core using bootaux command.
  2. Change the device tree for Linux to M4 device tree. This is already available in BSP. This is only device tree that supports RPMsg support.

Use the following commands to set the device tree:

$setenv fdt_file fsl-imx8mq-evk-m4.dtb
$sav
  1. Copy the binary (rpmsg_lite_str_echo_rtos_imxcm4.bin) to boot partition of the sdcard.
  2. Use the following commands:
$fatload mmc 1:1 0x7e0000 imx8mq_m4_TCM_rpmsg_lite_str_echo_rtos.binaries
$dcache flush
$bootaux 0x7e0000

This will boot the auxiliary core

$boot

This will boot the Linux Core.

While linux boots, you could see a message as below in bootlogs (dmesg):

"M4 is started"

  1. After booting completes use the following command to load the driver:
$modprobe imx_rpmsg_tty

This will create a character device file for interaction.

  1. Use echo command to write to the file.
$echo "this is a test" > /dev/ttyRPMSG30

This message will be printed at the M4 debug terminal.

NB: Most of the information (including images) are collected and consolidated from various online channels including "OpenAMP" , NXP's official documents, Wikipedia etc.

Yocto Project 公式実践講座 5 月 ~ 7 月 開催分 受講お申込み受付中!
Vigiles サポート
Yocto Project よもやま話
Yocto よもやま話 第 14 回 「Yocto 4.3 Nanbield リリース」
Yocto よもやま話 第 14 回 「Yocto 4.3 Nanbield リリース」

2024 年 03 月 26 日 Yocto Project よもやま話

Yocto よもやま話 第 13 回 「Yocto Project の最新動向 2023 夏」
Yocto よもやま話 第 13 回 「Yocto Project の最新動向 2023 夏」

2023 年 07 月 25 日 Yocto Project よもやま話

Yocto よもやま話 第 12 回 「Yocto Project 始めます その 2」
Yocto よもやま話 第 12 回 「Yocto Project 始めます その 2」

2023 年 06 月 20 日 Yocto Project よもやま話

Linux 技術ネタ
RISC-Vについて学ぶ-後編
RISC-Vについて学ぶ-後編

2024 年 01 月 10 日 Linux 技術ネタ

RISC-Vについて学ぶ-前編
RISC-Vについて学ぶ-前編

2023 年 12 月 12 日 Linux 技術ネタ

イベントレポート
EdgeTech+ 2023 出展レポート
EdgeTech+ 2023 出展レポート

2023 年 12 月 14 日 イベントレポート

EdgeTech+ West 2023 出展レポート
EdgeTech+ West 2023 出展レポート

2023 年 08 月 09 日 イベントレポート

Design Solution Forum 2022
Design Solution Forum 2022

2023 年 02 月 27 日 イベントレポート

リクルート
新卒採用、絶賛募集中!
新卒採用、絶賛募集中!

2023 年 05 月 30 日 リクルート

国立大学オンライン研修レポート 2022
国立大学オンライン研修レポート 2022

2022 年 09 月 27 日 リクルート

北小野通信
北小野通信 桜の季節、珍客来訪?
北小野通信 桜の季節、珍客来訪?

2023 年 05 月 11 日 北小野通信

北小野通信 「 日本土真ん中ウォーク 2022 」
北小野通信 「 日本土真ん中ウォーク 2022 」

2023 年 01 月 30 日 北小野通信

北小野通信 1011
北小野通信 1011

2022 年 10 月 11 日 北小野通信

ソリューション統括部
シリコンバレー探検記 2019 ~番外編~
シリコンバレー探検記 2019 ~番外編~

2019 年 12 月 10 日 ソリューション統括部

シリコンバレー探検記 2019 ~後編~
シリコンバレー探検記 2019 ~後編~

2019 年 12 月 10 日 ソリューション統括部

シリコンバレー探検記 2019 ~前編~
シリコンバレー探検記 2019 ~前編~

2019 年 12 月 10 日 ソリューション統括部

マーケティング統括部
大成功決起大会!!(ET2019)
大成功決起大会!!(ET2019)

2019 年 12 月 13 日 マーケティング統括部

ESEC 2019 決起大会
ESEC 2019 決起大会

2019 年 04 月 25 日 マーケティング統括部

シリコンバレー探検記 その 2
シリコンバレー探検記 その 2

2018 年 12 月 18 日 マーケティング統括部