Exploring Uncut - March 17th, 2025
Embedded Swift Community Hour
Last Friday, Rauhul organized an Embedded Swift Community Hour call on Discord, where members of the community interested in Embedded Swift gathered, presented their projects and talked about the future of this topic.
It was super interesting to virtually meet such a nice group of people, motivated to explore, share their findings and push the boundaries of Embedded Swift forward. I discovered super nice projects such as thelittlegame by Morten.
One of the core ideas of Swift is progressive disclosure — the ability to start simple but then progressively move to more complex projects without starting all over again.
We discussed how this is not currently true when targeting embedded platforms with Swift, the current hurdles that newcomers face, and the fact that the diversity of available platforms makes this even worse.
Starting up requires dealing with quite a few low-level concepts and working with C APIs. The true power of Swift only comes when you’ve created abstractions on top of those.
A few people, myself included, have created such abstractions and we discussed the challenge of sharing this code. We then extrapolated to how to potentially create a Swift based HAL.
Update 2025-03-18: For a more factual / in-depth recap of the meeting, check out Rauhul’s post: Embedded Swift Community Hour – March 14th, 2025 – Recap
Game follow-up
As I mentioned last week, I haven’t succeeded in connecting the Seeed Studio Round Display to the nRF 52840 DK. I did try two different SPIs, read some posts online, but quickly ran out of ideas on how to easily debug this with the information at hand. I thought maybe the easiest would be to check the SPI signals using a logic analyzer. As I don’t own one, I ordered a cheap one online and parked that problem for a bit.
Another aspect I wanted to explore for the game is using a joystick as input. I dug an old joystick from my Amiga times out of the attic, now all I needed was a way to connect it to my microcontroller board.
So I soldered a breakout cable to connect any old “DB-9 connector” joystick (such as used on the Commodore 64 and Amiga) to the nRF 52840 DK.

An old joystick connected to a nRF52840 DK board via a custom made breakout cable.
I then wrote a quick test program to detect the movements of the joystick and fire button presses and print information on the console. I’ll write a full article on this topic soon.
Down the rabbit hole
As indicated two weeks ago, I did not finish writing all I had been exploring in time for publishing the post, so I postponed writing about it until this week.
After publishing Addressing previous oversights, I noticed some other weird behavior in my code during further testing. Re-reading the post, I feel like I introduced more confusion than I clarified things and realized I do not grasp the subject as well as I wanted to.
Part of the issue, I think, is understanding how the reference vs value type dichotomy translates into heap vs stack allocations.
One might think the rule is simple: reference types are allocated on the heap and value types on the stack. But this is not true. I’ve tried conducting experiments with different code samples, just observing the output of print statements but I could not deduce any conclusive rules.
I’ve thought about several ways to get a better understanding, from using a custom build toolchain that I could run in a debugger (or simply adding some log statements in it at appropriate places) to looking at the final assembly code.
I’m wondering whether reading the generated SIL output would get me the information I want and would be the simplest option.
Anyway, these are all well beyond my comfort zone and I did not know exactly where to start to fill in the numerous gaps in my current knowledge.
So I searched for conference talks about SIL, as this is my preferred learning method. I have already watched
- 🖇 Introduction to Swift Intermediate Language — Alex Blewitt
- Conf42: Obscure Swift by Pawel Lopusinski
and I started watching 2015 LLVM Developers’ Meeting: J. seph Groff & Chris Lattner “Swift’s High-Level IR: A Case Study…" but that last one is a bit tough for a compiler newbie
I now need to put that into practice and look at some of the SIL code from my test projects. I’ll be sure to report further as I do that.
That’s it for this week, as always, feel free to get in touch on Mastodon, I’d love to hear your thoughts.