Skip to main content
YTan.3
Associate II
Aug 30, 2021 10:52 AM UTC
Solved

Do STM32CubeProgrammer Command Line interface have return codes?

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

This topic has been closed for replies.
Guillaume K
Guillaume KBest answer
ST Employee
Sep 6, 2021 7:18 AM UTC

Please select my answer as Best to close the question.

15 replies

Guillaume K
ST Employee
Aug 30, 2021 12:40 PM UTC

it seems that STM32CubeProgrammer returns 0 (zero) if no problem and a code different from zero in case of error. But it is not documented in the user manual as ST-LINK Utility.

Example of error case: On a Windows PC, if no STM32 connected to the PC:

STM32_Programmer_CLI.exe -c port=swd --list
 
 -------------------------------------------------------------------
 
 STM32CubeProgrammer v2.8.0
 
 -------------------------------------------------------------------
 
 
Error: No debug probe detected.
 
 
c:\>echo %ERRORLEVEL%
 
1

Are you using something else than a Windows PC ? (Linux ? Mac ?)

YTan.3
YTan.3Author
Associate II
Sep 4, 2021 7:24 AM UTC

Hi Guillaume,

I m using Windows. it does working.

Thank you so much for your help.

Guillaume K
Guillaume KBest answer
ST Employee
Sep 6, 2021 7:18 AM UTC

Please select my answer as Best to close the question.

Guillaume K
ST Employee
Sep 7, 2021 9:28 AM UTC

I backtrack a little: in current version of STM32CubeProgrammer (2.8.0) there are some cases where STM32CubeProgrammer returns 1 in case of error, but some other error cases it returns 0. There are ongoing actions to correct that in future versions.

FArdi.1
Associate II
Sep 28, 2021 7:22 AM UTC

0693W00000FAbGLQA1.pngHopefully 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.8.0)

YTan.3
YTan.3Author
Associate II
Sep 28, 2021 7:28 AM UTC

Hi Fardi,

Would you mind to share how to get "return value is 0"? Is there any special command?

Thanks

DLang.4
Associate II
Mar 20, 2023 9:10 AM UTC

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

Tesla DeLorean
Guru
Mar 20, 2023 10:06 AM UTC

@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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
Associate
Feb 14, 2025 8:23 AM UTC

Hi to all

I know this is a old theread but are there any news about the return values from STM32CubProg CLI.
I observed that is retuning 0 for now error and if there is an error 1. Is there still no list of error codes to get the exact failure?

 

Best regards