Zephyr - MarekBykowski/readme GitHub Wiki

Zephyr for Cortex-{A,M}

Litarature:

Install required dependencies

sudo apt install --no-install-recommends git cmake ninja-build gperf \
  ccache dfu-util device-tree-compiler wget python3-dev python3-venv python3-tk \
  xz-utils file make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1

Verify

cmake --version
python3 --version
dtc --version

Upgrade pip

Old pips are slower at dependency resolution. Make sure you are using pip >= 23.x

pip install --upgrade pip

Install west

pip install west

Get the source code

west init ~/zephyrproject
cd ~/zephyrproject
west update

What it does under-the-hood is described here https://docs.zephyrproject.org/latest/develop/west/basics.html#west-init-and-west-update and here https://docs.zephyrproject.org/latest/develop/west/basics.html#

Export a Zephyr CMake package

west zephyr-export

Install Python dependencies using west packages.

west -v packages pip --install
# or may be better but does't work :)
# west packages pip --install --pip-args="-vv"

Install the Zephyr toolchain using the west sdk install

cd ~/zephyrproject/zephyr
west sdk install

You can specify the SDK installation destination and which architecture of toolchains to install. See command below for help:

west sdk install --help

Run west sdk to see what and where got installed. Also run with help to see other options.

Run the blinky app

See the boards supported

west boards
cd ~/zephyrproject/zephyr
west build -p always -b <your-board-name> samples/basic/blinky

eg.

cd ~/zephyrproject/zephyr
west build -p always -b qemu_cortex_a53 samples/basic/blinky

The blinky app with qemu_cortex_a53 didn't work with me so I run instead the Helo World from intel arch

west build -p always -b qemu_cortex_a53 samples/hello_world
west build -t run

.config

Get the .config (Linux like)

cd build
west build -t menuconfig

Linker script

include/zephyr/arch/arm64/scripts/linker.ld