This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Multiplexing SWDIO/SWCLK to program panels in production - Why is it a bad idea?

Hello,

I've been researching how to go about programming our devices on the production line. Most of the threads I've seen suggest two options: either to order them pre-programmed or to use several flashers connected to a PC (or use that solution that works with microSD cards).

The first suggestion is not an option for us, we have to produce about 5000 pieces that need to be delivered to Kickstarter backers and if we want to meet our deadline we would have to send the final binaries to the manufacturer now and the firmware is not ready yet. For mass production, we will probably use this option but not right now.

The second option is to use a flasher per device (could be one per 8 or so, depending on the capabilities of the flasher), but we don't have space in the PCB to use a bed of nails or something like that to connect them directly to each device.

One choice would be to draw traces from the SWD pins out to the panel and connect them there. I read in another post asking the same question that this not a good idea at all because the traces might get shorted when the devices are depanelized.

Our panel will have 40 to 50 boards and the PCB has 4 layers. We are planning to use a single J-Link and multiplex the SWD lines to program one device at a time. We would draw the SWD lines from one of the inner layers of the PCB so we doubt we would have problems with traces being shorted when cut.

So my question is: Why is such a bad idea to multiplex the SWD to program a single device at a time?

  • You're funny... OTA Firmware update on 5000 devices "just" before shipping? :-D The jumper cables from any bed of nails setup to the JLINKs would be just as long as the traces... and the traces can be on unused areas of the panel, and on inner layers of the 4 layer PCB, whereas the pads have to be on the top or bottom of each device...

  • Like I said in another comment: The jumper cables from any bed of nails setup to the JLINKs would be just as long as the traces... (and on the PCB, you could surround them with a ground plane...) But I like the idea of moving the "connector" (large enough testpads for bed of nails) to unused panel space, outside of the individual pcb area... nonetheless, whether bed of nails or another method, the question is still valid: to program 50 devices, you still need either 50 J-links or multiplex SWD lines somehow. Muxing any data-line should be no problem - multidrop on swd is not muxing, but rather having all devices connected to the same two swd lines, and the devices figure out which one is supposed to be programmed now... as far as I understood, the question is about whether muxing just one of the lines (swdio OR swdclk) is enough (and which is better), or if both have to be muxed...

  • you've misunderstood much of what I suggested. I'm not suggesting muxing anything, I don't think it will work to mux even swdclk over more than a few devices because you'll run into capacitance issues. I know what multidrop is and how it works, but even the spec for multidrop doesn't say how many devices can be connected (not that I've found) and anyway nothing supports it. The SWD v1 spec specifies one device per swdclk/swdio line pair.

    I suggest having one single bed of nails per device on thin strips around the actual devices which can be broken off after use. You don't need 50 jlinks, you need one, or two, or three, you just go from bed to bed and program each device. It's slow but it works. The more jlinks you have, the faster you get it done. One guy does one panel, someone else does another.

    No muxing at all.

  • Hmm, OK... too bad, since the question was all about Muxing ;-) Yeah, I haven't seen anything that supports multidrop either... - Lets assume trace lengths of less than 10cm with adequate trace width on an inner layer, with a ground plane on top/bottom to shield them. What would be the problem with a couple of 8:1 Mux/demux chips that would switch between the 40-50 pairs of swd lines to the single pair coming from the J-link? It would essentially (theoretically) be the same as disconnecting the swd lines from one device and connecting it to the next... except you could do that programatically than physically, saving huge amounts of time (money) in production... The question remains whether it's enough to switch just one - either swdio OR swdclk, or if both have to be switched...

  • why bother - compared to adding mux chips, board area is (relatively) cheap. Remember this is for an initial production run of 5000 so something easy cheap and inefficient may (their choice) be preferable over something which requires coding and chips and more setup Assuming the board is fully populated, the cost of having a couple in the middle you can't program because your mux system was too complicated likely outweighs the cost of extra board to give each instance a snapoff programming stub.

    There is another option of course. If they quickly put together a blinky + bootload + softdevice + DFU package (which is pretty much available right out of the SDK), that could go to the factory NOW for gang programming. Then they get boards which have flashing lights to check them and they can OTA them with the final software. That costs nothing.

Related