Repository navigation
4. Flashing
The flashing procedure uses STM32CubeProgrammer via DFU (USB-C in download mode). The flashlayout.tsv file targets spi-nand0 (SPI-NAND via QSPI). The programmer is packaged in nix/stm32cubeprog.nix and is available in the development shell as STM32_Programmer_CLI.
The current flashlayout.tsv programs fsbl1, fsbl2, fip-active, fip-factory, and UBI. Both FIP partitions are written with the same image during flashing, which seeds the factory fallback copy used by the BL2 walk described in Boot Chain. After provisioning, firmware and root filesystem updates are delivered through RAUC rather than by reflashing. Signed secure boot is not yet enabled.
Set the BOOT pins before flashing. See the U-Boot switch settings reference for details.
| Mode | BOOT pins |
|---|---|
| USB DFU (recovery or flashing) | 0 0 0 |
| SPI-NAND (normal boot) | 1 1 1 |
The make release, make debug, and nix build commands chain a programmer build (USB DFU loader) and bundle the resulting tf-a-programmer.stm32 and fip-programmer.bin into the variant's images/ directory, along with a rewritten flashlayout.tsv whose paths resolve relative to that directory.
To flash from the bundled output:
STM32_Programmer_CLI -l usb
STM32_Programmer_CLI -c port=usb1 -w result/images/flashlayout.tsvThe first command lists detected DFU devices to confirm the port name. The second command flashes using the path from a nix build output. For a make build, use output/latest/images/flashlayout.tsv instead.
On a fresh SOM, burn the NAND OTP word before the first boot from SPI-NAND.
For faster iteration when the DTS is unchanged, set BUILD_PROGRAMMER=0 to skip the chained programmer build. In that case the build uses the original board/myd-yf135/flashlayout.tsv, which references output/programmer/images/ and output/latest/images/ directly.