swiftlang/swift-embedded-examples

A collection of example projects using Embedded Swift

1,045

stars

179

commits

Swift

primary language

Sep 15, 2026

updated

docs.swift.org/embedded/documentation/embedded
embedded
esp32
example
nrf
raspberrypi
stm32
swift

README

Embedded Swift Example Projects

This repository is a set of demonstration projects of Embedded Swift. Embedded Swift is a compilation and language mode that enables development of baremetal, embedded and standalone software in Swift. To learn more, see:

Building the examples

Each example in this repository contains build and deployment instructions, however there are a couple common steps needed for many of the examples included below:

  1. Install swift using the instructions here.

  2. Install uv, "an extremely fast Python package and project manager", using the instructions here.

Catalog of Examples

NamePlatformSDKDescriptionPhoto
esp32-led-blink-sdkESP32-C6-BugESP-IDF SDKBlink an LED repeatedly with Swift & the ESP-IDF.An ESP32-C6-Bug board with its onboard LED lit.
esp32-led-strip-sdkESP32-C6-DevKitC-1ESP-IDF SDKControl NeoPixel LEDs with Swift & the ESP-IDF.An ESP32-C6-DevKitC-1 board driving a lit WS2812 LED strip.
esp32-uart-echoESP32-C6ESP-IDF SDKUART echo example using Swift's print() and readLine().
harmonyRaspberry Pi Pico WPico SDKA bluetooth speaker and ferrofluidic music visualizer. Firmware, Electrical, and Mechanical designs fully available.The assembled Harmony Bluetooth speaker and ferrofluid visualizer.
nrfx-blink-sdknRF52840-DKZephyr SDKBlink an LED repeatedly with Swift & Zephyr.An nRF52840-DK board with its onboard LED lit.
nuttx-riscv-blinkQEMUNuttXBlink a virualized led in QEMU using the Apache NuttX RTOS
rpi-4b-blinkRaspberry Pi 4BNoneBlink the Pi's status green LED repeatedly using Swift MMIO.A Raspberry Pi 4B board.
rpi-5-blinkRaspberry Pi 5NoneBlink the Pi's status green LED repeatedly with Swift MMIO.A Raspberry Pi 5 board.
rpi-pico-blink-sdkRaspberry Pi Pico, Pico 2Pico SDKBlink an LED repeatedly with Swift & the Pico SDK.A Raspberry Pi Pico board.
rpi-pico-blinkRaspberry Pi PicoNoneBlink an LED repeatedly.A Raspberry Pi Pico board.
rpi-pico-lldbRaspberry Pi Pico, Pico 2NoneA tutorial project for debugging Embedded Swift with LLDB, containing bugs to find and fix.
rpi-pico2-neopixelRaspberry Pi Pico 2NoneControl Neopixel LEDs using the RP2350 PIO.A SparkFun Pro Micro RP2350 board with its RGB LED glowing red.
rpi-picow-blink-sdkRaspberry Pi Pico W, Pico 2WPico SDKBlink an LED to signal 'SOS' in Morse code repeatedly with Swift & the Pico SDK.A Raspberry Pi Pico W board.
stm32-blinkSTM32F746G-DISCONoneBlink an LED repeatedly.An STM32F746G-DISCO board with its onboard LED lit.
stm32-lcd-logoSTM32F746G-DISCONoneAnimate the Swift Logo on the built-in LCD.A Swift logo rendered on the STM32F746G-DISCO's onboard LCD panel.
stm32-lvglSTM32F746G-DISCOBaremetal setup of LCD, touch panel, DRAM, using the LLVM Embedded toolchain for ARM. Renders graphics, animations, and reacts to user input via LVGL. Includes a macOS/Linux SDL based host simulation app.An LVGL user interface running on the STM32F746G-DISCO's LCD.
stm32-neopixelSTM32F746G-DISCONoneControl NeoPixel LEDs using SPI.An STM32F746G-DISCO board driving a lit WS2812 NeoPixel LED strip.
stm32-uart-echoSTM32F746G-DISCONoneEcho user input using UART.A terminal echoing UART input from the STM32F746G-DISCO.

Note that the SDK integration examples (Pico SDK, Zephyr SDK, etc.) are not recommendations or endorsement, the same is true for build system choice (Make, CMake, SwiftPM, shell scripts). Embedded Swift aims to be versatile and allowing integration into existing SDKs and build systems, and the example projects show some of the possibilities.

Community Examples

[!WARNING] Community projects linked here are not officially supported by our team. They may not always be compatible with the latest nightly Swift toolchain builds.

NamePlatformDescription
swift-matter-examplesESP32An Embedded Swift Matter application running on ESP32-C6.
m5stack-nano-c6-bare-swiftESP32A baremetal Swift project for the M5Stack NanoC6 (ESP32-C6), running without any C, assembly, or ESP-IDF — pure Embedded Swift from bootloader to LED blink
swift-flipperzero-helloFlipper ZeroA demonstration of running Swift apps on the Flipper Zero.
EmbeddedSwift nRF52 ExamplesnRF52840 (Development Kit)A collection of examples using Embedded Swift on top of nRF Connect SDK (Zephyr).
SwataknRF52840 (Seeed Studio XIAO)A reaction time game inspired by BATAK© boards, implemented in Embedded Swift using nRF Connect SDK.
swift-picosystem-examplePicoSystemAn Embedded Swift demo running on the Pimoroni PicoSystem
pico-bare-swiftPicoBaremetal Raspberry Pi Pico examples in Embedded Swift — no Pico SDK required
CPicoSDKPico 2SwiftPM package that enables seamless Swift development for the Raspberry Pi Pico SDK
pico-swift-sh1106Pico 2Display Driver for SH1106
swift-st7789-lcdPico 2Display Driver for ST7789
PlaydateKitPlaydateA full featured framework for building Playdate games using Embedded Swift.
swift-playdate-examplesPlaydateAn Embedded Swift game running on Playdate by Panic.
swift-stm32c011-examplesSTM32Examples of running Embedded Swift on the STM32C011, which is a tiny MCU with only 6KB of SRAM and 32KB of flash.
flappy-swiftWebA WebAssembly game written in Swift in ~100 KB.
swift-for-wasm-examplesWebA "Swift Audio Workstation" example built with Swift for WebAssembly running in the browser using Embedded Swift.
swift-embedded-pebblePebbleAn example Pebble app for the Pebble Time 2, written in Embedded Swift.
swift-embedded-ndsNintendo DSNintendo DS homebrew written in Embedded Swift, ported from the official devkitPro examples.
swift-embedded-wiiNintendo WiiNintendo Wii homebrew written in Embedded Swift, ported from the official devkitPro examples.
swift-embedded-nintendo-64Nintendo 64Nintendo 64 homebrew written in Embedded Swift, using the original NuSys SDK and the newer and open source libdragon SDK.
swift-embedded-ps1Sony Playstation 1Playstation homebrew written in Embedded Swift, ported from PSn00bSDK examples.
Nanosaur2Nintendo 3DSPangea Software's Nanosaur 2 game ported to Nintendo 3DS using Embedded Swift.

Please note that the presence of community repositories and devices in this list does not constitute a recommendation or endorsement. If there's a project you'd like to see included here, please submit an issue with the details.

Contributing to this repository

This repository contains code that is not continuously developed, instead it's presented "as is" for educational and demonstrational purposes. Making major improvements to existing examples is discouraged, but additions of new examples is welcome.

Code of Conduct

Like all Swift.org projects, we would like these Embedded Swift example projects to foster a diverse and friendly community. We expect contributors to adhere to the Swift.org Code of Conduct.

Contact information

The current code owners of this repository are Kuba Mracek (@kubamracek) and Rauhul Varma (@rauhul). You can contact them on the Swift forums via the handles @kubamracek and @rauhul.

In case of moderation issues, you can also directly contact a member of the Swift Core Team.

Contributors

(top 30 of 42)

rauhul

53 commits

kubamracek

26 commits

iCMDdev

8 commits

swiftlang/swift-embedded-examples

A collection of example projects using Embedded Swift

1,045

stars

179

commits

Swift

primary language

Sep 15, 2026

updated

docs.swift.org/embedded/documentation/embedded
embedded
esp32
example
nrf
raspberrypi
stm32
swift

README

Embedded Swift Example Projects

This repository is a set of demonstration projects of Embedded Swift. Embedded Swift is a compilation and language mode that enables development of baremetal, embedded and standalone software in Swift. To learn more, see:

Building the examples

Each example in this repository contains build and deployment instructions, however there are a couple common steps needed for many of the examples included below:

  1. Install swift using the instructions here.

  2. Install uv, "an extremely fast Python package and project manager", using the instructions here.

Catalog of Examples

NamePlatformSDKDescriptionPhoto
esp32-led-blink-sdkESP32-C6-BugESP-IDF SDKBlink an LED repeatedly with Swift & the ESP-IDF.An ESP32-C6-Bug board with its onboard LED lit.
esp32-led-strip-sdkESP32-C6-DevKitC-1ESP-IDF SDKControl NeoPixel LEDs with Swift & the ESP-IDF.An ESP32-C6-DevKitC-1 board driving a lit WS2812 LED strip.
esp32-uart-echoESP32-C6ESP-IDF SDKUART echo example using Swift's print() and readLine().
harmonyRaspberry Pi Pico WPico SDKA bluetooth speaker and ferrofluidic music visualizer. Firmware, Electrical, and Mechanical designs fully available.The assembled Harmony Bluetooth speaker and ferrofluid visualizer.
nrfx-blink-sdknRF52840-DKZephyr SDKBlink an LED repeatedly with Swift & Zephyr.An nRF52840-DK board with its onboard LED lit.
nuttx-riscv-blinkQEMUNuttXBlink a virualized led in QEMU using the Apache NuttX RTOS
rpi-4b-blinkRaspberry Pi 4BNoneBlink the Pi's status green LED repeatedly using Swift MMIO.A Raspberry Pi 4B board.
rpi-5-blinkRaspberry Pi 5NoneBlink the Pi's status green LED repeatedly with Swift MMIO.A Raspberry Pi 5 board.
rpi-pico-blink-sdkRaspberry Pi Pico, Pico 2Pico SDKBlink an LED repeatedly with Swift & the Pico SDK.A Raspberry Pi Pico board.
rpi-pico-blinkRaspberry Pi PicoNoneBlink an LED repeatedly.A Raspberry Pi Pico board.
rpi-pico-lldbRaspberry Pi Pico, Pico 2NoneA tutorial project for debugging Embedded Swift with LLDB, containing bugs to find and fix.
rpi-pico2-neopixelRaspberry Pi Pico 2NoneControl Neopixel LEDs using the RP2350 PIO.A SparkFun Pro Micro RP2350 board with its RGB LED glowing red.
rpi-picow-blink-sdkRaspberry Pi Pico W, Pico 2WPico SDKBlink an LED to signal 'SOS' in Morse code repeatedly with Swift & the Pico SDK.A Raspberry Pi Pico W board.
stm32-blinkSTM32F746G-DISCONoneBlink an LED repeatedly.An STM32F746G-DISCO board with its onboard LED lit.
stm32-lcd-logoSTM32F746G-DISCONoneAnimate the Swift Logo on the built-in LCD.A Swift logo rendered on the STM32F746G-DISCO's onboard LCD panel.
stm32-lvglSTM32F746G-DISCOBaremetal setup of LCD, touch panel, DRAM, using the LLVM Embedded toolchain for ARM. Renders graphics, animations, and reacts to user input via LVGL. Includes a macOS/Linux SDL based host simulation app.An LVGL user interface running on the STM32F746G-DISCO's LCD.
stm32-neopixelSTM32F746G-DISCONoneControl NeoPixel LEDs using SPI.An STM32F746G-DISCO board driving a lit WS2812 NeoPixel LED strip.
stm32-uart-echoSTM32F746G-DISCONoneEcho user input using UART.A terminal echoing UART input from the STM32F746G-DISCO.

