2023-01-26 07:03 AM
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?