Skip to content

Instantly share code, notes, and snippets.

@rubeniskov
Last active May 24, 2025 08:46
Show Gist options
  • Save rubeniskov/d4efae6266b8278a8add6538d460f928 to your computer and use it in GitHub Desktop.
Save rubeniskov/d4efae6266b8278a8add6538d460f928 to your computer and use it in GitHub Desktop.

Burning STM32 Using FTDI R232

Connection

Make sure you have selected the right voltage in the FTDI Chip selector (5V/3.3V), VCC Must be matched with the ouput voltage.

FTDI_R232_UART

FTDI STM32
TX A10
RX A9
VCC 5V/3V3 (Voltage Switch)
GND G

Installing burner

$ git clone https://github.com/ARMinARM/stm32flash.git
$ cd stm32flash
$ make 
$ make install 

Reading

Firt you have to press the button reset in order to force the bootloader read commands from UART. Then execute the command below

stm32flash -r - -g 0x8000000 $(ls /dev/tty.*usbserial*) > ouput.bin
Interface serial_posix: 57600 8E1
Version      : 0x22
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0410 (Medium-density)
- RAM        : 20KiB  (512b reserved by bootloader)
- Flash      : 128KiB (sector size: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB
Memory read
Read address 0x08020000 (100.00%) Done.

Starting execution at address 0x08000000... done.

Writing

Firt you have to press the button reset in order to force the bootloader read commands from UART. Then execute the command below

$ stm32flash -w main.bin -v -g 0x8000000 $(ls /dev/tty.*usbserial*)
stm32flash 0.4

http://stm32flash.googlecode.com/

Using Parser : Intel HEX
Interface serial_posix: 57600 8E1
Version      : 0x22
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0410 (Medium-density)
- RAM        : 20KiB  (512b reserved by bootloader)
- Flash      : 128KiB (sector size: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB
Write to memory
Erasing memory
Wrote and verified address 0x08001f00 (74.56%) 
Starting execution at address 0x08000000... done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment