-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation for building and running SOF under Zephyr
SOF can be built as a Zephyr application. This document describes the process. Signed-off-by: Guennadi Liakhovetski <[email protected]>
- Loading branch information
Showing
2 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters