Skip to content
Snippets Groups Projects
Commit 7043cab4 authored by Pooja Halappanavar's avatar Pooja Halappanavar
Browse files

Update avenger-96-board.rst

parent 0a712dab
No related branches found
No related tags found
No related merge requests found
......@@ -76,3 +76,86 @@ Additional information
+-------------+--------------------------------------------+
For more details on Avenger 96 board, refer https://www.96boards.org/product/avenger96/.
Bulding Zephyr onto Avenger96 board
*************************************
Creating uSD card image for the Avenger96 board
===============================================
Steps for building a BSP for ST's development boards is referred here: `<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:
.. code-block:: console
- 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
$ 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.
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 flashlayout_av96-weston/trusted/
FlashLayout_sdcard_stm32mp157a-av96-trusted.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.
Debugging
*********
You can debug an application using OpenOCD and GDB. The Solution proposed below is based on the Linux STM32MP1 SDK OpenOCD and is available only for a Linux environment. The firmware must first be loaded by the Cortex®-A7. Developer then attaches the debugger to the running Zephyr using OpenOCD.
Prerequisite
============
Install `stm32mp1 developer package <https://wiki.st.com/stm32mpu/index.php/STM32MP1_Developer_Package#Installing_the_SDK>`_.
1. Start OpenOCD in a dedicated terminal:
* Start up the sdk environment:
.. code-block:: console
Source <SDK installation directory>/environment-setup-cortexa7hf-neon-vfpv4-openstlinux_weston-linux-gnueabi
* Start OpenOCD:
.. code-block:: console
${OECORE_NATIVE_SYSROOT}/usr/bin/openocd -s ${OECORE_NATIVE_SYSROOT}/usr/share/openocd/scripts -f board/ stm32mp15x_ev1_jlink_jtag.cfg
2. Run gdb in Zephyr environment:
.. code-block:: console
# On Linux
cd $ZEPHYR_BASE/samples/hello_world
mkdir -p build && cd build
# Use cmake to configure a Ninja-based build syste
cmake -GNinja -DBOARD=96b_avenger96 ..
# Now run ninja on the generated build system:
ninja debug
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