zbuild.sh 847 B

12345678910111213141516171819
  1. #!/bin/bash
  2. # Convenience build wrapper for the OpenPuck Zephyr port.
  3. # Sets up the workspace env (venv, ZEPHYR_BASE, SDK) and runs west build.
  4. # Usage: ./zbuild.sh [extra west build args] (run from anywhere)
  5. set -euo pipefail
  6. export PIP_USER=false
  7. export ZEPHYR_BASE="$HOME/zephyrproject/zephyr"
  8. export ZEPHYR_SDK_INSTALL_DIR="$HOME/zephyr-sdk-1.0.1"
  9. # shellcheck disable=SC1091
  10. source "$HOME/openpuck-zephyr-venv/bin/activate"
  11. APP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  12. # The uf2 variant carries the Adafruit UF2 bootloader partition layout (app at
  13. # 0x26000, a 32 kB storage partition for littlefs, UF2 output) + CDC-ACM console
  14. # + LED0 on P1.15 — matching the real puck hardware and the user's DFU workflow.
  15. BOARD="${BOARD:-adafruit_feather_nrf52840/nrf52840/uf2}"
  16. cd "$APP_DIR"
  17. exec west build -b "$BOARD" "$APP_DIR" "$@"