Skip to content

Building and Flashing

Roman Kuraev edited this page Jul 10, 2026 · 2 revisions

Building and Flashing

Prerequisites

  • A CMSIS-DAP debug probe connected to the EMW3165 SWD test points
  • The WICED SDK fork checked out beside this repository
  • probe-rs for firmware flashing and target reset
  • OpenOCD 0.12 or newer for direct external SPI-flash provisioning only
  • Node.js 18 or newer and npm for the web UI
  • jq for the live-device smoke test

The WICED SDK includes its own ARM GCC toolchain under tools/ARM_GNU/bin/OSX/, so the normal firmware build and flash workflow does not require another ARM toolchain. The F103 debug helpers and optional legacy console do require arm-none-eabi tools on PATH.

On macOS, the non-SDK tools can be installed with:

brew install probe-rs openocd node jq

Checkout layout

The default layout is:

awair/
  rewair/
  third_party/wiced-emw3165/

Scripts that use the SDK default to ../third_party/wiced-emw3165. Override that location when necessary:

SDK_DIR=/path/to/wiced-emw3165 scripts/build_local_bridge.zsh

Build firmware

From the Rewair repository root:

scripts/build_local_bridge.zsh

The script installs the locked web dependencies on first use, builds and packs the RWFS web UI, syncs the application and custom platform into the external SDK, and builds this WICED target:

rewair.local_bridge-AWAIR-FreeRTOS-LwIP-SDIO

Generated SDK output, local lab artifacts, webui/node_modules, webui/dist, and generated *.rwfs files are not source artifacts.

Flash over SWD

Before running any flash command, complete Step 0 in Getting Started and store your stock-firmware dump safely. Rewair does not distribute the stock image.

scripts/flash_local_bridge_probe_rs.zsh

The default operation flashes the WICED bootloader and application while preserving DCT, including saved Wi-Fi credentials. To intentionally wipe and reseed DCT:

FLASH_DCT=1 scripts/flash_local_bridge_probe_rs.zsh

Firmware versions and packages

wiced/apps/rewair/local_bridge/rewair_version.h is the version source of truth. Local builds append -dev. Release CI requires a matching tag, so version 0.7.0 must be tagged v0.7.0.

To assemble a release bundle locally after building firmware:

scripts/package_release.zsh

Packaging verifies that the expected version is present in the application binary before writing manifest.json.

Direct external-flash provisioning is documented in SPI Flash and Recovery.

Clone this wiki locally