2022-03-22 6:23 AM
CubeProgrammer under Windows (graphical Version) is working fine.
CubeProgrammer with Cmd Line brings error:
Output
-------------------------------------------------------------------
STM32CubeProgrammer v2.10.0
-------------------------------------------------------------------
ST-LINK SN : 50FF6B067867515336372367
ST-LINK FW : V2J39S7
Board : --
Voltage : 3.03V
SWD freq : 4000 KHz
Connect mode: Normal
Reset mode : Software reset
Error: Unable to list supported devices
Error: Cannot identify the device
Press any key to continue . . .
This is my command in Batch File:
STM32_Programmer_CLI.exe -c port=SWD -vb 3 -e all -w SmartStepper_BootAndAppl_Vn_nnn.hex
pause
My hardware is a STM32G431 with ST-Link V2 Iso. Hardware is completely working with the graphical version or with Keil debugger.
Thanks for any idea
Franz
2022-04-13 1:18 AM
I found the problem. The cmd line program works only in the installation file. As default ST uses this path: C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin
Because this path uses spaces. In a batch File a space is not allowed.
My solution:
I installed ST Cube Programmer in this folder:
C:\ST\STM32CubeProgrammer\bin
And then I made a batch in my project folder:
@echo off
cls
echo ----------------------------------------------------------------------------------
echo SmartStepper Programmer: Program Application only (without Bootloader)
echo Connect ST-Link to USB Port and SmartStepper Board
echo ----------------------------------------------------------------------------------
@echo on
C:\ST\STM32CubeProgrammer\bin\STM32_Programmer_CLI.exe -c port=SWD -vb 3 -e [4 15] -d build\SmartStepper.hex -rst
In my project: Sector 0-3: Bootloader, Sector 4-15: Application
This batch file I call from my Keil developer system (because internal flash loader has problem if Flash cannot be erased complete)
Find the the Keil installation on top.
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.