sof/zephyr
Kai Vehmanen c3d1228fb0 probe: add backend for logging via probes
Implement a Zephyr logging backend which routes the logs via SOF
probes interface.

Tested with Linux SOF driver, crecord and sof/tools/probes for decoding.

The patch modifies the probes IPC3 interface, adding a new probe purpose
field (PROBE_PURPOSE_LOGGING, 0x3) to specify probe extraction for
logging. A field for system trace (as is also reserved (PROBE_PURPOSE_TRACING).

Example usage in Linux:

 term1# crecord -c3 -d0 -b8192 -f4 -FS32_LE -R48000 -C4 /tmp/extract.dat
 term2# echo 0,3,0 > /sys/kernel/debug/sof/probe_points
 term1# <terminate crecord>
 term1# sof-probes -p /tmp/extract.dat
 term1# cat buffer_0.bin

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-16 15:36:42 +01:00
..
include/sof zephyr: update for recent Zephyr include path changes 2022-08-03 20:59:53 +01:00
CMakeLists.txt probe: add backend for logging via probes 2022-08-16 15:36:42 +01:00
Kconfig dma: add Zephyr native DMA support to host & dai 2022-05-31 15:28:27 +01:00
README zephyr: replace obsolete README section with link to sof-docs 2022-02-07 10:43:28 +00:00
docker-build.sh docker-build.sh: don't switch versions when already initialized 2022-08-04 09:46:22 +01:00
edf_schedule.c zephyr: use zephyr prefix for includes 2022-07-18 14:22:01 +01:00
module.yml zephyr: module: point to where the app is 2022-07-18 14:22:01 +01:00
schedule.c zephyr: schedule: enable multi-core scheduling 2021-05-05 11:03:35 +01:00
wrapper.c timer: Introduce sof_cycle_get_64 2022-08-01 11:09:39 +01:00

README

SOF with Zephyr RTOS
====================

SOF currently uses the Cadence Xtos/HAL and it's own kernel functions as
its RTOS. SOF is moving to use Zephyr as it's RTOS in parallel to current
releases using xtos.

The initial "alpha" of SOF on Zephyr will use the Zephyr RTOS for boot, IRQs,
scheduling and memory allocation. Subsequent release will use more Zephyr
functionality as code is moved from SOF to Zephyr (i.e. EDF scheduler updates
copied from SOF to Zephyr).

Building SOF on Zephyr
======================

Section promoted to
https://thesofproject.github.io/latest/getting_started/build-guide/build-with-zephyr.html

Testing on Qemu
===============

Get the SOF qemu sof-v4.2 branch here.

git@github.com:thesofproject/qemu.git

Configure as

./configure' '--prefix=.' '--target-list=xtensa-softmmu,x86_64-softmmu' \
             '--enable-gtk' '--enable-sdl' '--enable-spice' \
             '--audio-drv-list=alsa' '--enable-libusb' \
             '--enable-usb-redir' '--enable-coroutine-pool' \
             '--disable-opengl' '--enable-fdt'

 Then run make.

FW can be tested as follows using the qemu helper script.

 ./xtensa-host.sh apl \
     -r ../../sof/sof/build_apl_gcc/src/arch/xtensa/rom-apl.bin \
     -k ../../zephyrproject/zephyr/build/zephyr/zephyr.ri

Where -r and -k are used to specify the ROM and kernel files.

The ROMS can be built from the SOF repo by running

./scripts/xtensa-build-all.sh  -r -a

Using console
-------------

Using logging and simulator backend with processing printk (LOG_PRINTK)
can bring console in qemu.

 - Enable xtensa simulator logging backend (LOG_BACKEND_XTENSA_SIM).
 - Enable printk processing(LOG_PRINTK)
 - Add "-semihosting" to qemu command line. Make sure it goes through scripts to real qemu.