The completed oscilloscope in parts, with the screen in the front connected with prototyping wires, protoboarded buttons on the right, and the BlackPill board somewhere behind

DIY STM32 Scope Is Simple, Cheap, And Featureful

Would you like to have a small digital oscilloscope? Do you have a spare BlackPill (STM32F401) board and a TFT display laying around? [tvvlad1234] presents us with a simple and educational digital storage oscilloscope design that barely needs any components for you to build one, and it’s packed with features just like you would expect from a self-respecting open-source project. Not just that — it can even stream data to your computer, in a format compatible with the TekScope software!

The same scope design, but now on a self-etched boardIt’s hard to overshadow just how easy this scope is to build, use, and hack on. You really don’t need much in the way of parts, a protoboard will do, though you can also etch or order your own PCBs. The front-end is super straightforward to find components for and assemble, a few opamps and resistors is all you need. So after jumper-wiring the LCD and three push buttons to your BlackPill, you’re golden.

Of course, the simple frontend results in the input range being from -3.3 V to 3.3 V, but as you could guess, this is exactly the kind of project where you could tweak the resistors and even upgrade it later on. Are you a bit lost in how oscilloscopes work? [tvvlad1234] has an explainer for you, too!

This build could easily take up a honorary “temporary turned permanent” place on your bench, thanks to its McGyver-esque qualities. It’s also, quite possibly, a better scope than the red “soldering kit” ones we’ve seen online. All in all, it’s a strong contender in the “simple and powerful DIY scope” arena, before this, we’ve seen one built with an Arduino Nano, and one with a Pi Pico.

Dumping script window, showing the bytes being dumped one by one from the STM chip

Need To Dump A Protected STM32F0x? Use Your Pico!

Sometimes, security mechanisms can be bypassed if you just do things slightly out of the ordinary. For instance, readout protection on microcontrollers is a given nowadays, to the point where it’s intentionally enabled and relied upon as a major technical measure to protect intellectual property. The gist is — when you connect to a microcontroller over its debug interface and then ask to read its flash memory, it will politely refuse. However, [Racerxdl] shows us that in practice, it’s not flawless protection – for certain chips, you just need to be a little quicker than usual.

Usually, flashing and debugging software will chat with the microcontroller for a bit, and probe parameters before going for any direct requests. However, if you skip the courtesy and bluntly get to the point immediately right after power is applied to the microcontroller, you can intimidate them just enough to give you one byte of its memory before it refuses to cooperate further. Since that can be any byte you wish, you can read the entire flash — one byte at a time.

You need to power cycle the chip before you can progress, so the hardware does involve a bit more than just an SWD interface, and it will take a fair bit more time than reading out a non-protected chip the usual way; plus, of course, the debugging interface needs to be active for this in the first place, which isn’t always the case. However, it still beats paying a few thousand dollars for a factory in China to decap your chip and read it out using a fancy machine.

[Racerxdl] didn’t just write a proof-of-concept for this attack – they implemented it for one of our favourite chips, the RP2040. As such, you no longer need an unobtainium STM32 to dump an unobtainium STM32.

To be clear, [Racerxdl] didn’t design this attack — it’s been around for some time now. Credit for that goes to Johanes Obermaier. All in all, this is a wonderful reminder that seemingly reliable security mechanisms can be foiled by the simplest tricks. For instance, if your chip erases the flash when you unlock its protection, you can just tell it not to.

DIY Macro Keyboard Wood Be Nice

Editing video tends to involve a lot of keyboard shortcuts, and while this might be fine for the occasional edit, those who regularly deal with video often reach for a macro pad to streamline their workflow. There are plenty of macro keyboards available specifically meant to meet the needs of those who edit a lot of video, but if you want something tailored for your personal workflow you may want to design your own keyboard like this wooden macro pad from [SS4H].

The keyboard itself is built around an STM32 microcontroller, which gives it plenty of power to drive and read the keyboard matrix. It also handles an encoder that is typically included on macro keyboards for video editing, but rather than using a potentiometer-type encoder this one uses a magnetic rotary encoder for accuracy and reliability. There’s a display built into the keyboard as well with its own on-board microcontroller that needs to be programmed separately, but with everything assembled it looks like a professional offering.

[SS4H] built a prototype using 3D printed parts, but for the final version he created one with a wooden case and laser etched keys to add a bit of uniqueness to the build. He also open-sourced all of the PCB schematics and other files needed to recreate this build so anyone can make it if they’d like. It’s not the only macro keyboard we’ve seen before, either, so if you’re looking for something even more esoteric take a look at this keyboard designed to be operated by foot.

Continue reading “DIY Macro Keyboard Wood Be Nice”

Beat Backing Box For Bassists

The soul of a rock band is its rhythm section, usually consisting of a drummer and bass player. If you don’t believe that, try listening to a band where these two can’t keep proper time. Bands can often get away with sloppy guitars and vocals (this is how punk became a genre), but without that foundation you’ll be hard pressed to score any gigs at all. Unfortunately drums are bulky and expensive, and good drummers hard to find, so if you’re an aspiring bassist looking to practice laying down a solid groove on your own check out this drum machine designed by [Duncan McIntyre].

