Site icon Idon Rpg

Apple’s Embedded Swift programming language supports ESP32-C6, Raspberry Pi RP2040, STM32F7, nRF52840 microcontrollers

Apple’s Embedded Swift programming language supports ESP32-C6, Raspberry Pi RP2040, STM32F7, nRF52840 microcontrollers

Apple has released a beta version of Embedded Swift that notably works with Espressif ESP32-C6 wireless RISC-V microcontroller, and the company also built a Matter sample based on ESP-IDF and ESP-Matter SDKs. Embedded Swift is not limited to the ESP32-C6 and supports other microcontrollers from STMicro, Raspberry Pi, Nordic Semi, etc…

Apple Swift programming language is mostly designed for mobile app development, but we’ve also seen it being used on Mad Machine’s SwiftIO board powered by a 600 MHz NXP i.MX RT1052 Arm Cortex-M7 crossover processor and the tiny SwiftIO Micro launched a few years later. The company has now decided to create a subset of the Swift programming language better suited to microcontrollers simply called Embedded Swift that’s currently working on STMicro STM32F746, Raspberry Pi Pico, nRF52840, and ESP32-C6.

ESP32-C6 Apple Embedded Swift

The “Go small with Embedded Swift” presentation at WWDC 2024 shows how to get started with Embedded Swift using Espressif Systems’ESP32-C6-DevKitC-1 development board running simple demos such as “Hello world” and changing color on a RGB LED up to a more complex demo using the Matter protocol for the Smart Home.

This is what the code for the RGB LED looks like:

It looks quite similar to C without the semi-colons… You’ll find the sample code for the Matter demo on GitHub, and additional Embedded Swift examples for ESP32-C6, STM32, RP2040, and nRF52840 in a separate repository.

Apple explains that Embedded Swift is a subset of the Swift programming language with a much smaller footprint (the binary can be around 10KB based on the diagram below). They’ve removed some features but added others needed for MCU-class hardware such as the ability to access memory-mapped registers through the Swift MMIO library. Support is provided through online forums.

I assume most developers already familiar with the ESP-IDF will ignore this news, but Swift mobile application developers may have a shorter learning curve with Embedded Swift than having to learn to use the ESP-IDF framework or Arduino programming. Note that Embedded Swift is still at the development stage, so you need to download snapshots of Swift to try it out since there’s no stable release just yet.

Embedded Swift enables a much smaller footprint.

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

link

Exit mobile version