-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add documentation for building and running SOF under Zephyr #297
Conversation
:depth: 3 | ||
|
||
This guide describes the process of building and running |SOF| as a Zephyr | ||
application. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add a note here that it needs v1.6 onwards and is limited to some SOF platforms atm like CAVS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lgirdwood Sure, can add, but in fact west will make sure to check out a suitable SOF version, and if you choose to override that, well, you better know what you're doing :-)
.. 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got FATAL ERROR: rimage not found; either install it or provide --tool-path
here, seem west doesn't help to build the rimage, I think you may also add some documentation here to describe how rimage is built.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rimage should be checked out by west ? @lyakh are we missing some init to put rimage in zephyr $PATH.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, west build -p -d build-apl -b up_squared_adsp zephyr/samples/audio/sof/ -- -DCMAKE_C_FLAGS=-Izephyr/lib/libc/minimal/include/
this line doesn't help to build rimage, I think. Or I do have zephyr PATH issue, but there should be some docs to describe rimage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aiChaoSONG there is a tool called west
that should do this for you and check out rimage and install in your zephyr $PATH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lgirdwood FWIW west isn't even fetching rimage for me, let alone building and installing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
west doesn't support git submodules (which is quite understandable) so this guide is missing at least one git submodule --init update
command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Support for submodules has just been merged in west. To try it:
pip3 uninstall west
git clone https://github.com/zephyrproject-rtos/west && \
(cd west && pip3 install --editable .)
Then add submodules: true
in the SOF section, see incoming documentation at https://github.com/zephyrproject-rtos/zephyr/pull/31241/files"git submodules in projects"
@lyakh ping are you able to fixup today for merge ? |
@lgirdwood sure, could do, I wasn't updating this because the actual trees aren't in the state that we want to have them in. We want to only need to issue |
In other words this should for now be in a wiki. |
@lgirdwood updated. This is still a temporary version with workarounds for the current intermediate status. Please, have a look whether we want it in this form for now or we want to wait until it's all upstream and then basically just say: "follow zephyr guide with 'xxx-adsp-yyy' as a board, then copy the firmware under /lib/firmware/..." and that's it? |
cd rimage/build | ||
cmake .. | ||
make | ||
sudo make install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I never had to install rimage
, this is weird.
Maybe also a short warning that Zephyr has its own, duplicate copy of rimage that is not used right now? (it hasn't sorry for the noise) thesofproject/sof#3517
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I never had to install
rimage
, this is weird.
@marc-hb I think SOF uses rimage directly from its build directory, whereas Zephyr calls rimage from its signing code by searching standard executable paths or using a command-line parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just saw that west sign
has a -p, --tool-path
option. Can you try it and mention it as an alternative to sudo
?
AFAIK neither Zephyr or SOF ever required root access to build anything (as they should) so this single sudo
line would tear all that down. Security concerns aside, root access is a blocker for people using (powerful) shared systems - and you DO need powerful systems if you want to perform any kind of serious sanitycheck
testing.
Repeatedly installing is also repetitive and error prone when testing full-of-crashes-rimage itself.
|
||
If you need a different SOF version than the one automatically checked out | ||
by ``west``, you can change to ``modules/audio/sof`` and use ``git`` to | ||
select your preferred version. You need at least version 1.6 to use it with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add: "make sure you branch or tag your code in git otherwise west update
may lose it. See the west user guide."
@lyakh ping - can we merge this for v1.7 |
@lyakh ping, can you fix any technical comments. Dont worry too much about grammar as @deb-intel can fix-up. |
SOF can be built as a Zephyr application. This document describes the process. Signed-off-by: Guennadi Liakhovetski <[email protected]>
The updated version needs thesofproject/sof#3764 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deb-intel fyi - technical side good.
@lyakh looks like the pR is failing CI
Can you fix. |
SOF can be built as a Zephyr application. This document describes the process.