cancel
Showing results for 
Search instead for 
Did you mean: 

Do STM32CubeProgrammer Command Line interface have return codes?

YTan.3
Associate II

0693W00000Dlb59QAB.pngSince STM32 STLINK Utility Command Line Interface has return codes, why STM32Cube Programmer don't have?

14 REPLIES 14

With ST-link CLI: (it worked fine, just for comparison purpose)

@echo off
SET COMMAND=st-link_cli -c SWD FREQ=4000 UR
SET FILE=%1%
echo.
echo %FILE%
echo ===================================================================
echo SURE TO ERASE-PROGRAM-VERIFY? Press Ctrl+C to cancel
echo ===================================================================
echo.
pause
%COMMAND% -OB RDP=0 WPRMOD=0 WRP=0 -ME -P %FILE% -V
echo return value is %errorlevel%
if %errorlevel%== 0	 echo Command executed successfully.
if %errorlevel%== 1	 echo Command arguments error.
if %errorlevel%== 2	 echo Connection problem.
if %errorlevel%== 3	 echo Command not available for the connected target.
if %errorlevel%== 4	 echo Error occurred while writing data to the specified memory address.
if %errorlevel%== 5	 echo Cannot read memory from the specified memory address.
if %errorlevel%== 6	 echo Cannot reset MCU.
if %errorlevel%== 7	 echo Failed to run application.
if %errorlevel%== 8	 echo Failed to halt the core.
if %errorlevel%== 9	 echo Failed to perform a single instruction step.
if %errorlevel%== 10 echo Failed to set/clear a breakpoint.
if %errorlevel%== 11 echo Unable to erase one or more Flash memory sectors.
if %errorlevel%== 12 echo Flash memory programming/verification error.
if %errorlevel%== 13 echo Option bytes programming error.
if %errorlevel%== 14 echo Memory loader fails (internal Flash memory or external memory)
echo.
pause

Hopefully can be fixed soon. My product's manufacturing process depends on returned-code to detect failure in programming.

Now always return zero in any condition: STM32CubeProgrammer (2.10.0)

There is another issue in STM32CubeProgrammer CLI (2.10.0) (writing STM32G070), if you set RDP=1 and other option bytes in the same CLI command RDP is not written and MCU is not readout protected. If all option bytes (but RDP) are set in a CLI command and RDP=1 is set with another command, then MCU is protected.

DLang.4
Associate II

Is this issue solved? Its a problem in our production too

@Sara BEN HADJ YAHYA​ @Nawres GHARBI​ 

N​eed bug fixes and an authoritative list of return codes.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..