Bokeh

Making sense of the mess in my head

  • Exploring Uncut - March 10th, 2025

    A bit of a social life Not much happened this week in terms of exploration. Being an introvert, I try to space out social events so I have time to recharge in between. This week was a bit of a failure on that front, with one concert, two family dinners, lunch with a friend, and a GeekClub meeting. You might be wondering—what exactly is GeekClub? I’ve been a CoderDojo coach for several years now.

    Read more…
  • Exploring Uncut - March 3rd, 2025

    Introduction I would like to publish more often on this blog. I really do. In fact, I have a long list of topics to write about. I even have several draft posts that I should just finalize and publish. One main issue is that, as I reread a post to put the finishing touches on it, I ask myself more questions. Is it totally exact ? Does it need more background information ?

    Read more…
  • Addressing previous oversights

    Introduction Back in November 2024, as I closed my Blink them to death using Embedded Swift presentation at Pragma Conf, I promised to release the source code of the 3 projects I presented before the end of the year. I thought this would be an easy goal to achieve and that I’d finish way sooner. Of course the projects had been prototypes so far, so I wanted to cleanup the code and recheck everything was working as expected.

    Read more…
  • Rolling back a brew formula

    Introduction I find Homebrew super convenient to install and keep up to date the large collection of tools I rely on. But sometimes, things do not work out the way you plan. Warning At the time of this writing, a malware site masquerading as the Homebrew site is being spread through Google Ads, see this post on X by Ryan Chenkie for more details. Some weeks ago, I was cleaning up the code for an Embedded Swift project before publishing it on GitHub, and as a last check, I wanted to verify everything still worked fine with the latest versions of the various components: latest Swift snapshot toolchain, nRF Connect SDK 2.

    Read more…
  • Timers in Swift on nRF52

    Introduction In this post, we’ll continue exploring Embedded Swift on an nRF 52840 dk, using the nRF Connect SDK. Our goal this time is to execute code after a certain delay, with optional periodic repetition. In Swift, one would typically use a Timer class to implement such a feature. Can we use that with Embedded Swift? Foundation Embedded Swift is really about the Swift language, and the language only includes the Swift runtime and the standard library, both having some limitations in Embedded Swift.

    Read more…
  • Randomness on nRF52 using Embedded Swift

    Introduction Randomness comes in handy in many different places. It’s useful in the logic of many games to make enemies behave in an unpredictable fashion, it can distribute the timing of events when used within a retry mechanism and random data is sometimes integral to AI algorithms. In this post, we’ll see how to generate random numbers in Embedded Swift on an nRF52840 DK using the nRF Connect SDK. Reading documentation The External dependencies section of the Embedded Swift — User Manual lists some external dependencies that need to be present at link-time, as the Swift standard library or Embedded Swift runtime might need to call them.

    Read more…
  • Creating a Swift type for button input on nRF52 - Part 2

    Introduction In the last post, Creating a Swift type for button input on nRF52 - Part 1, we worked on code to abstract interacting with a button in Swift code. We had a working prototype, but things fell apart as soon as we cleaned up the code and encapsulated it in a struct. Investigating the issue Let’s see if there’s valuable information in the documentation. /** * @brief GPIO callback structure * * Used to register a callback in the driver instance callback list.

    Read more…
  • Creating a Swift type for button input on nRF52 - Part 1

    Introduction In my previous post, Controlling an LED using Embedded Swift on nRF52, we created a Swift struct to encapsulate the C code required to control an LED. In this post, we’ll do the same for a button. If you want to follow along, the code is available on GitHub with each step having its own commit. Starting from working code As a starting point, we will write the whole code in C.

    Read more…
  • Controlling an LED using Embedded Swift on nRF52

    Introduction In my previous post, nrfx-blink Step by Step, I took you through the steps required to configure your development environment to build and flash the “Blinky” Embedded Swift example from Apple on an nRF52840 DK. In this post, we’ll explore that example more deeply, grow from there, and adapt it to be more natural for Swift developers. If you want to follow along, the code is available on GitHub with each step having its own commit.

    Read more…
  • nrfx-blink Step by Step

    Introduction When getting started with Embedded Swift, the examples published by Apple are really an incredible resource. However they’re just that — examples, right to the point and sometimes with minimal information. If you’re new to embedded development, you’ll need to do some additional digging (which isn’t too bad, that’s how you learn). Embedded Swift development is very specific to the chipset that you’re targeting. As you can see, there are several examples in the repository, targeted at different boards and using different options (bare metal vs SDK/RTOS).

    Read more…