Skip to content

Embedded

Slint runs on many embedded platforms.

The platform descriptions below cover what has been tested for deployment. For the development environment, we recommend using a recent desktop operating system and compiler version.

Embedded Linux

Slint runs on a variety of embedded Linux platforms. Generally speaking, Slint requires a modern Linux userspace with working OpenGL ES 2.0 (or newer) or Vulkan drivers. We’ve had success running Slint on

  • Yocto based distributions.
  • BuildRoot based distributions.
  • Torizon.

For C++ applications see meta-slint for recipes.

Rust application work out of the box with Yocto’s Rust support.

Microcontrollers

Slint’s platform abstraction allows for integration into any Rust or C++ based Microcontroller development environment. Developers need to implement functionality to feed input events such as touch or keyboard, as well as displaying the pixels rendered by Slint into a frame- or linebuffer.

We provide templates for a few off-the-shelf development boards from some of the silicon vendors.

Espressif (ESP32)

To use Slint with your C++ application, you can follow the instructions on the Espressif Documentation site

ST (STM32)

STM32H735G-DK

You can start with the template slint-cpp-template-stm32h735g-dk.zip

STM32H747I-DISCO

You can start with the template slint-cpp-template-stm32h747i-disco.zip

Raspberry Pi (Pico)

Only Rust programs are currently supported on the Raspberry Pi Pico.

On the Raspberry Pi Pico

Build the Slint Printer demo with:

Terminal window
cargo build -p printerdemo_mcu --no-default-features --features=mcu-board-support/pico-st7789 --target=thumbv6m-none-eabi --release
bash

The resulting file can be flashed conveniently with elf2uf2-rs. Install it using cargo install:

Terminal window
cargo install elf2uf2-rs
bash

Then upload the demo to the Raspberry Pi Pico: push the “bootsel” white button on the device while connecting the micro-usb cable to the device, this connect some storage where you can store the binary.

Or from the command on linux: (connect the device while pressing the “bootsel” button.

Terminal window
# If you're on Linux: mount the device
udisksctl mount -b /dev/sda1
# upload
elf2uf2-rs -d target/thumbv6m-none-eabi/release/printerdemo_mcu
bash

On the Raspberry Pi Pico2

Build the Slint Printer demo with:

Terminal window
cargo build -p printerdemo_mcu --no-default-features --features=mcu-board-support/pico2-st7789 --target=thumbv8m.main-none-eabihf --release
bash

The resulting file can be flashed conveniently with picotool. You should build it from source.

Then upload the demo to the Raspberry Pi Pico: push the “bootsel” white button on the device while connecting the micro-usb cable to the device, this connects some USB storage on your workstation where you can store the binary.

Or from the command on linux (connect the device while pressing the “bootsel” button):

Terminal window
# If you're on Linux: mount the device
udisksctl mount -b /dev/sda1
# upload
picotool load -u -v -x -t elf target/thumbv8m.main-none-eabihf/release/printerdemo_mcu
bash

Using probe-rs

This requires probe-rs and to connect the pico via a probe (for example another pico running the probe).

Then you can simply run with cargo run

Terminal window
CARGO_TARGET_THUMBV6M_NONE_EABI_LINKER="flip-link" CARGO_TARGET_THUMBV6M_NONE_EABI_RUNNER="probe-rs run --chip RP2040" cargo run -p printerdemo_mcu --no-default-features --features=mcu-board-support/pico-st7789 --target=thumbv6m-none-eabi --release
bash

Flashing and Debugging the Pico with probe-rs’s VSCode Plugin

Install probe-rs-debugger and the VSCode plugin as described here.

Add this build task to your .vscode/tasks.json:

{
"version": "2.0.0",
"tasks": [
{
"type": "cargo",
"command": "build",
"args": [
"--package=printerdemo_mcu",
"--features=mcu-pico-st7789",
"--target=thumbv6m-none-eabi",
"--profile=release-with-debug"
],
"problemMatcher": [
"$rustc"
],
"group": "build",
"label": "build mcu demo for pico"
},
]
}
json

The release-with-debug profile is needed, because the debug build does not fit into flash.

You can define it like this in your top level Cargo.toml:

[profile.release-with-debug]
inherits = "release"
debug = true
toml

Now you can add the launch configuration to .vscode/launch.json:

{
"version": "0.2.0",
"configurations": [
{
"preLaunchTask": "build mcu demo for pico",
"type": "probe-rs-debug",
"request": "launch",
"name": "Flash and Debug MCU Demo",
"cwd": "${workspaceFolder}",
"connectUnderReset": false,
"chip": "RP2040",
"flashingConfig": {
"flashingEnabled": true,
"resetAfterFlashing": true,
"haltAfterReset": true
},
"coreConfigs": [
{
"coreIndex": 0,
"rttEnabled": true,
"programBinary": "./target/thumbv6m-none-eabi/release-with-debug/printerdemo_mcu"
}
]
},
]
}
json

This was tested using a second Raspberry Pi Pico programmed as a probe with DapperMime.

Other Platforms

Contact us if you want to use Slint on other platforms/versions.


© 2024 SixtyFPS GmbH