commit for program flash script and specific OpenOCD config files for debugger interface and target chip architecture.

This commit is contained in:
2026-09-14 20:42:57 +08:00
parent 3605de5725
commit 041791b6ca
4 changed files with 174 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
@echo off
:: call for build script
call ".\make&build.bat" %*
if NOT %errorlevel% == 0 (
exit
)
@echo ================================[ StLink ]================================
.\Tools\xpack-openocd-0.12.0-7\bin\openocd ^
-f .\Tools\Specific_Config\stlink-interface.cfg ^
-f .\Tools\Specific_Config\stm32g0x-target.cfg ^
-c "program Build/Debug/STM32G030F6P6_Evaluation.elf verify reset exit"
if %errorlevel% == 0 goto end
@echo ================================[ CMSIS-DAP ]================================
.\Tools\xpack-openocd-0.12.0-7\bin\openocd ^
-f .\Tools\Specific_Config\cmsis-dap-interface.cfg ^
-f .\Tools\Specific_Config\stm32g0x-target.cfg ^
-c "program Build/Debug/STM32G030F6P6_Evaluation.elf verify reset exit"
if %errorlevel% == 0 goto end
@echo ================================[ STM32CubeProgrammer-Usart ]================================
:: STM32G0x flash sector size2K
:: Uart mode can't erase flash memory over internal NVM size (32K).
:: Target flash MUST be erased first (try flash related functions or using debugger), otherwise the data can't be witten.
:: Commands below erase all legal sectors manually and skip address check for allowing write data to extra hidden flash.
STM32_Programmer_CLI.exe -c port=COM6 fc=hardware rts=high dtr=low -e [0 15] --skipErase -d .\Build\Release\STM32G030F6P6_Evaluation.elf
STM32_Programmer_CLI.exe -c port=COM6 fc=hardware rts=low dtr=high -e [0 15] --skipErase -d .\Build\Release\STM32G030F6P6_Evaluation.elf
if %errorlevel% == 0 (
@echo ***** Need To Reset Target Manually *****
goto end
)
@echo ================================[ Program Flash Failed ]================================
exit
:end
@echo ================================[ Program Flash Accomplished ]================================