編譯步驟
- 安裝 MSYS2,打開 MSYS2 MinGW 64-bit 終端。
- 安裝工具鏈:`pacman -S mingw-w64-x86_64-gcc make`。
- 下載源碼:`git clone https://github.com/stm32flash/stm32flash.git`。
- 編譯:`cd stm32flash && make` → 生成 `stm32flash.exe`。
現成下載
CSDN 下載:stm32flash-0.4 Windows 編譯版 (含 dll 依賴)。
使用示例
stm32flash.exe -w firmware.bin -v -g 0x0 COM3
注意
- 需安裝對應 COM 口驅動 (ST-Link / USB-TTL)。
- 64 位系統編譯 64 位 exe,32 位系統用 `mingw-w64-i686-gcc`。