cancel
Showing results for 
Search instead for 
Did you mean: 

How do I build my STM32CubeIDE code via the command line on Linux?

VWied.1
Associate III

According to other answers on this website, it looks like I am supposed to do something like:

~/st/stm32cubeide_1.8.0/stm32cubeide --launcher.suppressErrors -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data "./" -build *

And I run the above line in the same folder as my .mxproject, .project and .cproject files.

The error I am getting is:

Invalid Arguments: [-build, Core, Drivers, stm32 Project.ioc, Middlewares]
Error: Unknown argument: Drivers
Usage: PROGRAM -data <workspace> -application org.eclipse.cdt.managedbuilder.core.headlessbuild [ OPTIONS ]
 
   -data       {/path/to/workspace}
   -import     {[uri:/]/path/to/project}
   -importAll  {[uri:/]/path/to/projectTreeURI} Import all projects under URI
   -build      {project_name_reg_ex{/config_reg_ex} | all}
   -cleanBuild {project_name_reg_ex{/config_reg_ex} | all}
   -markerType Marker types to fail build on {all | cdt | marker_id}
   -no-indexer Disable indexer
   -printErrorMarkers Print all error markers
   -I          {include_path} additional include_path to add to tools
   -include    {include_file} additional include_file to pass to tools
   -D          {prepoc_define} addition preprocessor defines to pass to the tools
   -E          {var=value} replace/add value to environment variable when running all tools
   -Ea         {var=value} append value to environment variable when running all tools
   -Ep         {var=value} prepend value to environment variable when running all tools
   -Er         {var} remove/unset the given environment variable
   -T          {toolid} {optionid=value} replace a tool option value in each configuration built
   -Ta         {toolid} {optionid=value} append to a tool option value in each configuration built
   -Tp         {toolid} {optionid=value} prepend to a tool option value in each configuration built
   -Tr         {toolid} {optionid=value} remove 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
 
Stm32cubeide:
JVM terminated. Exit code=1
/home/victor/st/stm32cubeide_1.8.0//plugins/com.st.stm32cube.ide.jre.linux64_2.0.100.202110150814/jre/bin/java
-Dosgi.requiredJavaVersion=1.8
-Dosgi.instance.area.default=@user.home/STM32CubeIDE/workspace_1.8.0
-Declipse.buildId=Version 1.8.0
-DproductMaturityGrade=mm
-XX:+UseG1GC
-XX:+UseStringDeduplication
-Xms256m
-Xmx1024m
-jar /home/victor/st/stm32cubeide_1.8.0//plugins/org.eclipse.equinox.launcher_1.6.100.v20201223-0822.jar
-os linux
-ws gtk
-arch x86_64
-launcher /home/victor/st/stm32cubeide_1.8.0/stm32cubeide
-name Stm32cubeide
--launcher.library /home/victor/st/stm32cubeide_1.8.0//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.2.100.v20210209-1541/eclipse_11301.so
-startup /home/victor/st/stm32cubeide_1.8.0//plugins/org.eclipse.equinox.launcher_1.6.100.v20201223-0822.jar
--launcher.overrideVmargs
-exitdata 2b8002
-application org.eclipse.cdt.managedbuilder.core.headlessbuild
-data ./
-build Core Drivers L073 - 100 pin.ioc Middlewares
-vm /home/victor/st/stm32cubeide_1.8.0//plugins/com.st.stm32cube.ide.jre.linux64_2.0.100.202110150814/jre/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.8
-Dosgi.instance.area.default=@user.home/STM32CubeIDE/workspace_1.8.0
-Declipse.buildId=Version 1.8.0
-DproductMaturityGrade=mm
-XX:+UseG1GC
-XX:+UseStringDeduplication
-Xms256m
-Xmx1024m
-jar /home/victor/st/stm32cubeide_1.8.0//plugins/org.eclipse.equinox.launcher_1.6.100.v2020

According to the other answers for this online, there shouldn't be any additional steps here.

1 ACCEPTED SOLUTION

Accepted Solutions
Bob S
Principal

Try "all" instead of "*", presuming you want to build all the projects in the workspace. Just guessing, but the regex "*" may be matching all directories, not projects, since "Drivers" is a standard CubeMX-created directory.Hadn't tried headless build on Linux till now, only on Windows. "*" gave me the same results as you got. "all" worked.

View solution in original post

2 REPLIES 2
Bob S
Principal

Try "all" instead of "*", presuming you want to build all the projects in the workspace. Just guessing, but the regex "*" may be matching all directories, not projects, since "Drivers" is a standard CubeMX-created directory.Hadn't tried headless build on Linux till now, only on Windows. "*" gave me the same results as you got. "all" worked.

VWied.1
Associate III

Hey @Bob S​ That is exactly what I was doing wrong. Also when I was trying to call a specific folder, I shouldn't be using quotes. For others, if you want to build all do:

<stm32CubeIde_Installation_path>/stm32cubeide_1.8.0/stm32cubeide --launcher.suppressErrors -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data "./" -build all

And if you are trying to build a specific project (this example is helloWorld), do:

<stm32CubeIde Installation path>/stm32cubeide_1.8.0/stm32cubeide --launcher.suppressErrors -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data "./" -build helloWorld