Skip to content

Commit 1182a0c

Browse files
authored
article: update September 2025 (#552)
* article: Update Embedded Swift - September 2025
1 parent ccf0485 commit 1182a0c

File tree

2 files changed

+55
-36
lines changed

2 files changed

+55
-36
lines changed

content/blog/build-embedded-swift-application-for-esp32c6/build-swift-app-for-esp32c6.cast

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{"version": 2, "width": 255, "height": 61, "timestamp": 1718965392, "idle_time_limit": 1.0, "env": {"SHELL": "/bin/zsh", "TERM": "xterm-256color"}}
22
[0.027812, "o", "\u001b[?2004h\u001b[[email protected]\u001b[0m$ "]
3-
[0.05000, "m", "git clone [email protected]:apple/swift-embedded-examples.git --single-branch --branch main"]
3+
[0.05000, "m", "git clone [email protected]:swiftlang/swift-embedded-examples.git --single-branch --branch main"]
44
[0.05203, "o", "g"]
55
[0.075865, "o", "i"]
66
[0.099814, "o", "t"]
@@ -26,11 +26,11 @@
2626
[0.564281, "o", "o"]
2727
[0.589371, "o", "m"]
2828
[0.611776, "o", ":"]
29-
[0.635435, "o", "a"]
30-
[0.656095, "o", "p"]
31-
[0.679565, "o", "p"]
32-
[0.703565, "o", "l"]
33-
[0.726838, "o", "e"]
29+
[0.635435, "o", "sw"]
30+
[0.656095, "o", "i"]
31+
[0.679565, "o", "ft"]
32+
[0.703565, "o", "la"]
33+
[0.726838, "o", "ng"]
3434
[0.751309, "o", "/"]
3535
[0.776122, "o", "s"]
3636
[0.800796, "o", "w"]

content/blog/build-embedded-swift-application-for-esp32c6/index.md

Lines changed: 49 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: "Build Embedded Swift Application for ESP32-C6"
33
date: 2024-07-22
4+
lastmod: 2025-09-03
45
showAuthor: false
56
featureAsset: "img/featured/featured-espressif.webp"
67
authors:
@@ -33,40 +34,43 @@ Ensure you have the following hardware:
3334

3435
Before you begin, make sure you have the following:
3536

36-
- [ESP-IDF v5.3](https://docs.espressif.com/projects/esp-idf/en/release-v5.3/esp32/get-started/index.html): The official development framework for the ESP32, properly installed and sourced in your shell.
37-
- Swift 6 - nightly toolchain ([macOS download](https://www.swift.org/install/macos/#development-snapshots) / [Linux download](https://www.swift.org/install/linux))
38-
- Note: the article was written using Apple Swift version 6.0-dev (LLVM 3bba20e27a3bcf9, Swift 8e8e486fb05209f)
37+
- [ESP-IDF](https://docs.espressif.com/projects/esp-idf/en/stable/esp32/get-started/index.html): The official development framework for the ESP32, properly installed and sourced in your shell. This tutorial has been tested with ESP-IDF v6.0.
38+
- [Swiftly](https://www.swift.org/install/macos/#using-swiftly): The Swift toolchain installer and manager.
39+
- Swift 6.2 development snapshot (installed via swiftly).
40+
- Note: This article has been updated and tested with Swift 6.2-dev snapshot from August 2025.
3941

4042
### Building an Example Project
4143

4244
First, let's see the whole build process in Asciinema recording:
4345
{{< asciinema key="build-swift-app-for-esp32c6" cols="80" rows="24" poster="npt:0:08" >}}
4446

45-
1. **Clone Sample Project**:
47+
1. **Install Swift toolchain**:
4648

47-
Let's clone the project and configure `TOOLCHAINS` environment variable with the version of the installed Swift 6.
49+
First, install Swiftly by following the official installation guide at [swift.org/install](https://www.swift.org/install/), then install the Swift 6.2 development snapshot:
4850

51+
```bash
52+
# Install Swift 6.2 development snapshot
53+
swiftly install 6.2-snapshot
54+
```
4955

50-
{{< tabs groupId="config" >}}
51-
{{% tab name="macOS" %}}
52-
```shell
53-
git clone [email protected]:apple/swift-embedded-examples.git --single-branch --branch main
54-
#export TOOLCHAINS=org.swift.600202406111a
55-
export TOOLCHAINS=$(plutil -extract CFBundleIdentifier raw /Library/Developer/Toolchains/swift-latest.xctoolchain/Info.plist)
56-
cd swift-embedded-examples/esp32-led-strip-sdk
57-
```
58-
{{% /tab %}}
56+
2. **Clone Sample Project**:
5957

60-
{{% tab name="Linux" %}}
61-
```shell
62-
git clone [email protected]:apple/swift-embedded-examples.git --single-branch --branch main
63-
cd swift-embedded-examples/esp32-led-strip-sdk
64-
```
65-
{{% /tab %}}
66-
{{< /tabs >}}
58+
The repository contains two ESP32 examples. Let's use the LED strip example which demonstrates more advanced functionality:
59+
60+
```shell
61+
git clone https://github.com/swiftlang/swift-embedded-examples.git --single-branch --branch main
62+
cd swift-embedded-examples/esp32-led-strip-sdk
63+
64+
# Use the 6.2 snapshot for this project
65+
swiftly use 6.2-snapshot
66+
```
67+
68+
**Available ESP32 Examples:**
69+
- `esp32-led-blink-sdk`: Simple LED blinking example
70+
- `esp32-led-strip-sdk`: NeoPixel LED strip control example (used in this tutorial)
6771

6872

69-
2. **Set the Target**:
73+
3. **Set the Target**:
7074

7175
Ensure the correct target is set for your project:
7276

@@ -76,7 +80,7 @@ cd swift-embedded-examples/esp32-led-strip-sdk
7680

7781
Note: It's possible to build the project also for other RISC-V based targets, like ESP32-C3.
7882

79-
3. **Build and Flash the Project**:
83+
4. **Build and Flash the Project**:
8084

8185
Compile and flash your application to the ESP32-C6-DevKit:
8286

@@ -86,11 +90,9 @@ cd swift-embedded-examples/esp32-led-strip-sdk
8690

8791
Note: Use `Ctrl+]` to quit the monitor application.
8892

89-
Note: If the build fails with linking error, please follow instructions at [swift-embedded-examples repository](https://github.com/apple/swift-embedded-examples/issues/17#issuecomment-2174606877)
90-
9193
### Exploring the Example
9294

93-
Let's look at the source code of the example: [Main.swift](https://github.com/apple/swift-embedded-examples/blob/main/esp32-led-strip-sdk/main/Main.swift)
95+
Let's look at the source code of the example: [Main.swift](https://github.com/swiftlang/swift-embedded-examples/blob/main/esp32-led-strip-sdk/main/Main.swift)
9496
```swift
9597
//===----------------------------------------------------------------------===//
9698
//
@@ -140,11 +142,28 @@ The examples for ESP32-C6 could be easily simulated by Wokwi:
140142

141143
Embedded Swift even in **experimental** stage represents a significant advancement in bringing Swift's powerful features to embedded systems and constrained environments. By focusing on reducing runtime dependencies and optimizing code size, Embedded Swift allows developers to leverage Swift's modern programming paradigms even on MCUs.
142144

145+
## What's New Since the Original Article (Updated September 2025)
146+
147+
Since the original publication in July 2024, several important improvements have been made to the Embedded Swift ecosystem:
148+
149+
### Toolchain Management
150+
- **Swiftly Integration**: The recommended way to install and manage Swift toolchains is now through [Swiftly](https://www.swift.org/install/macos/#using-swiftly), which simplifies toolchain management significantly.
151+
- **Swift 6.2 Development**: The examples now work with Swift 6.2 development snapshots, providing access to the latest language features and improvements.
152+
153+
### ESP-IDF Compatibility
154+
- **ESP-IDF 6.0 Support**: The examples have been tested and work with ESP-IDF v6.0, which includes many improvements and new features.
155+
- **Updated Dependencies**: All component dependencies are automatically managed and updated to their latest versions.
156+
157+
### Repository Changes
158+
- **Organization Move**: The swift-embedded-examples repository has moved from `apple/swift-embedded-examples` to `swiftlang/swift-embedded-examples`.
159+
- **Documentation Improvements**: Enhanced documentation with better installation guides and troubleshooting information.
160+
143161
## Useful Links
144162

145163
- [WWDC24 - Go small with Embedded Swift](https://developer.apple.com/videos/play/wwdc2024/10197/)
146-
- [Embedded Swift Example Projects](https://github.com/apple/swift-embedded-examples/tree/main/esp32-led-strip-sdk)
147-
- [A Vision for Embedded Swift](https://github.com/apple/swift-evolution/blob/main/visions/embedded-swift.md)
148-
- [Embedded Swift User Manual](https://github.com/apple/swift/tree/main/docs/EmbeddedSwift/UserManual.md)
164+
- [Embedded Swift Example Projects](https://github.com/swiftlang/swift-embedded-examples)
165+
- [A Vision for Embedded Swift](https://github.com/swiftlang/swift-evolution/blob/main/visions/embedded-swift.md)
166+
- [Embedded Swift Documentation](https://www.swift.org/get-started/embedded/)
167+
- [Installing Embedded Swift](https://docs.swift.org/embedded/documentation/embedded/installembeddedswift/)
149168
- [Blog Post Introducing Embedded Swift Examples](https://www.swift.org/blog/embedded-swift-examples/)
150-
- [Swift Development Snapshots](https://www.swift.org/download/#snapshots)
169+
- [Swiftly - Swift Toolchain Manager](https://www.swift.org/install/macos/#using-swiftly)

0 commit comments

Comments
 (0)