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
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.