Simplicity Headless Operation

by <a href=""><font color="#000000"><font size="2">Hero Employee</font></font> </a> jonorem on ‎10-21-2014 01:54 PM - edited on ‎02-20-2017 04:07 AM by Administrator Siliconlabs


How can I use Simplicity IDE to compile programs from the command line


Headless Build


You can tell Studio to import/build projects from the command line like this:


studio.exe -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild options -data workspace_path


options is any combination of the following: 

* - Import projects : -import {[uri:/]/path/to/project}
* - Import all projects in the tree : -importAll {[uri:/]/path/to/projectTreeURI}
* - Build projects / the workspace : -build {project_name_reg_ex/config_name_reg_ex | all}
* - Clean build projects / the workspace : -cleanBuild {project_name_reg_ex/config_name_reg_ex | all}
* - Add Include path to build : -I {include_path}
* - Add Include file to build : -include {include_file}
* - Add preprocessor define to build : -D {prepoc_define}
* - Replace environment variable in build : -E {var=value}
* - Append environment variable to build : -Ea {var=value}
* - Prepend environment variable to build : -Ep {var=value}
* - Remove environment variable in build : -Er {var}
* - Replace a tool option value: -T {toolid} {optionid=value}
* - Append to a tool option value: -Ta {toolid} {optionid=value}
* - Prepend to a tool option value: -Tp {toolid} {optionid=value}
* - Remove a tool option: -Tr {toolid} {optionid=value}

workspace_path is the path to the workspace to use.  On a build server this would probably be a temp directory in which to run the build.




studio.exe -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -importAll C:\myProject -cleanBuild myProject/Release -build myProject/Release -data C:\tempWorkspace


This would import any .project files in C:\myProject into C:\tempWorkspace and do a clean build of the release build configuration of the project named myProject.


Handling Output


In the case where a headless build is used in a continuous integration server it is useful to have the output of the build streamed to the console for parsing or logging. In order to do this use studio_c.exe instead of the studio.exe executable. 


Before studio_c.exe can be used the contents of studio.ini should be copied to the studio_c.ini file.


In some cases the following my also be required to successfully route output to stdout. It must be the last switch in the command line used. 


-vmargs -Dorg.eclipse.cdt.core.console=org.eclipse.cdt.core.systemConsole


Finally note that  --launcher.supressErrors can be used to suppress popup's for automated builds.


Command Line Flashing


  For EFM32 products eACommander (part of Simplicity Studio) has a command line interface that can be used 


  For C8051 products the Flash Programming Utilities include a command like programmer. 




Control of Simplicity Studio via Python is under development. The API's are currently in flux and not suitable for production environments. A release date for this functionality has not yet been set.

by mgdmc
on ‎02-27-2017 09:27 AM

Where is the studio_c.exe located? After a fresh install of version 4.0.11,  a search of the installation directory for studio_c.exe yields only studio.exe.

by johnkuriakose
on ‎03-01-2017 04:41 AM

Headless is not working with studio.exe and studio_c.exe is missing for latest version of SSv4. Can someone from Silicon Labs explain how to do headless builds using Simplicity Studio version 4.

by andrewleech
on ‎06-14-2017 04:17 AM

While this does basically work on Simplicity Studio 4 I can't capture the build output.


Running as per the original Example above returns immediately with no output whatsoever, I have to watch task manager to see when studio.exe has finished. It does build though.


I found that if I run it behind cmd.exe and add -console I get a new window popup with the build output displayed, and the original cmd prompt waits until it finishes. This is beter but I still can't find a way to capture the build output.

cmd /c c:\SiliconLabs\SimplicityStudio\v4\studio.exe -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild --launcher.suppressErrors -import c:\Test\EFM8BB1_Blinky -cleanBuild all -build all -data %TEMP%\build -console

Trying to redirect the output from cmd above with "> build.log" does nothing, results in empty file.


Can we please get a little support for build machines and similar headless build needs?

by <a href=""><font color="#000000"><font size="2">Star</font></font> </a> mrs-mrl
on ‎09-21-2017 08:41 AM

I've been fighting with the same issue. Basically without studio_c.exe the whole headless build / ci build is a huge headache. Calling studio.exe (eclipse.exe) using the headless build parameters causes an independent sub-process to be spawned. Now this independent sub-process behaves as expected, gives you proper build output, return 0 on success and all that, but is a nightmare to work with in any build automation tool.


You can read about it here:


Since all we need SimplicityStudio to do is to provide libraries/resources and generate makefiles using it's CDT plugin, I've tried simply using a 'normal' / standard eclipse cdt install with the SiliconLabs project, but haven't been successful so far.


I'll open a support request to get studio_c.exe, but it seems like we'll have to switch to a custom makefile and use Simplicity Studio as a library downloader from now on. I mean, any reliable build system should be that way anyhow.

by <a href=""><font color="#000000"><font size="2">Star</font></font> </a> mrs-mrl
on ‎09-21-2017 08:45 AM

As far as I know Unix versions of eclipse don't have different binaries for GUI and command-line mode, so those shouldn't be affected. But since we're using the windows only IAR ARM compiler we can't simply use a Linux build server.