st-flash
TLDR
Flash binary
SYNOPSIS
st-flash [--verify] command [file] [address] [size]
DESCRIPTION
st-flash is a command-line tool for reading, writing, and erasing the flash memory of STM32 microcontrollers through an ST-Link programmer/debugger. It is part of the open-source stlink toolset.
The tool works with raw binary files and requires explicit memory addresses for read and write operations. The flash base address for most STM32 devices is 0x8000000. Write verification can be enabled with --verify to confirm the programmed data matches the input file. The erase command clears the entire flash memory, and reset restarts the microcontroller after programming.
PARAMETERS
write
Write to flash.read
Read from flash.erase
Erase all flash.reset
Reset chip.--verify
Verify after write.--reset
Reset after operation.--serial SN
Device serial.
CAVEATS
ST-Link required. STM32 specific. Correct address needed.
HISTORY
st-flash is part of stlink, an open-source toolset for programming STM32 microcontrollers via ST-Link.
