Skip to content
Snippets Groups Projects
Commit 3e3a3007 authored by ARUL DEVARAJAN's avatar ARUL DEVARAJAN Committed by Wojciech Zmuda
Browse files

quick-start: remove Avenger and Nitrogen documents


Detailed boards documents live in docs/supported-boards
repository. Remove them from here and reference the
supported-boards repo instead.

Signed-off-by: default avatarArul Devarajan <arulkumaran.devarajan@huawei.com>
parent 50ee2f62
No related branches found
No related tags found
No related merge requests found
.. include:: definitions.rst .. include:: definitions.rst
Welcome to |main_project_name| documentation! Welcome to |main_project_name| documentation!
====================================== #############################################
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
...@@ -9,4 +9,4 @@ Welcome to |main_project_name| documentation! ...@@ -9,4 +9,4 @@ Welcome to |main_project_name| documentation!
overview/Readme-EN overview/Readme-EN
quick-start/Readme-EN quick-start/Readme-EN
readme/Readme-EN readme/Readme-EN
term/glossary term/glossary
\ No newline at end of file
Overview .. include:: definitions.rst
========
|main_project_name|Overview
###########################
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
......
Quick-Start Getting Started
=========== ###############
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
build-open-harmony build-open-harmony
supported-boards
Avenger 96 Board
################
The STM32MP157 is a highly integrated multi-market system-on-chip designed to enable secure and space constraint applications within the Internet of Things. Open harmony OS based supports Linux 5.4 for Cortex-A7 cre and ZEphyr for Cortex-M4. In addition, an extensive set of interfaces and connectivity peripherals are included to interface to cameras, touch-screen displays an MMC/SD cards. It also fully supports wireless communication, including WLAN and BLE.
.. figure:: images/avenger96.png
Figure 1 Avenger 96 Board
For more details on Avenger 96 board, refer https://www.96boards.org/product/avenger96/.
Bulding Linux and Zephyr onto Avenger96 board
*********************************************
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:
.. code-block:: console
$ TEMPLATECONF=../sources/meta-ohos/flavours/<lower_case_flavour> . ./sources/poky/oe-init-build-env build-<flavour>-<stm32mp1-avg96>
$ bitbake <image-name>
MACHINE variable can be set up in conf/local.conf file under build directory or via command line:
Example:
.. code-block:: console
$ MACHINE=<stm32mp1-avg96> bitbake <image-name>
OHOS Linux flavour
===================
OHOS Linux flavour is based on poky distribution
Supported images : core-image-minimal
Supported machines : stm32mp1-avg96
Example:
.. code-block:: console
$ TEMPLATECONF=../sources/meta-ohos/flavours/linux . ./sources/poky/oe-init-build-env build-ohos-linux-stm32mp1-avg96
$ bitbake core-image-minimal
You can test the image built for the stm32mp1-avg96 target by issuing:
.. code-block:: console
$ runqemu stm32mp1-avg96 qemuparams="-nographic"
After successful bootup, you should see following:
.. code-block:: console
Poky (Yocto Project Reference Distro) 3.1.4 stm32mp1-avg96 /dev/ttyS0
stm32mp1-avg96 login:
Default login is root without a password. After login you should see following prompt:
.. code-block:: console
root@qstm32mp1-avg96:~#
To exit qemu, you can either shut down the system:
.. code-block:: console
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
***********
Creating a uSD card image for the Avenger96 board
=================================================
Steps for building a BSP for ST's development boards can be referred: `<https://wiki.st.com/stm32mpu/index.php/STM32MP1_Distribution_Package>`_
Building the BSP for the Avenger96 follows the scheme of the above build process but starts with a different 'repo' manifest file:
* create the build directory following ST's recommendations at : https://wiki.st.com/stm32mpu/wiki/Example_of_directory_structure_for_Packages
* enter the working directory and execute the following commands :
.. code-block:: console
$ repo init -u https://github.com/dh-electronics/manifest-av96 -b dunfell
$ repo sync
$ source layers/meta-arrow/scripts/init-build-env.sh
$ bitbake av96-weston
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:
.. code-block:: console
$ cd tmp-glibc/deploy/images/stm32mp1-av96/
$ ./scripts/create_sdcard_from_flashlayout.sh stm32mp1-avg96/flashlayout_core-image-base/extensible/FlashLayout_sdcard_stm32mp157a-av96-extensible.tsv
The last command creates FlashLayout_sdcard_stm32mp157a-av96-trusted.raw.
We can write it to a uSD card with:
.. code-block:: console
$ sudo dd if=FlashLayout_sdcard_stm32mp157a-av96-trusted.raw bs=1M of=/dev/sdX && sync where /dev/sdX is the block device of the inserted uSD card.
Once you have built your own AV96 Yocto image, your build provides all the files you need to use the Cube Programmer.
Note: For more information related to Aenger96 image programming refer : https://wiki.dh-electronics.com/index.php/Avenger96_Image_Programming
documentation/source/quick-start/images/avenger96.png

