Programming

12 articles

Drone

Anatomy of a flight controller target

How does one Betaflight binary run on hundreds of different boards? The answer is a single header file per board – a wiring diagram written in C. Here is a line-by-line walk through a real one, the RP2350-based HELLBENDER.

Jay ·
AI

Vibe debugging hardware: pointing an LLM at a logic analyser

Everyone is vibe coding. So can you vibe debug actual hardware – hand an LLM a logic-analyser capture or a register dump and let it reason about what the silicon is doing? I tried it on real DSHOT traces and RP2350 register dumps. The results were equal parts impressive and alarming.

Jay ·
AI

AI as a pair programmer for embedded: what actually helps

Is AI coming for the embedded engineer? I think that is the wrong question. Here is the honest, day-to-day version – where an LLM genuinely earns its keep on a real C firmware codebase, and where it falls flat on its face the moment hardware is involved.

Jay ·
Drone

Bidirectional DShot & RPM filtering, explained

We’ve talked a lot about DShot over the years – 150 through 1200, and even the SpiSHOT what-if. This is the chapter that ties it together: getting RPM telemetry back from the ESC on the very same wire, and using it to filter the gyro at exactly the right frequencies.

Jay ·
Drone

PIO: the RP2350’s Swiss Army peripheral

A flight controller needs more UARTs, motor outputs and timing-critical signals than the RP2350 has hardware for. PIO – the chip’s programmable I/O – quietly conjures the missing peripherals out of thin air. Here is how Betaflight uses it.

Jay ·
Drone

Visual Studio Code – Using Windows Subsystem for Linux

Previously I have utilised cygwin for the build process. With the widespread adoption of Windows 10, and its cool feature of Windows Subsystem for Linux (WSL) I thought I would add how I am using it here. So first things first. Install WSL. Plenty of literature on how to do that. I personally am using...

Jay ·
Drone

Visual Studio Code – Cortex-Debug

Getting started A new (or not so new) plugin for Visual Studio Code (VSCODE) is available that makes debugging the Cortex line of MCUs a breeze. It is called Cortex-Debug by Marcel Ball (Marus). The best thing about Cortex-Debug is it is OSS as well (Github Repo). For those who don’t know VSCODE is a...

Jay ·
Drone

Visual Studio Code – building and debugging Betaflight

Getting started Previously I have written about building and debugging using Visual Studio and the VisualGDB add-on for windows. This time around I have been able to get the Visual Studio Code – a free and opensource IDE – working with OpenOCD and the GNU ARM tool chain. First step is to download and install...

Jay ·
Drone

Smartport, Frsky XSR and Betaflight – part 2

A while back I wrote about how to modify the XSR (aka X4RS) to get at the non-inverted smartport signal so as to work with the STM32 F1 and F4 based flight controllers (F3, and F7 have the ability to invert serial communications built in). Well this is part two of that modification. The original...

Jay ·
Drone

Setting up VisualGDB for building Betaflight

VisualGDB is a powerful embedded add on for Visual Studio for developing for micro-controllers such as the ARM based STM32 series from ST Microelectronics. This post shows how to setup your environment for building the popular Cleanflight, Betaflight or Raceflight flight controller firmware for multi-rotors. Once setup building and debugging software for these micro-controllers gains...

Jay ·
Drone

Smartport, the FrSky XSR, and Betaflight

The Frsky XSR – also known as the X4RS (rev1) – is a new Receiver from FrSky that is super light and small, and gives you up to 16 channels for a drone. It uses the dreaded smartport for telemetry though as does all the X series from Frsky. This mod applies to X4R-SB also...

Jay ·