Skip to content

Instantly share code, notes, and snippets.

@GregAC
Last active May 27, 2024 11:25
Show Gist options
  • Save GregAC/414ef0b06d1bb579a28f8ca03e163042 to your computer and use it in GitHub Desktop.
Save GregAC/414ef0b06d1bb579a28f8ca03e163042 to your computer and use it in GitHub Desktop.

CHERIoT Hackathon Preparation

In advance of the Hackathon it's essential you prepare your environment so any issues can be sorted in advance of the day. If you have any issues in following this guide please contact Greg Chadwick on gac@lowrisc.org.

The Sonata software build environment can be setup under Windows, OSX and Linux. We also have a web-based option.

To run software built with this environment you'll need the latest Sonata firmware and FPGA bitstream. These will be ready for the Hackathon but aren't yet available so for now you'll just confirm you can build some example software.

We use a tool called Nix to manage the build environment on all platforms. You will install it but don't need to know anything about it to follow these instructions.

If you want to use the web-based environment start at 'Use a web-based environment'. For local setups only Windows requires specific instructions, Nix handles everything you need on Linux and OSX. So if you're not using Windows jump straight to 'Installing Nix'.

Windows Specific Setup

To obtain a Linux environment on Windows, you can choose to start a virtual machine or use Windows Subsystem for Linux (WSL).

Microsoft provides a detailed guide on how to install WSL: https://learn.microsoft.com/en-us/windows/wsl/install. For latest systems this would just be a single command:

wsl --install

You might need to enable virtualisation in the BIOS if it's not enabled by default.

If you are running the command without admin privileges, user account control (UAC) popups will appear a few times asking to allow changes to be made to the device. Click "yes" to approve.

After the command's completion, it should say that Ubuntu is installed. Reboot your machine to make these changes effective.

After rebooting, Ubuntu should be available in your start menu. Click it to start. For the first time, it would prompt you to select a Unix username and password. Follow the Linux (Ubuntu) steps for the rest of this guide.

ℹ️ If you have installed your WSL a long time ago, systemd may not have been enabled by default. It is recommended to use enable systemd. See https://learn.microsoft.com/en-us/windows/wsl/systemd.

Installing Nix

The Nix package manager is used to create reproducible builds and consistent development environments. We recommend installing Nix with the Determinate Systems' nix-installer:

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install

For more indepth instructions, follow the guide on the zero to nix site.

If you've downloaded nix through another method, make sure the experimental features "flakes" and "nix-command" are enabled.

To use Nix from the terminal you'll need to open up a new terminal for it to be added to your path.

Setup Cache

To make use of the lowRISC cache so you don't have to rebuild binaries yourself, you'll need to make sure you're a trusted user. To do this, you will need to add your user to the trusted users in /etc/nix/nix.conf, e.g. trusted-users = root username. You can also add all users from a certain group instead of a single user by using an @ symbol before the group name, e.g. @sudo or @wheel.

ℹ️ For Ubuntu users (including WSL users), this means adding this line to the /etc/nix/nix.conf:

trusted-users = root @sudo

You'll need to restart the nix-daemon afterwards for the change to be picked up.

sudo systemctl restart nix-daemon

ℹ️ For OSX users, this means adding this line to the /etc/nix/nix.conf:

trusted-users = root @admin

You then need to restart your Mac for the changes to take effect.

Enter the CHERIoT development environment

Running the following will put you in a shell environment with all the applications needed to build the CHERIoT RTOS.

# Enter the shell with
nix develop github:lowRISC/sonata-software
# Exit the shell with
exit

These applications are layered on top of your usual environment. You can see what was added with echo $PATH.

do you want to allow configuration setting 'extra-substituters' to be set to 'https://nix-cache.lowrisc.org/public/' (y/N)? y
do you want to permanently mark this value as trusted (y/N)? y
do you want to allow configuration setting 'extra-trusted-public-keys' to be set to 'nix-cache.lowrisc.org-public-1:O6JLD0yXzaJDPiQW1meVu32JIDViuaPtGDfjlOopU7o=' (y/N)? y
do you want to permanently mark this value as trusted (y/N)? y
warning: ignoring untrusted substituter 'https://nix-cache.lowrisc.org/public/', you are not a trusted user.

