Spent two evenings poking at my first home-built ESC and the programmer just would not see the chip. Every rail measured right at 3.3V, and the same setup worked instantly on a spare dev board, so I was half convinced I had cooked the MCU with the soldering iron. Turns out I mirrored the programming header when I laid out the board, wich crossed the two debug lines. Two bodge wires to the correct pads later, it connected on the first try. Felt pretty dumb, but at least the silicon is alive. While I was in there I also learned that connect-under-reset matters once real firmware is loaded. The blank chip attached fine either way, but after a bad flash it would only come back if I held the reset line low and told the tool to attach that way. So yes, wire NRST to the header even if you swear you will never need it. Board spins a motor now. Just needs the timing tuned before I trust it on anything with props attached.
Found the reason my first ESC board refused to connect to the programmer
Oct 10, 2026
Last reply: 47 seconds ago
5 Replies
Same relief here with a board I did last winter. Mine was a small BLDC driver on the F031 and the ST Link refused to see it even though the rails were fine and a known good board attached straight away. I must have reflowed that QFP three times thinking my joints were cold. Turned out a hairline solder bridge between the two debug pins was pulling one of them down. A continuity beep between adjacent pins found it in about a minute once I stopped blaming the chip, and a drag of the iron with some flux cleared it. That was my third board hand soldering those fine pitch parts and I have since made the continuity sweep part of my routine before first power up.
The reset trick saved me too. After a flash with bad clock settings the chip would not attach normally at all, but holding reset and using connect under reset got me back in to wipe it. Since then every board I lay out gets the reset pin on the header, even the tiny ones where I am desperate for pads.
Good luck with the timing. On mine the commutation advance needed a lot less than I expected and the motor ran noticeably cooler once I backed it off.
I went the other direction on my own boards and stopped wiring the reset pin entirely. Instead I put the boot pin on a little solder jumper, so if a chip ever stops talking I can set the jumper, power cycle, and get in thru the serial bootloader with a cheap USB-serial dongle. Saved me last summer on a small driver board where I flashed a clock setting that bricked the debug port. Five minutes with the dongle and it was back, no bodge wires needed. It is slower than a proper debug connection and you cannot single-step code that way, but on a cramped layout it is one less pin to route, and the same two wires do double duty later for printing debug messages out of the firmware. For something like an ESC where you mostly want to watch motor output anyway, that trade works out fine for me.
One thing that bit me early on: a floating boot pin can make the chip wake up in the wrong mode and look exactly like a dead or unprogrammable part, rails all healthy and everything. A weak pulldown on that pin is now on every board I draw, even the quick ones.
Good luck with the timing. I found small increments and a current meter in line with the battery told me more than any scope trace did.
Long bodge wires on the debug lines can be thier own headache, by the way. If it ever gets flaky again, drop the programmer clock way down in the settings and it usally attaches fine. I also keep an old 10k pull-up on SWDIO on my layouts, learned that after a floating line gave me a week of grief back around 2011. Funny reading about the boot jumper, becasue before SWD was a thing we were all flashing through the bootloader with a max232 on a bit of stripboard, and half of us never gave that up. Six months from now when the ESC misbehaves mid-tune, that serial way in will look pretty tempting.
Been burned by mirrored headers myself, though mine was a motor controller on an F0 a couple years back. What finally caught it was holding the actual programmer header up against the silkscreen on the board before plugging in. Pin one marked on one, not the other, and I had flipped the whole footprint in the CAD without noticing. Now I print the layout at actual size on paper and physically touch the connector to it before sending the board off. Costs nothing and it has caught two footprint flips since.
Adding one from my side: on my ESC board the programmer would connect fine til the motor supply was hooked up, then it would drop out mid flash. The big filter caps were pulling the rail around during inrush and browning out the chip. Once I left the power stage unplugged and flashed on just the logic rail, it behaved. So if yours gets flaky later, try flashing with the motor side disconnected.
On the timing, are you running sensorless off the back emf? Mine would only behave after I shifted the zero cross detection point, took a few evenings of trial and error with the motor on a test stand before I dared spin it loose.
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required