cancel
Showing results for 
Search instead for 
Did you mean: 

Run STM32 scripts to generate SFI file in GitLab CI/CD pipeline

mikel-m
Associate II

Hi,

I have executed the scripts to generate SFI on a Linux machine and I have successfully completed the process. Now, I want to run these scripts in a GitLab CI/CD pipeline to automate the process. However, when I try to execute the script, I get this error:
$ ./GenerateSFI_OEM_Dev.sh
qt.qpa.xcb: could not connect to display
Segmentation fault (core dumped)

Does anyone know how I can run these scripts in a GitLab CI/CD pipeline? For example, I want to execute this script:

#!/bin/sh
# Set to the default installation path of the Cube Programmer tool
# If you installed it in another location, please update path
tool_dir=~/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32TrustedPackageCreator_CLI
key=../Keys/aeskey.bin
nonce=../Keys/nonce.bin
optbyte=$tool_dir/SFI_OB_CSV_FILES/SFI_OB_U5_2M.csv
binary=../Binary/OEM_Dev.bin
binary_base_add=0x08000000
sfi_out_file=../Binary/OEM_Dev.sfi
sudo $tool_dir -sfi -fir $binary $binary_base_add -devid 0x482 -k $key -n $nonce -ob $optbyte -v 1 --ramsize 0x55500 --token 0x80F0000 -hash 1 -o $sfi_out_file

 Best regards,

2 REPLIES 2
rme01
Associate

I would also be interested in running STM32TrustedPackageCreator in a gitlab pipeline.

Interestingly, STM32TrustedPackageCreator_CLI actually links to GUI libs like Qt or X11 which makes it hardly a CMD tool.

@st pipelines are an important part of software development and export nowadays. Please make our life a bit easier when generating signed binaries in containers. Lots of people would appreciate it I think.

Hi,

I managed to run the STM32 Cube Programmer scripts as follows:

  1. I registered a GitLab runner on the Linux machine where the STM32 Cube Programmer is installed.
  2. I modified the scripts to use the path of the STM32 Cube Programmer and the STM32 Trusted Package Creator on the Linux machine.
  3. I executed the script from the .gitlab-ci.yml file using the "xvfb-run" tool. For example:
    xvfb-run --auto-servernum --server-args="-screen 0 640x480x24" ./GenerateSFI_OEM_Dev.sh

With this, I was able to run the scripts to generate the SFI file and install it on the microcontroller through the GitLab pipeline.

Before running the pipeline, we will need to connect the microcontroller to the Linux machine.