If you see the warning that substituter is ignored, cancel the process with Ctrl+C and check to see that trusted-users is setup properly. Nix can and will build everything from source if it can't find a cached version, so letting it continue will cause LLVM-Cheriot to be built from scratch on your machine.

Use a web-based environment

A Github Codespaces web-based development environment is available. As codespaces provides a limited amount of free compute and storage (60 hours per month) a local environment is likely preferred for serious development however the codespace offers an excellent way to test out Sonata development with minimal friction.

To use it you will need a (free) github account, you can sign-up at https://github.com/signup if you need one.

To create the codespace go to the sonata-software repository https://github.com/lowrisc/sonata-software, click on '<> Code' and choose the 'Codespaces' tab. You should see a green 'Create codespace on main' button. Click this and a codespace will be setup.

It'll take a few minutes to create, and you will eventually see a vscode UI. In the bottom panel (which has the terminal) you'll see a + icon in the top right of the panel. Click this and you should see a new terminal open that gives the prompt 'Sonata /workspaces/sonata-software>'. This is the same shell environment you get with the local setup described above.

You can now follow the first build instructions below but you don't need to checkout the repository (the github codespace has done that for you).

Once you have a successful build we recommend either deleting or stopping the codespace to avoid using up any more compute, you can do this from https://github.com/codespaces. Click the three horizontal dots next to the codespace name and choose either 'Delete' or 'Stop Codespace'. A stopped codespace can be started again where if you delete you will need to recreate it for the hackathon.

Your first build

Checkout our template repository (not required under github codespaces) and cd into it:

git clone --recurse-submodule \
    https://github.com/lowRISC/sonata-software.git
cd sonata-software

Configure and run build:

xmake config --board=sonata
xmake build

After running this you should see the build run to completion and report success, the critical lines indicating a successful build are:

Converted to uf2, output size: 74752, start address: 0x101000
Wrote 74752 bytes to build/cheriot/cheriot/release/sonata_simple_demo.uf2
[100%]: build ok, spent 6.827s

(Note output size may differ)

If you have got a successful build, congratulations! Your environment is ready to go for Sonata software development. Get in touch with Greg Chadwick on gac@lowrisc.org if you have any issues.

For reference the full output (from a build run on a Linux machine) looks like:

