Simplicity Headless Operation

by <a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><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

Question

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

Answer

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.

 

 

Example

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. 

 

Scripting

 

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.

Comments
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?