cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any scripting support to STM32CubeIDE to load a project build the project and download the project using debugger to Microcontroller STM32H745XI

BareMetalExpert
Associate III

Is there any scripting support to STM32CubeIDE to load a project build the project and download the project using debugger to Microcontroller STM32H745XI

8 REPLIES 8
MM..1
Chief II

Try headless-build.bat

Guillaume K
ST Employee

after building with STM32CubeIDE in headless build mode, you can use STM32CubeProgrammer to program the binary to the STM32 board.

Guillaume K
ST Employee

example of headless build command:

C:\ST\stm32cubeide_1.7.0\STM32CubeIDE\\stm32cubeidec -nosplash --launcher.suppressErrors -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import c:\path\to\cubeIDE_project -cleanBuild project_name_in_workspace -data c:\path\to\cubeIdeWorkspace

-import tells where the .cproject / .project files are

-data tells where you want to put the eclipse workspace

-cleanBuild project_name is the name of the project once imported in the workspace

you can use also -clean or -build

it's also possible to specify the build configuration : -build project_name/Debug

or -build project_name/Release

BareMetalExpert
Associate III

After Completion of build with STM32CubeIDE in headless build mode,

Is there an automated scrit that we can use STM32CubeProgrammer to program the binary to the STM32 board ?.

After Completion of build with STM32CubeIDE in headless build mode,

Is there an automated scrit that we can use STM32CubeProgrammer to program the binary to the STM32 board ?.

Guillaume K
ST Employee

Use STM32Programmer_CLI tool with "-d" (download) command:

"C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\STM32_Programmer_CLI.exe" -c port=SWD -d C:\path\to\firmware.elf 0x08000000

Notes:

  • the .elf file is usually generated in the STM32CubeIDE project folder under Debug\ directory
  • if the flashing of the .elf file doesn't work you can try to flash the firmware.bin binary file instead. To have the .bin file in STM32CubeIDE you have to check option "Convert to binary (-O binary)" in the project settings, in "MCU post build outputs". The .bin file is generated in the same directory as the .elf file, (under Debug\ directory).
  • this example works with one STM32 board connected to the PC. if several boards are connected, the board STLink serial number must be indicated with -c port=SWD sn=<STLink serial number>

Thanks for the Download Command using STM32 Programmer .

Additional to this command is there any scripting command to set the STM controller in execution mode or start executing application or Self reset the controller etc .

STM32_Programmer_CLI.exe --help