cancel
Showing results for 
Search instead for 
Did you mean: 

STM32Cube: Generate code from command line with no GUI

Avi Shukron
Associate
Posted on June 14, 2018 at 17:59

Hi!

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:

0690X0000060BfYQAU.png

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?

#stm32cubemx. #stme32-cube
11 REPLIES 11

Have you found solution to this problem?

Hi @themole I am facing the same issue. Can you elaborate on your solution or share some reference? Thanks