Watasoge Building Log

Watasoge Building Log #2 — Hello Sound World

2026-02-12

To test so-called "vibe coding" during the firmware development for the STM32G431KB, the goal was to get the Nucleo board to generate a 440 Hz sine tone while blinking the onboard LED as a visible sign of life.

In short, it was a success. I (well, actually Claude Code with Opus 4.6) just got a microcontroller board (NUCLEO-G431KB) in combination with a DAC board (PCM5102) to output a 440 Hz sine tone through an audio cable to powered speakers.

In doing so, I (for the first time since I started programming microcontrollers) didn't use any manufacturer-provided configuration tools, nor any IDE as I normally would. Instead, I let Claude Code handle everything. Claude Code even told me how to wire it all up. I didn't touch a single line of code or a single configuration file.

Normally, firmware programming is quite fiddly. The whole Arduino environment only exists to make it a little less painful for beginners. For STM32 microcontrollers, ST provides a few graphical tools (e.g. STM32CubeMX) that let you click together the microcontroller configuration — the fine-tuning of the chip. That's also a tedious process with hidden menus and an endless number of values that need to be entered in the right places.

If you don't want to deal with the Arduino environment, you still have to configure your IDE and teach it that it's now dealing with something (from its perspective) as exotic as a microcontroller. That it needs to use different compilers, requires special configuration, etc.

This time, I just told Claude Code that I used to do it that way in the past, that it now has to take over the roles of both (ST configuration and IDE), that it should look at my machine and my projects, and that I'm now using a different microcontroller than before because it's better suited for signal processing.

Then it thought for about fifteen minutes and suggested blinking an LED as a first test, which worked right away. After that, it reprogrammed the microcontroller to generate a 440 Hz sine wave.

Five minutes later, the sine tone came out of the speakers connected to the audio jack of the Adafruit PCM5102 breakout board.

From my perspective, this is the next level.