cancel
Showing results for 
Search instead for 
Did you mean: 

How do I change options for headless build? I want to enable converthex so I can output hex files for automated builds

I can use headless build using the following command:

Linux:

cd <my project path>
/opt/st/stm32cubeide_1.11.0/headless-build.sh -import . -cleanBuild <my project name>/Debug

Windows

C:\ST\STM32CubeIDE_1.11.0\STM32CubeIDE\headless-build.bat -import . -cleanBuild <project_name>/Debug

But I want to generate a hex file without modifying the project. The documentation of headless-build.sh states the following:

Usage: /opt/st/stm32cubeide_1.11.0/stm32cubeide -data <workspace> -application org.eclipse.cdt.managedbuilder.core.headlessbuild [ OPTIONS ]
 
[...]
 
  -Ta        {toolid} {optionid=value} append to a tool option value in each configuration built
 
[...]
 
              Tool option values are parsed as a string, comma separated list of strings or a boolean based on the options type

If I check convert hex manually in the ide I get the following line added to .cproject:

<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.converthex.760051483" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.converthex" value="true" valueType="boolean"/> 

I tried the following command, but it doesn't produce a hex file:

Linux:

/opt/st/stm32cubeide_1.11.0/headless-build.sh -import . -cleanBuild <my project name>/Debug -Tp com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug com.st.stm32cube.ide.mcu.gnu.managedbuild.option.converthex=true

 Windows:

C:\ST\STM32CubeIDE_1.11.0\STM32CubeIDE\headless-build.bat -import . -cleanBuild <project_name>/Debug -Ta com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug.2132964004 com.st.stm32cube.ide.mcu.gnu.managedbuild.option.converthex.371515941=true

 or directly calling stm32cubeidec.exe:

C:\ST\STM32CubeIDE_1.11.0\STM32CubeIDE\stm32cubeidec.exe --launcher.suppressErrors -nosplash <-data "workspace_path>" -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import . -cleanBuild<project_name>/Debug -Ta com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug.2132964004 com.st.stm32cube.ide.mcu.gnu.managedbuild.option.converthex.371515941=true

How do I enable converthex via the command line?

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.
0 REPLIES 0