Created
May 4, 2021 15:15
-
-
Save dreamcat4/5d8f1d78021fdc3b5a7c57ec70ba9857 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openocd-flash-elf-stlink-stm32f4x() | |
{ | |
if [ ! "$1" ]; then | |
echo "error: must speficy a firmware.elf to flash" | |
return 1 | |
fi | |
_openocd_scripts_path="$HOME/.platformio/packages/tool-openocd/scripts" | |
# _firmware_elf=".pio/build/blackpill_f411ce/firmware.elf" | |
_firmware_elf="$1" | |
openocd -d1 -s "$_openocd_scripts_path" \ | |
-f interface/stlink.cfg -c transport select hla_swd -f target/stm32f4x.cfg \ | |
-c program {$_firmware_elf} verify reset; shutdown; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment