Continuous Integration / Continuous Delivery (CI/CD)#

Objective#

Use Silicon Labs Tool (SLT) and the Silicon Labs Configurator command-line interface (SLC-CLI) to automate software development tasks in a CI/CD pipeline.

SLT and SLC-CLI support headless, scriptable workflows without requiring the Simplicity Studio graphical user interface (GUI). You can use these tools to install SDKs, generate projects, build applications, and flash devices as part of an automated CI/CD pipeline.

For SLT CLI information, see Overview of the Silicon Labs Tool (SLT).

Key Features#

Feature

Purpose

Headless installation

Install SDKs and tools without a GUI

Reproducible builds

Use pkg.lock to install identical package versions

Scriptable

Automate by using shell or Python scripts

Cross-platform

Support Windows, macOS, and Linux

Non-interactive mode

Use --non-interactive for unattended CI jobs

Typical CI/CD Workflow#

Step 1. Update SLT#

Update SLT to the latest version.

slt update --self --non-interactive

Step 2. Install Required Packages#

Install the packages defined in the lock file.

slt install -f pkg.lock --non-interactive

Step 3. Verify the SDK Installation#

Verify that the required SDK is installed.

slt where simplicity-sdk

Step 4. Generate the Project#

Generate the project by using the project configuration file.

slc generate --slt-config=user.slconf -d output/my_project

Step 5. Build the Project#

Build the generated project by using either CMake or GNU Make.

Using CMake:

cd output/my_project/cmake_gcc
cmake --workflow --preset project

Using GNU Make:

cd output/my_project
make -f my_project.Makefile

Step 6. Flash the Device (Optional)#

commander flash build/application.hex

Complete CI/CD Pipeline#

┌─────────────────────────────────────────────────────────────┐
│                    CI/CD Pipeline                           │
├─────────────────────────────────────────────────────────────┤
│ 1. Update SLT                                               │
│    slt update --self --non-interactive                      │
│                                                             │
│ 2. Install packages                                         │
│    slt install -f pkg.lock --non-interactive                │
│                                                             │
│ 3. Verify SDK                                               │
│    slt where simplicity-sdk                                 │
│                                                             │
│ 4. Generate project                                         │
│    slc generate --slt-config=user.slconf                    │
│                                                             │
│ 5. Build project                                            │
│    cmake --workflow --preset project                        │
│                                                             │
│ 6. Flash the device (optional)                              │
│    commander flash build/<application>.hex                  │
└─────────────────────────────────────────────────────────────┘