Skip to content
Arnaud Pouliquen edited this page Feb 3, 2022 · 17 revisions

Table of Contents

What is OpenAMP System Reference / End-to-end example ?

This working group aims to put together end-to-end system reference material showcasing all the different aspects of OpenAMP, on multiple vendor platforms.

Communications

  • To sign up for the mailing list and to see the archives, visit this page
  • Meetings: Small group who is working on the project is meeting meeting weekly on Wednesday during Aug-Oct 2021 & then will decide on frequency.

Repository

GitHub repository openamp-system-reference

Documentation

WIP documentation folder on Google Drive (Note: Google doc access is currently restricted to working group members. Will publish documents once they are sufficiently ready)

Milestones

Echo test

ST Echo Test Example

Intruction to install the yocto environement, build and load an image, run the echo exemple is available here: https://github.com/arnopo/oe-manifest/blob/OpenAMP/README.md

For more information and help on the stm32mp15 platform and environment, please refer to stm32mpu wiki.

Xilinx Echo Test Example

WIP document (Note: Google doc access is currently restricted to working group members. To publish once it is sufficiently ready)

Multi RPMSG services demo

STM32MP157C/F-DK2 board

Based on:

Prerequisite

TBC

Installation

Create the structure of the project

mkdir stm32mp15-demo
cd stm32mp15-demo
mkdir zephy_distrib
mkdir stm32mp1_distrib_oss
At this step you should see following folder hierarchy:
stm32mp15-demo
    |___ stm32mp1_distrib_oss
    |___ zephy_distrib

Generate the stm32mp15 image

Install stm32mp1_distrib_oss dunfell

From the 'stm32mp15-demo' directory

cd stm32mp1_distrib_oss

mkdir -p layers/meta-st
git clone https://github.com/openembedded/openembedded-core.git layers/openembedded-core
cd layers/openembedded-core
git checkout -b WORKING origin/dunfell
cd -

git clone https://github.com/openembedded/bitbake.git layers/openembedded-core/bitbake
cd layers/openembedded-core/bitbake
git checkout -b WORKING  origin/1.46
cd -

git clone git://github.com/openembedded/meta-openembedded.git layers/meta-openembedded
cd layers/meta-openembedded
git checkout -b WORKING origin/dunfell
cd -

git clone https://github.com/arnopo/meta-st-stm32mp-oss.git layers/meta-st/meta-st-stm32mp-oss
cd layers/meta-st/meta-st-stm32mp-oss
git checkout -b WORKING origin/dunfell
cd -
Initialize the OpenEmbedded build environment

The OpenEmbedded environment setup script must be run once in each new working terminal in which you use the BitBake or devtool tools (see later) from 'stm32mp15-demo/stm32mp1_distrib_oss' directory:

 source ./layers/openembedded-core/oe-init-build-env build-stm32mp15-disco-oss

 bitbake-layers add-layer ../layers/meta-openembedded/meta-oe
 bitbake-layers add-layer ../layers/meta-openembedded/meta-perl
 bitbake-layers add-layer ../layers/meta-openembedded/meta-python
 bitbake-layers add-layer ../layers/meta-st/meta-st-stm32mp-oss

 echo "MACHINE = \"stm32mp15-disco-oss\"" >> conf/local.conf
 echo "DISTRO = \"nodistro\"" >> conf/local.conf
 echo "PACKAGE_CLASSES = \"package_deb\" " >> conf/local.conf
Build stm32mp1_distrib_oss image

From 'stm32mp15-demo/stm32mp1_distrib_oss/build-stm32mp15-disco-oss/' directory

 bitbake core-image-base
Note that:
  • to build around 30 GB is needed
  • building the distribution can take more than 2 hours depending on performance of the PC.
Flash stm32mp1_distrib_oss

From 'stm32mp15-demo/stm32mp1_distrib_oss/build-stm32mp15-disco-oss/' directory,populate your microSD card inserted on your HOST PC using command:

 cd tmp-glibc/deploy/images/stm32mp15-disco-oss/
 # flash wic image on your sdcar. replace <device> by mmcblk<X> (X = 0,1..) or sd<Y> ( Y = b,c,d,..) depending on the connection 
 dd if=core-image-base-stm32mp15-disco-oss.wic of=/dev/<device> bs=8M conv=fdatasync

Generate the Zephyr firmware image

Install meta-zephyr Honister version

From 'stm32mp15-demo' directory

cd zephy_distrib

git clone https://github.com/openembedded/openembedded-core.git layers/openembedded-core
cd layers/openembedded-core
git checkout -b WORKING origin/honister
cd -

git clone https://github.com/openembedded/bitbake.git layers/openembedded-core/bitbake
cd layers/openembedded-core/bitbake
git checkout -b WORKING  origin/1.46
cd -

git clone git://github.com/openembedded/meta-openembedded.git layers/meta-openembedded
cd layers/meta-openembedded
git checkout -b WORKING origin/honister
cd -

git clone https://github.com/arnopo/meta-zephyr.git layers/meta-zephyr
cd layers/meta-zephyr
git checkout -b WORKING origin/OpenAMP_demo
cd -
Initialize the OpenEmbedded build environment

The OpenEmbedded environment setup script must be run once in each new working terminal in which you use the BitBake or devtool tools (see later) from the 'stm32mp15-demo/zephy_distrib' directory:

