Skip to main content
GRoss.5
Associate II
December 21, 2021
Question

I would like to automate the CubeMX build. This is to support continuous integration via Jenkins. So far, cannot find the answers I'm looking for.

  • December 21, 2021
  • 3 replies
  • 1899 views

..

This topic has been closed for replies.

3 replies

Olivier GALLIEN
ST Technical Moderator
December 22, 2021

Hi @Community member,​ 

AFAIK CubeMX offer a CLI

refer to STM32CubeMX for STM32 configuration and initialization C code generation - User manual

Section

3.3.2 Running STM32CubeMX in command-line mode

Post redirect to STM32CubeMX topic for further support if needed

Olivier

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
GRoss.5
GRoss.5Author
Associate II
January 5, 2022

Olivier,

Below is the batch file I am invoking from Jenkins to automate the CubeMX build. Following that is the CubeMX script file. When I run the batch file from the command file it works fine. Although I do get a progress bar during the "project generate" phase. Because I use the -q qualifier, I would not expect this progress bar. But when running from Jenkins I get the following:

0693W00000HpaEJQAZ.pngEverything seems to be working fine until "project generate". I terminate after a few minutes. Could it be that CubeMX is trying to display the progress bar?

Batch file:

java -jar "C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMX\STM32CubeMX.exe" -q "C:\JenkinsBuilds\workspace\ICELL8_Firmware\ICELL8_FirmwareScript.txt"

"C:\Program Files\IAR Systems\Embedded Workbench 9.0\common\bin\iarBuild.exe" "C:\JenkinsBuilds\workspace\ICELL8_Firmware\EWARM\ICELL8_Firmware.ewp" -make "Release" -log info

Script file:

config load "C:\JenkinsBuilds\workspace\ICELL8_Firmware\ICELL8_Firmware.ioc"

project generate ./

exit

GRoss.5
GRoss.5Author
Associate II
December 22, 2021

Olivier,

Below is the batch file I am invoking from Jenkins to automate the CubeMX build. Following that is the CubeMX script file. When I run the batch file from the command file it works fine. Although I do get a progress bar during the "project generate" phase. Because I use the -q qualifier, I would not expect this progress bar. But when running from Jenkins I get the following:

0693W00000HpaEJQAZ.pngEverything seems to be working fine until "project generate". I terminate after a few minutes. Could it be that CubeMX is trying to display the progress bar?

Batch file:

java -jar "C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMX\STM32CubeMX.exe" -q "C:\JenkinsBuilds\workspace\ICELL8_Firmware\ICELL8_FirmwareScript.txt"

"C:\Program Files\IAR Systems\Embedded Workbench 9.0\common\bin\iarBuild.exe" "C:\JenkinsBuilds\workspace\ICELL8_Firmware\EWARM\ICELL8_Firmware.ewp" -make "Release" -log info

Script file:

config load "C:\JenkinsBuilds\workspace\ICELL8_Firmware\ICELL8_Firmware.ioc"

project generate ./

exit