370 KiB

documentation/source/quick-start/images/nitrogen_board.jpg

33.7 KiB

Nitrogen 96 Board
#################
Nitrogen is a 96Boards compliant IoT Edition board which aims to provide economic and compact BLE solutions for a variety of IoT projects. This board features the nRF52832 microcontroller by Nordic, 64kb of RAM and 512kb of onboard flash storage. An easily accessible 40 pin low-speed expansion connector and onboard antenna offer a wide variety of IO on the much desired 96Boards IoT form factor. The 96Boards Nitrogen hardware provides support for the Nordic Semiconductor nRF52832 ARM Cortex-M4F CPU.
.. figure:: images/nitrogen_board.jpg
Figure 1 Nitrogen 96 Board
For more details on Nitrogen 96 board, refer https://www.96boards.org/documentation/iot/nitrogen/.
Installing pyOCD
****************
pyOCD is an open source Python package for programming and debugging Arm Cortex-M microcontrollers using multiple supported types of USB debug probes. It is fully cross-platform, with support for Linux.
The latest stable version of pyOCD can be installed via `pip <https://pip.pypa.io/en/stable/>`_ as follows:
.. code-block:: console
pip install --pre -U pyocd
TTo install the latest prerelease version from the HEAD of the master branch, you can do the following:
.. code-block:: console
pip install --pre -U git+https://github.com/mbedmicro/pyOCD.git
You can also install directly from the source by cloning the git repository and running:
.. code-block:: console
python setup.py install
You can then verify that your board is detected by pyOCD by running:
.. code-block:: console
pyocd-flashtool -l
Common errors in pyOCD
======================
* If you do not use sudo when invoking pyocd-flashtool, you might get any of the following errors:
.. code-block:: console
No available boards are connected
No connected boards
Error: There is no board connected
* Lack of permission gets reported as ValueError (The device has no langid), perform the instructions as suggested in
https://github.com/pyocd/pyOCD/tree/master/udev.
Flashing an Application to 96Boards Nitrogen
********************************************
The 96Boards Nitrogen board can be flashed via the CMSIS DAP interface. CMSIS-DAP provides a standardized way to access the Coresight Debug Access Port (DAP) of an ARM Cortex microcontroller via USB.
Using the CMSIS-DAP interface, the board can be flashed via the USB storage interface (drag-and-drop) and also via pyOCD.
For flashing an application to board **pyocd** must be installed in your system. You can flash Zephyr samples to 96b-nitrogen boards.
To flash the example you built with command e.g.
.. code-block:: console
96b-nitrogen bitbake zephyr-philosophers
Call similar command with explicit flash usb command:
.. code-block:: console
96b-nitrogen bitbake zephyr-philosophers -c flash_usb
Building an Application to 96Boards Nitrogen
********************************************
OpenHarmony can be hosted on top of variety of kernels. Currently supported kernels (a.k.a. OHOS flavours) are Linux, Zephyr and FreeRTOS (experimental).
To build OHOS flavour issue following commands:
.. code-block:: console
$ TEMPLATECONF=../sources/meta-ohos/flavours/<lower_case_flavour> . ./sources/poky/oe-init-build-env build-<flavour>-<target_machine>
$ bitbake <image-name>
MACHINE variable can be set up in conf/local.conf file under build directory or via command line, e.g.:
.. code-block:: console
$ MACHINE=<target_machine> bitbake <image-name>
OHOS Zephyr flavour is based on zephyr distribution and supports following images/machines:
* Supported images:
* zephyr-philosophers
* Supported machines:
* qemu-cortex-m3
* qemu-x86 (default)
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'
Supported Boards
################
Harmony OS supports the following boards:
* 96Boards Avenger96
* 96Boards Nitrogen
For more information on supported boards and instructions to use them, see https://git.ostc-eu.org/OSTC/OHOS/docs/supported-boards.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment