I want to ask how to implement programming or debugging interface for a MCU based device.

For example, I have created an ESP8266 based device using development board, everything is working fine and I have ordered a PCB for it. Then I need to flash the MCU over the wires, but for the first time only - afterwards I can use OTA flashing. However I want to have some interface in case things go south and I will need to re-flash it over the wires again. Or, another example, I want to build a small batch of devices (10-50) and flash all of them.

Placing pin header on the board is not good option - it takes some space and creates unneeded wiring. Soldering wires directly to the ESP module worked fine for me, but it is not good option in case of batch or LGA packages without exposed pins.

So, I want to ask - are there best practices for solving this problem?

  • 2
    \$\begingroup\$ This is both too opinion based and too broad to truly fit here, but the general topic has been covered many times before. There are various discrete and integrated spring pin solutions, additionally you can have a footprint where a header is soldered for development but spring pins used for production. \$\endgroup\$ – Chris Stratton Oct 28 '19 at 10:01

When you don't have space or budget to include a connector or pin header for programming, the usual solution is to create some small exposed copper areas ("test pads"), connected on the debug interface pins of the MCU, then build a test fixture that uses spring loaded pogo pins to make contact with these.

One easy solution I have used for this in the past is that from Tag Connect. They sell pre-made cables with a pogo pin assembly on the end, and they provide a PCB footprint you can put on your board design with test pads and locating holes. This saves you the trouble of building your own test fixture, whilst still avoiding the cost of a connector on your PCB.

If you don't have a place for even that sort of footprint, you will need to fit in the test pads you need wherever you can on the board, and build a bed-of-nails style test fixture, with a board containing pogo pins in the right positions so that they can push against your PCB in the right places. Typically this also needs some mechanical arrangement to help align and move the two together correctly.

| improve this answer | |
  • \$\begingroup\$ Thank you for the great explanation. That's exactly what I needed. \$\endgroup\$ – Andrey Ovcharov Oct 28 '19 at 20:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.