For those who are interested in learning about Zephyr OS (Partition Manager [not shown but is also an input to the CMake tool]), Devicetree, KConfig, CMake, Ninja, GCC) (Configuration Phase + Building Phase)
there is an economical alternative available from DigiKey such as the well known Raspberry Pico 2 or Raspberry Pico 2 W, which can be used instead of other platforms like the well known ESP32-WROOM-32E-N4 Espressif Systems Xtensa dual-core 32-bit LX6 microprocessor.
Here are the steps to install in Linux to develop Zephyr OS in the Raspberry Pico 2. First create a python virtual environment,
$ python3 -m venv venv
$ source venv/bin/activate
then install west,
$ (venv) pip3 install west
then initialize Zephyr with west as follows,
$ (venv) west init zephyrproject
$ (venv) cd zephyrproject/
$ (venv) west update
also need to install the following Infineon hardware abstraction layer software item,
$ (venv) west blobs fetch hal_infineon
then perform the classical zephyr-export,
$ (venv) west zephyr-export
$ (venv) west packages pip --install
$ (venv) cd zephyr/
proceed to install the Zephyr OS Software Development Kit (SDK),
$ (venv) west sdk install
at this point the Zephyr OS development installation is complete. In order to build the classical LED blink application main.c located here,
zephyrproject/zephyr/samples/basic/blinky/src
in Zephyr OS application in the Raspberry Pico 2 use west to build it as follows (assuming build directory is present),
$ (venv) cd build
$ (venv) west build -p always -b rpi_pico2/rp2350a/m33 -S cdc-acm-console ../samples/basic/blinky -DCONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=y
-- west build: making build dir /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/build/build pristine
-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/samples/basic/blinky
-- CMake version: 3.25.1
-- Found Python3: /home/digikey/Projects/Workspace/zephyr-picow/venv/bin/python3 (found suitable version "3.11.2", minimum required is "3.10") found components: Interpreter
-- Cache files will be written to: /home/digikey/.cache/zephyr
-- Zephyr version: 4.2.99 (/home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr)
-- Found west (found suitable version "1.5.0", minimum required is "0.14.0")
-- Board: rpi_pico2, qualifiers: rp2350a/m33
-- Snippet(s): cdc-acm-console
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Found host-tools: zephyr 0.17.4 (/home/digikey/zephyr-sdk-0.17.4)
-- Found toolchain: zephyr 0.17.4 (/home/digikey/zephyr-sdk-0.17.4)
-- Found Dtc: /home/digikey/zephyr-sdk-0.17.4/sysroots/aarch64-pokysdk-linux/usr/bin/dtc (found suitable version "1.7.0", minimum required is "1.4.6")
-- Found BOARD.dts: /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/boards/raspberrypi/rpi_pico2/rpi_pico2_rp2350a_m33.dts
-- Found devicetree overlay: /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/snippets/cdc-acm-console/cdc-acm-console.overlay
-- Generated zephyr.dts: /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/build/build/zephyr/zephyr.dts
-- Generated pickled edt: /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/build/build/zephyr/edt.pickle
-- Generated devicetree_generated.h: /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/build/build/zephyr/include/generated/zephyr/devicetree_generated.h
Parsing /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/Kconfig
Loaded configuration '/home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/boards/raspberrypi/rpi_pico2/rpi_pico2_rp2350a_m33_defconfig'
Merged configuration '/home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/samples/basic/blinky/prj.conf'
Merged configuration '/home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/snippets/cdc-acm-console/cdc-acm-console.conf'
Merged configuration '/home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/build/build/zephyr/misc/generated/extra_kconfig_options.conf'
Configuration saved to '/home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/build/build/zephyr/.config'
Kconfig header saved to '/home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/build/build/zephyr/include/generated/zephyr/autoconf.h'
-- Found GnuLd: /home/digikey/zephyr-sdk-0.17.4/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.38")
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/digikey/zephyr-sdk-0.17.4/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-- Using ccache: /usr/bin/ccache
-- Found gen_kobject_list: /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/scripts/build/gen_kobject_list.py
-- Configuring done
-- Generating done
-- Build files have been written to: /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/build/build
-- west build: building application
[1/168] Preparing syscall dependency handling
[3/168] Generating include/generated/zephyr/version.h
-- Zephyr version: 4.2.99 (/home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr), build: v4.2.0-5176-ge5838ffc2176
[168/168] Linking C executable zephyr/zephyr.elf
Memory region Used Size Region Size %age Used
FLASH: 42088 B 4 MB 1.00%
RAM: 14120 B 520 KB 2.65%
IDT_LIST: 0 GB 32 KB 0.00%
Generating files from /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/build/build/zephyr/zephyr.elf for board: rpi_pico2
Converted to uf2, output size: 84480, start address: 0x10000000
Wrote 84480 bytes to zephyr.uf2
At this point the build is complete, then press boot button in the Raspberry Pico 2 while reconnecting the USB cable, .
$ (venv) west flash --runner uf2
-- west flash: rebuilding
ninja: no work to do.
-- west flash: using runner uf2
-- runners.uf2: Copying UF2 file to '/media/digikey/RP2350'
other alternative is using picotool,
$ (venv) picotool load build/zephyr/zephyr.uf2
Family ID 'absolute' can be downloaded in absolute space:
00000000->02000000
Loading into Flash: [==============================] 100%
At this point disconnect the USB cable from the Raspberry Pico 2 once it is reconnected then the onboard LED should be blinking,
if minicom is used then the user can access the print output,
$ minicom -D /dev/ttyACM0
Welcome to minicom 2.8
OPTIONS: I18n
Port /dev/ttyACM0, 12:41:43
Press CTRL-A Z for help on special keys
LED state: ON
LED state: OFF
LED state: ON
LED state: OFF
LED state: ON
....
The main.c program can be modified such as the default delay for the LED blinking rate,
/* 1000 msec = 1 sec */
#define SLEEP_TIME_MS 1000
to another value to and repeat the build and flash process shown previously to see if it is working.
Another example is the classical Zephyr CPU synchronization example,
(venv) $ west build -p always -b rpi_pico2/rp2350a/m33 -S cdc-acm-console ../samples/synchronization/ -DCONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=y
-- west build: making build dir /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/build/build pristine
-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/samples/synchronization
-- CMake version: 3.25.1
-- Found Python3: /home/digikey/Projects/Workspace/zephyr-picow/venv/bin/python3 (found suitable version "3.11.2", minimum required is "3.10") found components: Interpreter
-- Cache files will be written to: /home/digikey/.cache/zephyr
-- Zephyr version: 4.2.99 (/home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr)
-- Found west (found suitable version "1.5.0", minimum required is "0.14.0")
-- Board: rpi_pico2, qualifiers: rp2350a/m33
-- Snippet(s): cdc-acm-console
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Found host-tools: zephyr 0.17.4 (/home/digikey/zephyr-sdk-0.17.4)
-- Found toolchain: zephyr 0.17.4 (/home/digikey/zephyr-sdk-0.17.4)
-- Found Dtc: /home/digikey/zephyr-sdk-0.17.4/sysroots/aarch64-pokysdk-linux/usr/bin/dtc (found suitable version "1.7.0", minimum required is "1.4.6")
-- Found BOARD.dts: /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/boards/raspberrypi/rpi_pico2/rpi_pico2_rp2350a_m33.dts
-- Found devicetree overlay: /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/snippets/cdc-acm-console/cdc-acm-console.overlay
-- Generated zephyr.dts: /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/build/build/zephyr/zephyr.dts
-- Generated pickled edt: /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/build/build/zephyr/edt.pickle
-- Generated devicetree_generated.h: /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/build/build/zephyr/include/generated/zephyr/devicetree_generated.h
Parsing /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/Kconfig
Loaded configuration '/home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/boards/raspberrypi/rpi_pico2/rpi_pico2_rp2350a_m33_defconfig'
Merged configuration '/home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/samples/synchronization/prj.conf'
Merged configuration '/home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/snippets/cdc-acm-console/cdc-acm-console.conf'
Merged configuration '/home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/build/build/zephyr/misc/generated/extra_kconfig_options.conf'
Configuration saved to '/home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/build/build/zephyr/.config'
Kconfig header saved to '/home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/build/build/zephyr/include/generated/zephyr/autoconf.h'
-- Found GnuLd: /home/digikey/zephyr-sdk-0.17.4/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.38")
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/digikey/zephyr-sdk-0.17.4/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-- Using ccache: /usr/bin/ccache
-- Found gen_kobject_list: /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/scripts/build/gen_kobject_list.py
-- Configuring done
-- Generating done
-- Build files have been written to: /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/build/build
-- west build: building application
[1/169] Preparing syscall dependency handling
[3/169] Generating include/generated/zephyr/version.h
-- Zephyr version: 4.2.99 (/home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr), build: v4.2.0-5176-ge5838ffc2176
[169/169] Linking C executable zephyr/zephyr.elf
Memory region Used Size Region Size %age Used
FLASH: 42832 B 4 MB 1.02%
RAM: 16712 B 520 KB 3.14%
IDT_LIST: 0 GB 32 KB 0.00%
Generating files from /home/digikey/Projects/Workspace/zephyr-picow/zephyrproject/zephyr/build/build/zephyr/zephyr.elf for board: rpi_pico2
Converted to uf2, output size: 86016, start address: 0x10000000
Wrote 86016 bytes to zephyr.uf2
$ west flash --runner uf2
-- west flash: rebuilding
ninja: no work to do.
-- west flash: using runner uf2
-- runners.uf2: Copying UF2 file to '/media/digikey/RP2350'
In the minicom window the output can be seen,
$ minicom -D /dev/ttyACM0
Welcome to minicom 2.8
OPTIONS: I18n
Port /dev/ttyACM0, 12:41:43
Press CTRL-A Z for help on special keys
Welcome to minicom 2.8
thread_a: Hello World from cpu 0 on rpi_pico2!
thread_b: Hello World from cpu 0 on rpi_pico2!
thread_a: Hello World from cpu 0 on rpi_pico2!
thread_b: Hello World from cpu 0 on rpi_pico2!
thread_a: Hello World from cpu 0 on rpi_pico2!
thread_b: Hello World from cpu 0 on rpi_pico2!
thread_a: Hello World from cpu 0 on rpi_pico2!
thread_b: Hello World from cpu 0 on rpi_pico2!
thread_a: Hello World from cpu 0 on rpi_pico2!
thread_b: Hello World from cpu 0 on rpi_pico2!
thread_a: Hello World from cpu 0 on rpi_pico2!
thread_b: Hello World from cpu 0 on rpi_pico2!
thread_a: Hello World from cpu 0 on rpi_pico2!
The synchronization demo has 2 threads that use semaphores and sleeping to take turns to print a message via USB at a controlled rate.
The Raspberry Pico 2 is a dual-core, dual-architecture capability of RP2350 allows users to choose between a pair of industry-standard Arm Cortex-M33 cores, and a pair of open- hardware Hazard3 RISC-V cores.
This is a good alternative to start learning about Zephyr OS (Devicetree, KConfig, CMake, Ninja, GCC) for those who can’t wait 2 more weeks for the release of the Arduino Uno which includes a Qualcomm® Dragonwing™ QRB2210 is a quad-core Arm® Cortex®-A53 running Debian Linux OS and also TMicroelectronics® STM32U585 is an Arm® Cortex®-M33 running Arduino Core on Zephyr OS.