(nix:sonata-sw-env) greg@greg-thinkpad-x1:~/work/sonata-software$ xmake config --board=sonata
checking for platform ... cheriot
checking for architecture ... cheriot
generating /home/greg/work/sonata-software/cheriot-rtos/sdk/firmware.ldscript.in ... ok
(nix:sonata-sw-env) greg@greg-thinkpad-x1:~/work/sonata-software$ xmake build
[ 23%]: compiling.release cheriot-rtos/sdk/core/switcher/entry.S
[ 23%]: cache compiling.release compartments/led_walk.cc
[ 23%]: cache compiling.release cheriot-rtos/sdk/lib/crt/cz.c
[ 23%]: compiling.release cheriot-rtos/sdk/core/loader/boot.S
[ 23%]: cache compiling.release cheriot-rtos/sdk/core/scheduler/main.cc
[ 23%]: cache compiling.release cheriot-rtos/sdk/lib/crt/arith64.c
[ 23%]: cache compiling.release cheriot-rtos/sdk/core/loader/boot.cc
[ 23%]: cache compiling.release cheriot-rtos/sdk/lib/compartment_helpers/claim_fast.cc
[ 23%]: cache compiling.release cheriot-rtos/sdk/lib/locks/locks.cc
[ 23%]: cache compiling.release cheriot-rtos/sdk/core/allocator/main.cc
[ 23%]: cache compiling.release cheriot-rtos/sdk/lib/atomic/atomic4.cc
[ 23%]: cache compiling.release cheriot-rtos/sdk/lib/locks/semaphore.cc
[ 23%]: cache compiling.release cheriot-rtos/sdk/lib/debug/debug.cc
[ 23%]: cache compiling.release cheriot-rtos/sdk/lib/compartment_helpers/check_pointer.cc
[ 26%]: cache compiling.release cheriot-rtos/sdk/lib/atomic/atomic1.cc
[ 26%]: cache compiling.release cheriot-rtos/sdk/lib/freestanding/memcmp.c
[ 28%]: cache compiling.release cheriot-rtos/sdk/lib/freestanding/memcpy.c
[ 29%]: cache compiling.release cheriot-rtos/sdk/lib/freestanding/memset.c
[ 31%]: cache compiling.release compartments/echo.cc
[ 32%]: cache compiling.release cheriot-rtos/sdk/core/software_revoker/revoker.cc
[ 34%]: compiling.release cheriot-rtos/sdk/core/token_library/token_unseal.S
[ 56%]: linking library debug.library
[ 58%]: linking privileged library cheriot.token_library.library
[ 58%]: linking library atomic4.library
[ 58%]: linking library freestanding.library
[ 58%]: linking library crt.library
[ 58%]: linking privileged compartment cheriot.software_revoker.compartment
[ 58%]: linking library atomic1.library
[ 58%]: linking library compartment_helpers.library
[ 82%]: linking library locks.library
[ 82%]: linking compartment led_walk.compartment
[ 82%]: linking compartment echo.compartment
[ 91%]: linking privileged compartment sonata_simple_demo.scheduler.compartment
[ 91%]: linking privileged compartment cheriot.allocator.compartment
[ 97%]: linking firmware build/cheriot/cheriot/release/sonata_simple_demo
[ 97%]: Creating firmware report build/cheriot/cheriot/release/sonata_simple_demo.json
[ 97%]: Creating firmware dump build/cheriot/cheriot/release/sonata_simple_demo.dump
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/core/scheduler/main.cc
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/cheri.hh
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/debug.hh
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/core/scheduler/thread.h
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/core/scheduler/plic.h
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/boards/../include/platform/generic-riscv/platform-plic.hh
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/boards/../include/platform/generic-riscv/platform-timer.hh
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/core/scheduler/timer.h
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/core/scheduler/common.h
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/timeout.h
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/libc++/__algorithm/comp.h
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/core/scheduler/multiwait.h
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/compartment.h
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/utils.hh
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/libc++/initializer_list
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/riscvreg.h
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/locks.hh
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/core/allocator/main.cc
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/token.h
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/core/allocator/alloc.h
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/core/allocator/revoker.h
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/stdlib.h
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/libc++/variant
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/c++-config/atomic
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/core/allocator/token.h
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/libc++/__utility/pair.h
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/ds/linked_list.h
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/ds/pointer.h
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/ds/ring_buffer.h
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/ds/bits.h
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/core/software_revoker/revoker.cc
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/lib/atomic/atomic1.cc
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/lib/atomic/atomic4.cc
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/lib/compartment_helpers/claim_fast.cc
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/lib/compartment_helpers/check_pointer.cc
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/lib/locks/locks.cc
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/futex.h
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/lib/locks/semaphore.cc
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/lib/crt/cz.c
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/lib/crt/arith64.c
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/lib/debug/debug.cc
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/libc++/array
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/libc++/string_view
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/boards/../include/platform/sunburst/platform-uart.hh
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/lib/freestanding/memcmp.c
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/lib/freestanding/memcpy.c
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/lib/freestanding/memset.c
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/compartments/echo.cc
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/compartments/led_walk.cc
/nix/store/a1bkgi3cd1mlis6jnlgr52s5xpg41hmf-llvm-cheriot-13.0.0/bin/llvm-objdump: warning: 'build/cheriot/cheriot/release/sonata_simple_demo': failed to find source _ZN5CHERI13PermissionSet14permission_bitENS_10PermissionE/cheriot-rtos/sdk/include/thread.h
Converted to uf2, output size: 74752, start address: 0x101000
Wrote 74752 bytes to build/cheriot/cheriot/release/sonata_simple_demo.uf2
[100%]: build ok, spent 6.827s
warning: ./cheriot-rtos/sdk/xmake.lua:116: unknown language value 'c2x', it may be 'c89'
warning: add -v for getting more warnings ..

Debug logs

If you want debug logs from the RTOS, configure your build with the following additional options.

xmake config --board=sonata \
    --debug-scheduler=y --debug-locks=y \
    --debug-cxxrt=y --debug-loader=y \
    --debug-token_library=y --debug-allocator=y

Reconfiguring doesn't always work reliably, so often you will want to delete the build and .xmake directories when changing the configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment