This example shows how to configure a Zephyr project with OpenBar.
Tip
The project is based on STM32 devkits but can be adapted to any other board supported by Zephyr (with a few adaptations: toolchain, hal...).
If you want to flash the firmware, you will need to install some new udev rules on your host PC:
UDEV_RULES_URL=https://github.com/zephyrproject-rtos/openocd/raw/HEAD/contrib/60-openocd.rules
# Download and install the new rules
wget -qO- ${UDEV_RULES_URL} | sudo tee /etc/udev/rules.d/60-openocd.rules
# Reload the udev rules
sudo udevadm control --reload
Note
You only need to run these commands once.
# Clone the repository (with submodules)
git clone --recurse-submodules https://github.com/openbar/example-zephyr-stm32.git
# Move to the freshly cloned directory
cd example-zephyr-stm32
# Configure the build (use 'make help' to see the other configurations available)
make blinky_stm32f4_disco_defconfig
# Configure the manifest project repositories (else west commands won't work)
# It only needs to be done once after the git clone!
make update
# Build the firmware
make
# Optionally, flash the firmware
make flash
-
This project was created with the wizard using:
- Project type:
standard
- Git repositories management:
submodule
- Configuration directory:
configs
- OpenBar directory:
third-party/openbar
- Default configuration file:
example_defconfig
- Project type:
-
Next, a custom
Dockerfile
was created to include thewest
command and the Zephyr SDK. -
A manifest was created in
configs/west.yml
. -
In a
make shell
, thewest init -l configs
andwest update
commands were executed to initialize and fetch the repositories. They will be added manually as submodules (.gitmodules
). -
Finally,
defconfig
s files were created.
This project is released under the Unlicense.