Flashing Firmware via ST-Link/SWD: Recovery & Custom Builds
When You Need This (vs Normal Update)
Normal firmware updates go through qFlipper over USB — this SWD/ST-Link method is for two specific scenarios: recovering a genuinely bricked device that won't boot/enumerate normally at all, or flashing custom firmware builds that specifically require a full low-level flash rather than an over-the-air style update.
What You Need
- An ST-Link V2 programmer (cheap, widely available — genuine or clone both work fine for this)
- Jumper wires
- STM32CubeProgrammer software (free from ST's website) or OpenOCD if you prefer command-line tooling
Connecting to Flipper's SWD Pins
Flipper's SWD debug pins are exposed on the back GPIO header — check your firmware/hardware documentation for the exact pin mapping (SWCLK, SWDIO, GND, and 3.3V) since pin assignment has been consistent across most hardware revisions but it's worth confirming against current documentation before connecting, to avoid misconnection.
- ST-Link SWCLK → Flipper SWCLK
- ST-Link SWDIO → Flipper SWDIO
- ST-Link GND → Flipper GND
- ST-Link 3.3V → Flipper 3.3V (only if powering Flipper from the ST-Link during flashing — otherwise leave Flipper on its own power and just share GND)
Flashing Process (STM32CubeProgrammer)
- Open STM32CubeProgrammer, select ST-LINK as the connection type.
- Click Connect — it should detect the STM32WB55 chip Flipper uses and show its current flash contents/status.
- Load the firmware binary (.bin or .dfu file, depending on what your target firmware release provides) via the Erasing & Programming tab.
- Click Start Programming — this writes the full firmware image directly to flash, bypassing the normal bootloader update path entirely.
Recovery Scenario: Bricked Device
If Flipper won't boot or enumerate over USB at all (blank/frozen screen, no device manager entry), this SWD method is the actual recovery path — it writes directly to flash memory regardless of what state the existing firmware/bootloader is in, since it doesn't depend on the device's own USB stack being functional.
Custom Firmware Considerations
Popular custom firmware options (Momentum, Unleashed, RogueMaster) generally provide qFlipper-compatible update packages for normal installation — you'd only need the full SWD flash method for these if something's gone wrong with a normal update, or if you're doing firmware development work yourself and need to flash test builds directly.
Safety Note
A failed/interrupted flash via SWD can leave the device in a worse state than before if power is lost mid-write — use a stable USB connection and don't disconnect anything until STM32CubeProgrammer confirms the write completed successfully.
Related Guides
- How to Use the Flipper Zero GPIO for Hardware Hacking: UART, SPI, I2C, and Debugging
- Flipper Zero: Getting Started with BadUSB, Sub-GHz, and NFC
- Updating Flipper Zero Firmware and Installing Unleashed or RogueMaster
- Getting Started with Flipper Zero: The Complete Beginner Guide
- Building Firmware from Source: Toolchain & Compiling
- Debugging with a Debug Probe: JTAG/SWD Basics
- Writing Your First FAP App
- Building Your First Custom Flipper Zero App: ufbt Setup, GUI, and GPIO