Note that the SDK integration examples (Pico SDK, Zephyr SDK, etc.) are not recommendations or endorsement, the same is true for build system choice (Make, CMake, SwiftPM, shell scripts). Embedded Swift aims to be versatile and allowing integration into existing SDKs and build systems, and the example projects show some of the possibilities.

Community Examples

[!WARNING] Community projects linked here are not officially supported by our team. They may not always be compatible with the latest nightly Swift toolchain builds.

NamePlatformDescription
swift-matter-examplesESP32An Embedded Swift Matter application running on ESP32-C6.
m5stack-nano-c6-bare-swiftESP32A baremetal Swift project for the M5Stack NanoC6 (ESP32-C6), running without any C, assembly, or ESP-IDF — pure Embedded Swift from bootloader to LED blink
swift-flipperzero-helloFlipper ZeroA demonstration of running Swift apps on the Flipper Zero.
EmbeddedSwift nRF52 ExamplesnRF52840 (Development Kit)A collection of examples using Embedded Swift on top of nRF Connect SDK (Zephyr).
SwataknRF52840 (Seeed Studio XIAO)A reaction time game inspired by BATAK© boards, implemented in Embedded Swift using nRF Connect SDK.
swift-picosystem-examplePicoSystemAn Embedded Swift demo running on the Pimoroni PicoSystem
pico-bare-swiftPicoBaremetal Raspberry Pi Pico examples in Embedded Swift — no Pico SDK required
CPicoSDKPico 2SwiftPM package that enables seamless Swift development for the Raspberry Pi Pico SDK
pico-swift-sh1106Pico 2Display Driver for SH1106
swift-st7789-lcdPico 2Display Driver for ST7789
PlaydateKitPlaydateA full featured framework for building Playdate games using Embedded Swift.
swift-playdate-examplesPlaydateAn Embedded Swift game running on Playdate by Panic.
swift-stm32c011-examplesSTM32Examples of running Embedded Swift on the STM32C011, which is a tiny MCU with only 6KB of SRAM and 32KB of flash.
flappy-swiftWebA WebAssembly game written in Swift in ~100 KB.
swift-for-wasm-examplesWebA "Swift Audio Workstation" example built with Swift for WebAssembly running in the browser using Embedded Swift.
swift-embedded-pebblePebbleAn example Pebble app for the Pebble Time 2, written in Embedded Swift.
swift-embedded-ndsNintendo DSNintendo DS homebrew written in Embedded Swift, ported from the official devkitPro examples.
swift-embedded-wiiNintendo WiiNintendo Wii homebrew written in Embedded Swift, ported from the official devkitPro examples.
swift-embedded-nintendo-64Nintendo 64Nintendo 64 homebrew written in Embedded Swift, using the original NuSys SDK and the newer and open source libdragon SDK.
swift-embedded-ps1Sony Playstation 1Playstation homebrew written in Embedded Swift, ported from PSn00bSDK examples.
Nanosaur2Nintendo 3DSPangea Software's Nanosaur 2 game ported to Nintendo 3DS using Embedded Swift.

Please note that the presence of community repositories and devices in this list does not constitute a recommendation or endorsement. If there's a project you'd like to see included here, please submit an issue with the details.

Contributing to this repository

This repository contains code that is not continuously developed, instead it's presented "as is" for educational and demonstrational purposes. Making major improvements to existing examples is discouraged, but additions of new examples is welcome.

Code of Conduct

Like all Swift.org projects, we would like these Embedded Swift example projects to foster a diverse and friendly community. We expect contributors to adhere to the Swift.org Code of Conduct.

Contact information

The current code owners of this repository are Kuba Mracek (@kubamracek) and Rauhul Varma (@rauhul). You can contact them on the Swift forums via the handles @kubamracek and @rauhul.

In case of moderation issues, you can also directly contact a member of the Swift Core Team.

See what people are saying

Contributors

(top 30 of 42)

rauhul

53 commits

kubamracek

26 commits

iCMDdev

8 commits

Languages

Swift

86.1%

C

8.1%

CMake

2.1%

Makefile

1.5%