The drum machine is designed to be as user-friendly as possible for someone who is actively playing another instrument, which means all tactile inputs and no touch screens. Several rows of buttons across the top select the drum sounds for the sequencer and each column corresponds to the various beats, allowing custom patterns to be selected and changed rapidly. There are several other controls for volume and tempo, and since it’s based on MIDI using the VS1053 chip and uses an STM32 microcontroller it’s easily configurable and can be quickly interfaced with other machines as well.

For anyone who wants to build their own, all of the circuit schematics and code are available on GitHub. If you have an aversion to digital equipment, though, take a look at this drum machine that produces its rhythms using circuits that are completely analog.

Continue reading “Beat Backing Box For Bassists”

Nucleo-F429ZI development board with STM32F429 microcontroller

Epic Guide To Bare-Metal STM32 Programming

[Sergey Lyubka] put together this epic guide for bare-metal microcontroller programming.  While the general concepts should be applicable to most any microcontroller, [Sergey]s examples specifically relate to the Nucleo-F429ZI development board featuring the ARM-based STM32F429 microcontroller.

In the realm of computer systems, bare-metal programming most often refers to programming the processor without an intervening operating system. This generally applies to programming BIOS, hardware drivers, communication drivers, elements of the operating system, and so forth. Even in the world of embedded programming, were things are generally quite low-level (close to the metal), we’ve grown accustomed to a good amount of hardware abstraction. For example, we often start projects already standing on the shoulders of various libraries, boot loaders, and integrated development tools.

When we forego these abstractions and program directly on the microprocessor or microcontroller, we’re working on the bare metal. [Sergey] aptly defines this as programming the microcontroller “using just a compiler and a datasheet, nothing else.” His guide starts at the very foundation by examining the processor’s memory map and registers including locations for memory mapped I/O pins and other peripherals.

The guide walks us through writing up a minimal firmware program from boot vector to blinking an LED connected to an I/O pin. The demonstration continues with setup and use of necessary tools such as the compiler, linker, and flasher. We move on to increasingly advanced topics like timers, interrupts, UART output, debuggers, and even configuring an embedded web server to expose a complete device dashboard.

While initially more time consuming, working close to the metal provides a good deal of additional insight into, and control over, hardware operations.  For even more on the subject, you may like our STM32 Bootcamp series on bare-metal STM32 programming.

A Gaggia classic espresso machine with an LCD screen attached to the top, sitting on a table with vase of yellow lily flowers to its left and sunlight coming in from a window from the right.

Homebrew Espresso Maker Modding With Gaggiuino

For those that don’t know, Gaggia is a company that produces a line of affordable “entry-level” espresso coffee makers that offer good quality consumer espresso machines at reasonable prices. The entry level machines don’t offer fine grained control over temperature, pressure and steam which is where the Gaggiuino project comes in.

A schematic of the Gagguino project

The Gaggiuino project is an “after market” modification of many espresso makers, such as the Gaggia classic and Gaggia classic pro. The main additions are a MAX6675 thermocouple module paired with a K-Type thermocouple sensor for closed loop control over the temperature. Options for adding an AC dimmer module that attaches to the pump motor and a 0 Mpa to 1.2 Mpa ranged XDB401 pressure sensor, installed in line between the pump and the boiler, provide further closed loop control over the pressure and flow profiling.

Load cells can be attached to the drip tray to allow for feedback about the pour weight with a Nextion 2.4″ LCD touchscreen provides the user interface for profile selection and other interactivity. The project offers a “base” modification using an Arduino Nano as the microcontroller, in line with its namesake, but has an option for an STM32 Blackpill module that can provide more functionality beyond the scope of the Nano.

The Gaggiuino project is open source with code and extensive documentation available on GitHub. There is also a Discord community for those wanting help with their build or that have the inclination to share their passion for DIY espresso modding with the Gaggiuino. Espresso machine hacks are a favorite of ours and we’ve featured many projects on espresso machine builds and mods ranging from PID control of classic espresso makers to beautifully minimal closed loop homebrew espresso machines.

Continue reading “Homebrew Espresso Maker Modding With Gaggiuino”

Bare-Metal STM32: Setting Up And Using SPI

The Serial Peripheral Interface (SPI) interface was initially standardized by Motorola in 1979 for short-distance communication in embedded systems. In its most common four-wire configuration, full-duplex data transfer is possible on the two data (MOSI, MISO) lines with data rates well exceeding 10 Mb/s. This makes SPI suitable for high-bandwidth, full-duplex applications like SD storage cards and large resolution, high-refresh displays.

STM32 devices come with a variable number of SPI peripherals, two in the F042 at 18 Mb/s and five in the F411. Across the STM32 families, the SPI peripheral is relatively similar, with fairly minor differences in the register layout. In this article we’ll look at configuring an SPI peripheral in master mode.

Continue reading “Bare-Metal STM32: Setting Up And Using SPI”