如何使用 dfu-util 刷写 STM32 PlatformIO 固件

首先,你需要找到正确的固件文件。dfu-util 将刷写 firmware.bin,而不是 firmware.elf。你可以在

.pio_build_path.txt
.pio/build/[PROFILE_NAME]/firmware.bin

中找到 firmware.bin,在你的项目文件夹内。[PROFILE_NAME] 是你正在使用的构建配置文件的名称,即 platformio.ini 中部分的名称。例如:

.pio_build_path.txt
.pio/build/BIGTREE_OCTOPUS_V1/firmware.bin

现在使用 dfu-util 刷写:

dfu-util.sh
dfu-util -a 0 -D .pio/build/PROFILE_NAME/firmware.bin -s 0x08000000

标志:


Check out similar posts by category: Embedded, PlatformIO, STM32