Close

Programming Esp32-C6-Bug with Swift (Language used to program Apple products)

A project log for Esp32-C6-Bug + Esp32-Bug-Eth

Playing with the new Esp32-C6FH4: https://www.crowdsupply.com/prokyber-s-r-o/esp32-c6-bug

allexokallexoK 06/26/2024 at 15:400 Comments

As you may have heard, Apple recently showcased Embedded Swift at WWDC24. So, I decided to give it a little test drive with the ESP32-C6-Bug. Just to mention, I have zero experience with Swift. It just sounded interesting, so why not?

The SDK is available from here

Before any programing can take place you need to install ESP-IDF (I used v5.2.1) and Swift nightly toolchain (I used swift-6.0 on Ubuntu 20.04). After updating my Cmake to 3.30 and setting the Swift path in .bashrc all I needed to do was to compile some example. The two examples available were this Led Strip example and Matter example. Since Esp32-C6-Bug currently has no Led strip integrated, I decided to make this simple Led blinking example, which is essentially just a wrapper around ESP-IDF functions:) One problem I run into was that Ubuntu was not recognizing ${SWIFTC} in CMakeLists.txt so I replaced it with 'swiftc' and everything compiled with no problem.

So overall, the results are good. The LED blinks, and I was surprised by how easy it was to make the wrapper! Doing the same thing for, let's say, MicroPython would be much more painful (IMHO).

Best regards,

Alex

Discussions