stm32flash Wiki
Open source flash program for STM32 using the ST serial bootloader
Brought to you by:
tormod
Install MSYS2 from http://msys2.github.io/
To avoid interference from other software on your computer, set a clean path in the MSYS window before running the upgrade commands:
PATH=/usr/local/bin:/usr/bin:/bin:/opt/bin
update-core
pacman -Su
pacman -Sy
Close all MSYS windows and open a new one to install the toolchain:
PATH=/usr/local/bin:/usr/bin:/bin:/opt/bin
pacman -S mingw-w64-x86_64-gcc
pacman -S make
Now open a MINGW64 shell to build stm32flash:
PATH=/mingw64/bin:/usr/local/bin:/usr/bin:/bin
cd stm32flash
make
E.g. on a Debian/Ubuntu system with the gcc-mingw-w64-x86-64 package installed:
CC=x86_64-w64-mingw32-gcc make
Alternatively with autotools: (doesn't seem to produce good binaries - help is welcome)
autoreconf -v -i # Can be skipped if there is already a "configure" script distributed
./configure --host=x86_64-w64-mingw32
make