diff --git a/documentation/source/quick-start/avenger-96-board.rst b/documentation/source/quick-start/avenger-96-board.rst index 59066c98b9adaf2ac0b27f46a5124ca449d83717..3680ab46dead0aceefa2f3d78aac7eb09ab0993c 100644 --- a/documentation/source/quick-start/avenger-96-board.rst +++ b/documentation/source/quick-start/avenger-96-board.rst @@ -11,7 +11,7 @@ For more details on Avenger 96 board, refer https://www.96boards.org/product/ave Bulding Zephyr onto Avenger96 board ************************************* -OpenHarmony can be hosted on top of variety of kernels. Currently supported kernels (a.k.a. OHOS flavours) are Linux. +OpenHarmony can be hosted on top of variety of kernels. Currently supported kernels (a.k.a. OHOS flavours) are Linux and Zephyr. To build OHOS flavour, use the following command syntax: @@ -69,6 +69,45 @@ To exit qemu, you can either shut down the system: root@stm32mp1-avg96:~# poweroff -f +OHOS Zephyr flavour +=================== + +OHOS Zephyr flavour is based on zephyr distribution and supports following images / machines: + +Supported images : core-image-minimal + +Supported machines : stm32mp1-avg96 + +Example: + +.. code-block:: console + + $ TEMPLATECONF=../sources/meta-ohos/flavours/zephyr . ./sources/poky/oe-init-build-env build-ohos-zephyr-qemu-x86 + $ bitbake zephyr-philosophers + +You can test the image built for the qemu-x86 target by issuing: + +.. code-block:: console + + $ DEPLOY_DIR_IMAGE=tmp-newlib/deploy/images/qemu-x86 runqemu qemu-x86 + +After successful bootup, you should see following: + +.. code-block:: console + + Booting from ROM..*** Booting Zephyr OS build zephyr-v2.4.0 *** + Philosopher 0 [P: 3] THINKING [ 300 ms ] + Philosopher 1 [P: 2] EATING [ 575 ms ] + Philosopher 2 [P: 1] STARVING + Philosopher 3 [P: 0] EATING [ 525 ms ] + Philosopher 4 [C: -1] THINKING [ 475 ms ] + +To exit qemu, use key combination: + +.. code-block:: console + + Ctrl-a followed by 'x' + Build image *********** @@ -95,6 +134,74 @@ Building the BSP for the Avenger96 follows the scheme of the above build process The last command will build the BSP. The full build will take about 1-2 hours dpending on machine and internet speed and will require around 25GB disk space. +Activation of remoteproc +======================== + +1. Build an example app for Avenger96: + +.. code-block:: console + + $ DISTRO=zephyr MACHINE=96b-avenger96 bitbake zephyr-philosophers + +2. Please be aware that Avenger96's Cortex-M4 core can be + programmed and got out of reset only by software running + on the Cortex-A7 core, e.g. by U-Boot or Linux. Therefore, + despite the SoC can enter DFU mode, it cannot be used + for programming the M4 firmware. This example uses Linux. + +3. Linux has to be built with remoteproc support. This can + be verified with simple dmesg inspection: + +.. code-block:: console + + root@stm32mp1-av96:~# dmesg | grep remoteproc + [ 2.336231] remoteproc remoteproc0: m4 is available + +4. Transfer the example app to the board, e.g. using scp. + The elf is located as usual in build/tmp-newlib/deploy/images/96b-avenger96/. + + +5. On the board, check the expected location of the fimrware image. + Empty path defaults to /lib/firmware. You can leave them as + they are and copy the Zephyr ELF file to the location pointed + by them or you can echo the new path and image name. + +.. code-block:: console + + root@stm32mp1-av96:~# cat /sys/module/firmware_class/parameters/path + <empty> + + root@stm32mp1-av96:~# cat /sys/class/remoteproc/remoteproc0/firmware + rproc-m4-fw + +6. After the image path and name are configured, start the M4 core: + +.. code-block:: console + + root@stm32mp1-av96:~# echo start > /sys/class/remoteproc/remoteproc0/state + remoteproc remoteproc0: powering up m4 + remoteprocroc remoteproc0: Booting fw image rproc-m4-fw, size 591544 + rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:m4_led (ops 0xc0be1210) + remoteproc remoteproc0: remote processor m4 is now + +7. Firmware output can be inspected with: + +.. code-block:: console + + root@stm32mp1-av96:~# cat /sys/kernel/debug/remoteproc/remoteproc0/trace0 + Philosopher 5 [C:-2] STARVING + Philosopher 3 [P: 0] DROPPED ONE FORK + Philosopher 3 [P: 0] THINKING [ 25 ms ] + Philosopher 2 [P: 1] EATING [ 425 ms ] + Philosopher 3 [P: 0] STARVING + Philosopher 4 [C:-1] STARVING + Philosopher 4 [C:-1] HOLDING ONE FORK + Philosopher 4 [C:-1] EATING [ 800 ms ] + Philosopher 3 [P: 0] HOLDING ONE FORK + Philosopher 2 [P: 1] DROPPED ONE FORK + Philosopher 2 [P: 1] THINKING [ 725 ms ] + Philosopher 1 [P: 2] EATING [ 225 ms ] + Flashing an Application to Avenger96 board ****************************************** When the build completes it puts all the required files into the'deploy' folder. Execute the following commands: