Skip to content

Commit

Permalink
Add documentation for building and running SOF under Zephyr
Browse files Browse the repository at this point in the history
SOF can be built as a Zephyr application. This document describes
the process.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
  • Loading branch information
lyakh committed Oct 16, 2020
1 parent 91c815f commit 9f7a25c
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
69 changes: 69 additions & 0 deletions getting_started/build-guide/build-with-zephyr.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
.. _build-with-zephyr:

Build SOF with Zephyr
#####################

.. contents::
:local:
:depth: 3

This guide describes the process of building and running |SOF| as a Zephyr
application.

.. note::

The example uses ``$ZEPHYR_WORKSPACE`` as the working directory.

Preparation
***********

The easiest way to build Zephyr is by using its recommended toolchain. Follow
instructions in the
`Install a Toolchain <https://docs.zephyrproject.org/latest/getting_started/index.html#install-a-toolchain>`__
chapter for toolchain installation details.

Check out and build
*******************

Zephyr uses ``west`` as a source management and building system. Follow the
Zephyr
`Getting Started <https://docs.zephyrproject.org/latest/getting_started/index.html#>`__
guide for dependencies and for ``west`` installation.

Initialize a new ``west`` repository

.. code-block:: bash
mkdir $ZEPHYR_WORKSPACE
cd $ZEPHYR_WORKSPACE
west init
west update
.. note::

If you need to checkout a different Zephyr fork or branch you can do something like

.. code-block:: bash
west init --manifest-url https://github.com/thesofproject/zephyr --manifest-rev intel_adsp_soc_family
This checks out all the Zephyr sources, including |SOF|. After that a firmware
image can be built and signed:

.. code-block:: bash
west build -p -d build-apl -b up_squared_adsp zephyr/samples/audio/sof/ -- -DCMAKE_C_FLAGS=-Izephyr/lib/libc/minimal/include/
west sign -d build-apl -t rimage -- -k modules/audio/sof/keys/otc_private_key.pem
Running
*******

After the above a ready image is located at ``build-apl/zephyr/zephyr.ri``, as
usual it can be copied to the usual firmware location on the target systen, e.g.
if built natively

.. code-block:: bash
sudo cp build-apl/zephyr/zephyr.ri /lib/firmware/intel/sof/community/sof-cnl.ri
For firmware log extraction use zephyr/boards/xtensa/up_squared_adsp/tools/logtool.py
1 change: 1 addition & 0 deletions getting_started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ is always preffered.
build-guide/build-from-scratch
build-guide/build-with-docker
build-guide/build-3rd-party-toolchain
build-guide/build-with-zephyr

Setting up SOF on hardware
**************************
Expand Down

0 comments on commit 9f7a25c

Please sign in to comment.