All jobs / Embedded / hardware / Debugging
Embedded / hardware interview question · 0–1 years
What is SWD, and how does it differ from JTAG?
The strongest answer
Both let a debugger halt the core, step, set breakpoints and read memory. SWD does it over two pins; JTAG uses four or five and also gives you boundary scan and a chain of devices
Why it works
Right — on a pin-tight board SWD is the usual pick, and what you give up is boundary scan and the chain.
What a good answer covers
- Same debug job, different pin count.
- SWD: two pins, plus optional trace out.
- JTAG: four or five, plus boundary scan.
- Check voltage and protocol before probing.
Answers that fall short
- Close, but not the strongest: SWD is the two-wire debug interface on ARM parts, and JTAG is the older one with more pins
True as far as it goes; say what each one buys you, since both do the same core debug job. - Weak: SWD is for programming the chip and JTAG is for debugging it while it runs
Both do both. The real difference is pin count and the extra test features JTAG carries. - Red flag: They are just the connector; any probe works with any pinout as long as it physically fits
Interface, voltage and protocol all have to match; forcing a probe onto the wrong pinout damages boards.
Who gets asked this
More Debugging questions
- A bug vanishes when you add printf. What did you learn?
- When do you reach for a logic analyser, and when for an oscilloscope?
- HardFault on Cortex-M. What do you capture before you “add a print”?
- What should a field build do on a failed assert?
- Datasheet says 400 kHz I2C; the line looks filthy at 100. What wins?
- A struct field changes value minutes into a run, and nothing in the code writes to it. How do you find the…
- What do you log in the field when flash is tiny?
- A fleet starts resetting in the wild. First staff hour?