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?

  • 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.

    Calculating the required routing space in my head, this solution will be larger than having just some tiny pads or vias for the SWD lines somewhere on each board.

    You will need some other test pads for any proper production testing anyway.

    we would have to send the final binaries to the manufacturer now and the firmware is not ready yet.

    Then just send them the Softdevice and OTA Bootloader. You can then update the firmware over thin air just before shipping off to the customer.

  • You can multiplex them, just make sure you switch both SWDIO & SWCLK.

  • Is it possible to share SWCLK and just multiplex SWDIO? I read in the ARM CoreSight spec that if the SW-DP detects activity on the clock without any movement on the SWDIO line, the debug interface will try to reset. I'm not sure about this though. Why did you say that both are needed?

  • A combination of both SWCLK & SWDIO sequence is required at initialization. Depending on the state of SWDIO and x clock pulses, it puts the DAP in certain state. It is not recommended to just switch SWDIO but you try it if you like.

    PS you can also use the IDAP-Link or IDAP-M for parallel programming of your boards.

  • Not sure it's going to work too well. Even if you have individual traces per board, you're going to have some fairly long lines. You'll have to route them to be about the same length and even then the stray capacitance on the longer ones is going to cause you at the least speed issues, at the worst, programming failures.

    I don't think muxing the SWDCLK is going to work. SWD v1 wasn't designed for that, again I think you'll run into capacitance issues pretty quickly apart from problems with multiple devices trying to respond. ARM designed SWDv2 multi-drop for sort of that and I can't find quickly in the spec how many devices are allowed to attach to SWD even there. And the nRFs don't support multidrop (don't know if anyone does). If they supported JTAG mode that would be a cool way to program lots of them, you could really set the whole array up as a big boundary scan chain, but they don't support that either.

    I've never come across anyone trying to do it this way, which makes me feel that .. there's always a better plan.

    You said the board is too small for a bed of nails. Even the tag-connect size with 3 holes (they're a pain) and 6 pads? I'd recommend trying that again and see if you can find a creative way to get them in.

    Last option I'd probably try if there really is no room is to panelize the boards with a strip of beds of nails between them, one per actual board (you should be able to pack those in), program the boards via their (personal) connector, then snap them off. You'll probably reduce your board count per panel that way because of the extra area, but you have the advantage that it will work, you don't need to make anything complicated to make it work and programming will be super quick. You'll have to work out the economies of getting fewer boards out of each panel and thus how much it'll cost per board to do this, I'd hope for a run of 5000 you'd be talking pennies per board, not insignificant for a kickstarter run, but if it gives you 100% programmability of every board on the panel using a simple method, it may be worth it to get it done.

    I reckon by the time you've done 5000 you'll be quite good at it :)

Related