MACHINE="stm32mp157c-dk2" DISTRO="zephyr" source layers/openembedded-core/oe-init-build-env build-zephyr
bitbake-layers add-layer ../layers/meta-openembedded/meta-oe/
bitbake-layers add-layer ../layers/meta-openembedded/meta-python/
bitbake-layers add-layer ../layers/meta-zephyr/
Build the Zephyr image

For instance to build the zephyr-openamp-rsc-table example which answers to the Linux rpmsg sample client example: From the 'stm32mp15-demo/zephy_distrib/build-zephyr' directory:

MACHINE="stm32mp157c-dk2" DISTRO="zephyr" bitbake zephyr-openamp-rsc-table
Note that:
  • to build around 30 GB is needed
  • building the distribution can take 1 or 2 hours depending on performance of the PC.
Install the Zephyr binary on the sdcard

The Zephyr sample binary is available in the sub-folder of build directory stm32mp15-demo/zephy_distrib/build-zephyr/tmp-newlib/deploy/images/stm32mp157c-dk2/'. It needs to be installed on the "rootfs" partition of the sdcard

sudo cp tmp-newlib/deploy/images/stm32mp157c-dk2/zephyr-openamp-rsc-table.elf <mount point>/rootfs/lib/firmware/
Don't forget to properly unoumt the sdcard partitions.

Demos

Start the demo environment
stm32mp15-disco-oss login: root
  • start the Cortex-M4 firmware
echo zephyr-openamp-rsc-table.elf > /sys/class/remoteproc/remoteproc0/firmware 
echo start >/sys/class/remoteproc/remoteproc0/state 
you should observe following traces on console
root@stm32mp15-disco-oss:~#
[   54.495343] virtio_rpmsg_bus virtio0: rpmsg host is online
[   54.500044] virtio_rpmsg_bus virtio0: creating channel rpmsg-client-sample addr 0x400
[   54.507923] virtio_rpmsg_bus virtio0: creating channel rpmsg-tty addr 0x401
[   54.514795] virtio_rpmsg_bus virtio0: creating channel rpmsg-raw addr 0x402
[   54.548954] rpmsg_client_sample virtio0.rpmsg-client-sample.-1.1024: new channel: 0x402 -> 0x400!
[   54.557337] rpmsg_client_sample virtio0.rpmsg-client-sample.-1.1024: incoming msg 1 (src: 0x400)
[   54.565532] rpmsg_client_sample virtio0.rpmsg-client-sample.-1.1024: incoming msg 2 (src: 0x400)
[   54.581090] rpmsg_client_sample virtio0.rpmsg-client-sample.-1.1024: incoming msg 3 (src: 0x400)
[   54.588699] rpmsg_client_sample virtio0.rpmsg-client-sample.-1.1024: incoming msg 4 (src: 0x400)
[   54.599424] rpmsg_client_sample virtio0.rpmsg-client-sample.-1.1024: incoming msg 5 (src: 0x400)
...
This inform that following rpmsg channels devices have been created:
  • a rpmsg-client-sample device
  • a rpmsg-tty device
  • a rpmsg-raw device
Demo 1: rpmsg-client-sample device
  • Principle:
This demo is automatic run when the coprocessor firmware is started. It allows to confirm that the rpmsg and virtios protocols are working properly.
  • The Zephyr requests the creation of the rpmsg-client-sample channel to the Linux rpmsg framework using the "name service announcement" rpmsg.
  • On message reception the Linux rpmsg bus create an associted device and probe the [rpmsg-client-sample](https://elixir.bootlin.com/linux/latest/source/samples/rpmsg/rpmsg_client_sample.c)
  • The Linux rpmsg-client-sample driver sent 100 rpmsg to the remote processor, which answer to each message
  • After anwsering to each rpmsg the Zephy destroy the channel
  • Associated traces:
[   54.548954] rpmsg_client_sample virtio0.rpmsg-client-sample.-1.1024: new channel: 0x402 -> 0x400!
[   54.557337] rpmsg_client_sample virtio0.rpmsg-client-sample.-1.1024: incoming msg 1 (src: 0x400)
[   54.565532] rpmsg_client_sample virtio0.rpmsg-client-sample.-1.1024: incoming msg 2 (src: 0x400)
...
[   55.436401] rpmsg_client_sample virtio0.rpmsg-client-sample.-1.1024: incoming msg 99 (src: 0x400)
[   55.445343] rpmsg_client_sample virtio0.rpmsg-client-sample.-1.1024: incoming msg 100 (src: 0x400)
[   55.454280] rpmsg_client_sample virtio0.rpmsg-client-sample.-1.1024: goodbye!
[   55.461424] virtio_rpmsg_bus virtio0: destroying channel rpmsg-client-sample addr 0x400
[   55.469707] rpmsg_client_sample virtio0.rpmsg-client-sample.-1.1024: rpmsg sample client driver is removed

Future work

Efforts

  • Baremetal-baremetal
  • RTOS-RTOS

High level plan for Xilinx Software Stack

  • QEMU & initial doc – Mid Sept.
  • Userspace & kernel space demos – Sept end
  • Hardware demo – End - Oct.
  • System-dt flow (Without using Xilinx tools) – End-Nov
  • Advanced app – End-Jan
  • Completely upstream flow – (Based on When Xilinx driver is merged in upstream kernel)