Zephyr uses device trees. It is not straightforward to transition from sample LED blinky app that Zephyr provides to manipulating GPIO pins. This repository contains the plumbing needed for GPIO and ADC, in addition to sample usage.
See the overlay file app/boards
for pin configuration.
Clone this repository. Follow the Getting Started guide and install the following:
- Dependencies
- west tool
- Zephyr SDK
Do not install Zephyr sources according to the Getting Started guide but follow the procedure below.
# Create Zephyr workspace
cd zephyr-xiao-ble
west init -l app/
# Fetch modules
west update
# Export Zephyr so cmake can find it
west zephyr-export
# Install Zephyr python dependencies
pip3 install -r zephyr/scripts/requirements-base.txt
cd zephyr-xiao-ble
west build -b xiao_ble app
Double press the reset button located on the top left side of the board. The
UF2 bootloader presents itself as mountable disk. Copy the firmware file named
zephyr.uf2
from the build/zephyr
directory to the newly mounted disk.