Skip to content

Firmware Compilation, Flashing & Factory App

This guide details the firmware compilation process, binary image artifact generation, physical device programming, and production factory provisioning.


1. Building Firmware from Source

Terminal window
# From the repository root (planovi-converter)
mkdir build
cd build
# Generate build configuration for RP2350 with Pico 2 W board profile
cmake -DPICO_BOARD=pico2_w -DCMAKE_BUILD_TYPE=Release ..
# Compile all targets
ninja # or make -j$(nproc)

Generated Artifacts

Upon successful compilation, the build/ directory contains:

  • aslandi_edge_converter.uf2: Bootloader-loadable firmware image.
  • aslandi_edge_converter.elf: Debug executable with DWARF symbols for GDB / OpenOCD.
  • aslandi_edge_converter.bin: Raw binary used for cryptographic signing.
  • bootloader.uf2: Primary bootloader for flash offset 0x000000.

2. Firmware Signing & Delivery Package

Before flashing onto production units, binaries must be signed with the release ECDSA P-256 private key:

Terminal window
# Execute signing tool
python tools/sign_firmware.py \
--input build/aslandi_edge_converter.bin \
--key /secure/keys/planovi_release_p256.pem \
--version 1.0.0 \
--output build/aslandi_signed_v1.0.0.pkg

3. Physical USB Flashing (BOOTSEL Mode)

In release v1, firmware is updated exclusively via the physical USB interface:

flowchart TD
    HoldButton["1. Hold down BOOTSEL button on Pico 2 W"] --> PlugUSB["2. Connect USB cable to workstation"]
    PlugUSB --> ReleaseButton["3. Release BOOTSEL button"]
    ReleaseButton --> MountDrive["4. Mass storage drive 'RP2350' mounts on PC"]
    MountDrive --> CopyUF2["5. Drag and drop 'aslandi_edge_converter.uf2' onto drive"]
    CopyUF2 --> AutoReboot["6. Pico 2 W automatically unmounts and reboots"]
    AutoReboot --> LEDCheck{"Status LED turns solid GREEN?"}
    LEDCheck -->|Yes| Success["Firmware running successfully!"]
    LEDCheck -->|No| Diag["Consult Troubleshooting Runbook"]

4. Windows Factory Provisioning App

For mass manufacturing, the repository includes a dedicated Windows tool (admin/ Flutter desktop application or tools/factory_provision.py):

  1. OTP Burning: Injects the unique device UUID, AES-256 storage key, and Root CA public key into RP2350 OTP memory banks.
  2. Certificate Provisioning: Injects the mTLS X.509 client certificate and private key.
  3. Automated Verification: Automatically runs RS-485 loopback tests, reads RTC clock registers, formats LittleFS, and prints the unique physical QR code label.