I was curious to see if I could add some Swift code to my colleague’s STM32 project. This was easy enough, but as a next step I wanted to make Swift concurrency work as well. I’m on Linux though, for which Swift doesn’t include any concurrency support for armv7em-none-none-eabi targets. After digging around for a while, I managed to compile an armv7em-none-none-eabi runtime that includes support for concurrency, and was able to use that in the project. Just like the project, the runtime is compiled against newlib.
Since the original project was proprietary, I’ve created an open-source version. It consists of an STM32CubeMX-generated project for the NUCLEO-F411RE development board, plus some Swift code that will blink an LED. The project includes a pre-built version of the armv7em-none-none-eabi runtime. In case anyone is interested, the project can be found here:
Note: I’m not familiar with STM32 and newlib, and only a little bit with CMake, so I probably made a few questionable choices.