Files

43 lines
1.8 KiB
Batchfile
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@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 ]================================