Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions win/stm32CubeProg.bat
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,24 @@ goto :opt
:opt
shift
shift
goto :optloop

:optloop
if "%~1"=="-o" goto :offset
if "%~1"=="" goto :prog
set OPTS=%1 %2 %3 %4 %5 %6 %7 %8 %9
goto :prog
set OPTS=%OPTS% %1
shift
goto :optloop

:offset
if "%~2"=="" set ERROR=2 & goto :usage
set OFFSET=%~2
SET /A ADDOFF=%ADDRESS%+%OFFSET%
cmd /C exit %ADDOFF%
set "ADDRESS=0x%=ExitCode%"
shift
shift
goto :optloop

:prog
%STM32CP_CLI% -c port=%PORT% %MODE% %ERASE% -q -d %FILEPATH% %ADDRESS% %OPTS%
Expand All @@ -94,4 +109,5 @@ exit 0
echo Ex: -g: Run the code at the specified address
echo -rst: Reset system
echo -s: start automatically (optional)
echo -o: offset address (optional). Ex: -o 0x2000
exit %ERROR%