AnsweredAssumed Answered

STM32Cube: Generate code from command line with no GUI

Question asked by Avi Shukron on Jun 14, 2018
Latest reply on Jun 17, 2018 by Asaf Kahlon



I have a project based on STM32. The project can be configured to run on several STM32 boards.

Each board configuration is represented by the `.ioc` file created by CubeMX.

I want to have a CI (Continuous Integration) setup that will compile the project for all supported boards.

In order to do this I created a Docker image with Java, STM32CubeMX and all the necessary toolchain.

Then I wrote a Cube command line script that generates the code given a `.ioc` file as an input.


I invoke this script as part of a Makefile using a line similar to this:


java -jar STM32CubeMX -q my_script


Since I passed the `-q` flag, I expected that no GUI will be presented.

The docker container crashes executing this line, since it does not have a display capabilities requested by CubeMX, even if it is not going to display anything.


I tried doing this on an actual machine without docker, but then sometimes I would get a popup window during the generation process that requires user intervention.


Such window might pop when you enable FreeRTOS and select SysTick as the HAL timebase source:



This is a problem since the generation process is halted until the user presses a button, which is unacceptable for automated CI environment.


Is there a way to use Cube as a *true* CLI? I would rather it failed when encounter any problem, instead of waiting for user input.


Is such thing possible?