st-flash(1)

πŸ’– st-flash β€” the manual page, bestie edition πŸ’–

okay so this is st-flash, and it lives in the stlink manual family. literally what it does is flash binary files onto your STM32 device. that's the whole vibe. ✨


🌸 NAME 🌸

st-flash β€” Flash binary files to STM32 device 🫢


✨ SYNOPSIS ✨

st-flash [OPTIONS] {read|write|erase} [FILE] <ADDR> <SIZE>

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea, bestie: this thing flashes binary files into arbitrary sections of memory, or reads arbitrary addresses of memory out into a binary file. both directions. iconic. πŸ‘‘

You can use this instead of st-util(1) if that's more your vibe, but listen β€” use the .bin image, not the .elf file. that part matters, no cap.

And use hexadecimal format for the ADDR and the SIZE. like, hexadecimal. that's the format. periodt. πŸ’…


πŸŽ€ COMMANDS πŸŽ€

  • write FILE ADDR β€” Write firmware FILE to device starting from ADDR πŸ“
  • read FILE ADDR SIZE β€” Read firmware from device starting from ADDR up to SIZE bytes, out to FILE πŸ“–
  • erase β€” Perform a mass erasing of the device firmware πŸ’€
  • reset β€” Reset the target πŸ”„

πŸ’œ OPTIONS πŸ’œ

  • --version β€” Print version information 🏷️
  • --debug β€” TODO (yeah bestie, that's literally all it says, the authors left it as a TODO, we don't make the rules) πŸ™ˆ
  • --reset β€” Trigger a reset both before and after flashing ✨
  • --opt β€” Enable ignore ending empty bytes optimization 🧚
  • --serial iSerial β€” TODO (also just a TODO, fr fr) πŸ’€
  • --flash=fsize β€” Where fsize is the size in decimal, octal, or hex, followed by an optional multiplier k for KB, or m for MB. Use a leading 0x to specify hexadecimal, or a leading zero for octal. πŸ”’

🌈 EXAMPLES 🌈

Flash firmware.bin to device πŸ“

$ st-flash write firmware.bin 0x8000000

Read firmware from device (4096 bytes) πŸ’–

$ st-flash read firmware.bin 0x8000000 0x1000

Erase firmware from device πŸ’…

$ st-flash erase

🌟 SEE ALSO 🌟

st-util(1), st-info(1) β€” go read those too, bestie, they're part of the friend group 🫢


This work is copyrighted. Stlink contributors. See LICENSE file in the stlink source distribution. πŸ“œ


okay that's the whole page, you're officially fluent in st-flash now. go flash something responsibly (and in hex, always in hex). πŸ¦‹βœ¨

this one came from the stlink crew β€” that's the "Open Source STMicroelectronics S..." situation β€” and it's dated Feb 2018. mwah. bye bestie! πŸ’–πŸŽ€