A new board is back from assembly. It is tempting to plug in the programmer and flash the firmware straight away. Before we do, we go through a short procedure – fifteen minutes that save burnt chips and hours of looking for a fault in the wrong place.
Below is how we bring up STM32 prototypes at RedCan. The examples use the STM32G0 family, but the same procedure works for STM32L4, G4 or F4 – the power-supply details that differ are noted in the text.
1. Before you apply power
The first stage is a visual inspection and “cold” measurements. The goal is to catch shorts, misplaced parts and assembly errors before anything heats up.
- Inspection under a magnifier or microscope – orientation of the microcontroller (pin 1 dot), regulator, diodes and polarised capacitors; solder bridges on fine-pitch pins.
- Resistance from each supply rail to GND – measure every rail separately: input, 3V3, VDDA, VBAT. Hundreds of ohms or more is typical (capacitors charge from the meter, so the reading rises). A few ohms means a short.
- STM32-critical parts – decoupling capacitors at every VDD pin, VDDA connected (even if the ADC is not used), 100 nF on NRST, a pull-down on BOOT0 (if the design uses it). On families with an internal core regulator (e.g. STM32F4, F7, H7) – VCAP capacitors with the value from the datasheet.
2. First power-on: a current-limited supply
We power the board from a bench supply with current limiting set – usually 50–100 mA for a board with just the microcontroller and a few peripherals. We raise the voltage gradually and watch the current. If the supply immediately goes into constant-current (CC) mode, we switch off and go back to the resistance measurements.
Once powered, we check:
- rail voltages (3V3, VDDA, VREF+) – with a multimeter right at the microcontroller pins, not at the connector;
- ripple at the regulator output – with an oscilloscope and a short ground spring on the probe;
- component temperature after 30–60 seconds – with a thermal camera or, at low voltages, at least a fingertip;
- the state of NRST (high, close to VDD) and BOOT0 (low when booting from flash).
3. Connecting over SWD
Programming and debugging use two lines – SWDIO and SWCLK – plus NRST and GND. The programmer (e.g. ST-LINK) also needs a reference voltage from the board (VTref/VAPP) to match logic levels. On our boards we use the 10-pin 1.27 mm Cortex Debug connector, or test pads for a Tag-Connect style cable where space is tight.
We make the first connection in STM32CubeProgrammer:
Connect under resetmode and a low SWD frequency (e.g. 100–500 kHz);- read the device ID and flash size – if they match, the connection works;
- check the option bytes: RDP protection level (should be 0) and, on STM32G0, the
nBOOT_SEL,nBOOT0andnBOOT1settings, which decide whether the BOOT0 pin is used at all; - flash a simple test program that blinks an LED and outputs the clock on the MCO pin – use the oscilloscope to check the HSE frequency and that the crystal starts at all.
RedCan checklist: first STM32 board bring-up
- Inspection: orientation of MCU, regulator, diodes and capacitors; no solder bridges.
- Resistance from input, 3V3, VDDA and VBAT to GND – no shorts.
- Decoupling at every VDD, VDDA connected, 100 nF on NRST, VCAP (if the family requires it).
- Current-limited supply, voltage raised gradually, current draw as expected.
- Voltages measured at the MCU pins, ripple checked on the oscilloscope.
- Component temperature checked after one minute.
- NRST high, BOOT0 low.
- SWD: VTref connected,
Connect under reset, low frequency, device ID read. - Option bytes: RDP = 0, boot configuration as designed.
- Test program: LED + clock on MCO, HSE frequency measured.
- Measurements recorded in the board bring-up report.
Example from the bench: a short you could not see
Symptom. A new controller board on STM32G0. STM32CubeProgrammer reports No STM32 target found. The supply, set to 3.3 V with a 100 mA limit, goes straight into CC mode and the voltage drops to about 0.2 V.
Measurement. With power removed, the resistance between the 3V3 rail and GND is 2.1 Ω – a short, not a load. Inspection showed no bridges at the microcontroller. To locate the fault, we fed a low voltage into the 3V3 rail with a 500 mA limit: the supply settled at about 1.05 V (consistent with R ≈ 2.1 Ω), dissipating about 0.5 W at the fault. After some seconds the thermal camera showed a spot about 15 °C above ambient – a 100 nF 0402 capacitor next to one of the VDD pins.
Cause and fix. With the capacitor removed, the rail resistance returned to a normal value, and the part itself turned out to be damaged (cracked). After replacing it, the board drew about 6 mA and the device ID read on the first attempt. In the next revision we moved capacitors further from the board edge, because cracks in ceramic capacitors often appear when the panel is depanelised.
Takeaway: the programmer’s message pointed to SWD, but the problem was in the power supply. That is why connecting the debugger is only the third step of our procedure.
When SWD will not connect – the usual suspects
| Symptom | What to check |
|---|---|
| The programmer does not see board voltage | VTref/VAPP wiring in the connector, board power. |
No target found although power is fine |
SWDIO/SWCLK swapped (mirrored connector footprint), no common ground, SWD frequency too high for a long cable. |
| Connects once, disappears after flashing | Firmware reconfigures PA13/PA14 as GPIO or puts the chip to sleep – use Connect under reset; enable debug in low-power modes in code (DBGMCU register). |
| The chip responds but memory cannot be read | RDP level 1 – removing protection erases the flash. |
| The chip keeps resetting | VDD below the BOR threshold, watchdog enabled in option bytes, wrong capacitor value on NRST. |
Related reading: HSE and LSE crystal selection and ADC measurement accuracy.
Further reading
- AN5096 – Getting started with STM32G0 MCUs hardware development (STMicroelectronics) – power, reset, clocks and boot on STM32G0. ST publishes equivalent “Getting started with … hardware development” notes for other families.
- AN4989 – STM32 microcontroller debug toolbox (STMicroelectronics) – debugging techniques and connection troubleshooting.
- STM32CubeProgrammer – programming, option bytes and memory readout.
- STM32 MOOCs from ST – official free online training.