Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Comments on Need clarification on SWDIO/SWCLK length‑matching and “shielding” for STM32WBA5MMG debug connector

Parent

Need clarification on SWDIO/SWCLK length‑matching and “shielding” for STM32WBA5MMG debug connector

+2
−0

I am using the STM32WBA5MMG module in my design. The reference design is the MB2131 STM32WBA5M M.2 expansion board from ST (schematic), and the external debug connector sheet contains the note:

Specific constraints for SWDIO and SWCLK (must have same length and must be shielded).
[p.5 in the schematic ]

An excerpt of that schematic is attached, showing the STDC14 receiver connector and the SWD signals.

I have two questions:

SWDIO and SWCLK are single‑ended (not a differential pair), so why is explicit length matching between these two signals required on the PCB? Is this just to minimize clock‑to‑data skew at higher SWD clock frequencies, or is there another reason?

The note also says the lines “must be shielded”. Does this simply mean routing SWDIO and SWCLK over a solid ground plane (with a good reference return and maybe some ground stitching vias near the connector), or is a more specific shielding topology implied (e.g., guard traces, ground‑surrounded microstrip, etc.)?

Any guidance on how strictly these constraints need to be followed (for example, acceptable length mismatch on a short board and typical SWD clock speeds) would be appreciated.

schematic snippet of JTAG connector

History

1 comment thread

Quote the applicable sections (4 comments)
Post
+3
−0

This is senseless. They state these things because they expect you to run SWD at extreme speeds.

While some flavours of SWD may allow up to 50MHz something, there is no reason why you would ever want to run it that fast. There isn't nearly enough data present in the MCU that needs to be transferred at those speeds during debugging. As for production programming... how can programming a whole 256kib MCU in at most a few seconds be too slow? Equally senseless.

A couple of (2-3) MHz is just fine and then you need no matching or shielding at all, and you can keep the rectangular header/socket connectors. Just make sure to not use very long cables between your ICD adapter and the target. Some subjective rule of thumb is < 300mm.

That being said, the SWD connector should preferably be placed close to the MCU and the signal traces kept as straight as possible. EMI during programming/debugging does happen and you don't want that (for example crosstalk from SWD into some analog signal or whatever).

I've used many different Cortex M with SWD from all manner of manufacturers including a bunch of STM32. SWD signal layout was never an issue.


Other issues:

What might be an issue is that it is often stupid to expose these signals directly to an external connector where someone's fat fingers will cause ESD. The MCU may or may not have sufficient ESD protection, but you might not want to rely on that. If you aren't running SWD too fast then you can easily do some cheap fix like putting series resistors on all signals. The reset pin might be extra sensitive and might need external pull-up.

The major issue with the SWD standard otherwise is mechanical - the 1.27mm double row headers with ribbon cable connecting to it is pure trash, completely unsuitable for a debugging interface and even less so for production purposes. These aren't made to endure repeated connects, so the ribbon cable and everything else will break in no time, all the time. At least look at versions with mechanical strain relief (example) as a compromise.

History

2 comment threads

If double row headers with ribbon cables aren’t suitable for relatively frequent insertion and remova... (2 comments)
Thans of the detailed answer. Can I follow 3W rule for the spacing between SWD and SWCLK. (2 comments)
If double row headers with ribbon cables aren’t suitable for relatively frequent insertion and remova...
Carl‭ wrote 7 days ago

If double row headers with ribbon cables aren’t suitable for relatively frequent insertion and removal, what is then a good solution?

Lundin‭ wrote 6 days ago

Carl‭ Some connectors have specified number of operations even though that's rare. It is mostly the fine pitch in combination with no strain relief that makes it bad - a 2.54mm header strip does not have these problems at all and neither does the ribbon cable that goes with it, like the old JTAG 2x10 interface. The down side of that one is that it is really huge. But for SWD you only need five or so signals so a 2x3 2.54mm "box header" works out nicely.

Otherwise a mechanical solution with pogo pins or a card edge connector can be handy for production.