如何使用 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标志:
-a 0。STM32 在dfu-util中显示为四个不同的设备(参见dfu-util --list):闪存、选项字节、RAM 等各自显示为单独的设备。我们只关心闪存设备,它始终是这些设备中的第一个(索引0),至少在我到目前为止见过的每块板上都是如此-D [文件名]:将固件下载到设备-s 0x08000000:在地址0x08000000处刷写,这是 STM32 闪存的地址。
Check out similar posts by category:
Embedded, PlatformIO, STM32
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow