Zephyr

This is an initial port of CircuitPython onto Zephyr. We intend on migrating all existing boards onto Zephyr. To start, we’ll only support new boards. Existing boards will be switched as the Zephyr port reaches parity with the existing implementation.

Getting Started

First, install Zephyr tools (see Zephyr’s Getting Started Guide). (These are fish commands because that’s what Scott uses.)

pip install west
west init -l zephyr-config
west update
west zephyr-export
pip install -r lib/zephyr/scripts/requirements.txt
west sdk install

Now to build from the top level:

make BOARD=nordic_nrf7002dk

This uses Zephyr’s cmake to generate Makefiles that then delegate to tools/cpbuild/build_circuitpython.py to build the CircuitPython bits in parallel.

Testing other boards

Any Zephyr board can be used with CircuitPython. To test a different board, use west directly to build the board. The build will do its best to support as much as possible. By default the Zephyr console will be used for output. USB support is limited by initialization support in supervisor/usb.c. Only flash regions not used by Zephyr are used for CIRCUITPY. A manual circuitpython partition can be specified instead.

For example, to test the nrf52840dk board:

west build -b nrf52840dk/nrf52840

This is already supported in ports/nordic as pca10056.