Embedded Swift Tutorial - Getting Started (Everything you need to know)
Apple announced Embedded Swift development at WWDC 2024. This new development target allows you to start coding for non-Apple hardware using Swift.
I took a deep dive into Embedded Swift this week and shared two videos to kickstart any Embedded Swift project at home.
Watch my Embedded Swift Tutorial - Getting Started with ESP32-C6 and ESP-IDF
In the tutorial, you will learn how to:
- Get started with Swift development on an ESP32 dmicrocontroller (System on a Chip - SoC)
- Install the Swift toolchain: Trunk Development - main (i.e., the latest experimental changes from Apple)
- Set up ESP-IDF (i.e., build tools for tiny microcontrollers)
- Install the C++ Matter SDK for HomeKit development
- Build and run Swift firmware on microcontrollers (ESP32)
These tutorials can help you jumpstart an adventure into hardware development.
Hardware Purchases
In Apple's WWDC video, they use the ESP32-C6 from Espressify: ESP32-C6-DevKitC-1-N8
It took me a while to find the one they were using, and I didn't see it until after I bought one.
Buy an ESP32-C6 microcontroller:
- ESP32-C6-DevKitC-1-N8 - pre-soldered pins
- Sparkfun ESP32-C6 Thing Plus (with Matter support for HomeKit)
Notes from my experience:
- The benefit of the ESP32-C6-DevKitC-1-N8 board is that the pins are pre-soldered, so you don't have to solder on male pins to connect it to a breadboard easily.
- Either ESP32-C6 board will work with a USB-C cable to power it for Embedded Swift development out of the box. (No batteries or power wiring required)
- You will only need to start investing in additional hardware when you want to connect to LEDs, motors, and sensors and create hardware circuits.
- Different ESP32 boards will have an RGB LED on different IO ports. So, you'll have to modify Apple's code accordingly.
I have used a soldering iron before, but it's been a long time, so if you've never done it, I'd recommend the one with pre-soldered pins.
I'm exploring LED connectivity, so you can see some of the parts that I have ordered on my Embedded Swift Amazon List.
Troubleshooting
If you get stuck with Apple's tutorial, please watch my troubleshooting video and read my other blog post of technical notes.
What hobby projects are you working on? Connect with me @PaulSolt on X.