AdvancedTopic 76 of 104Electronics & Embedded
Debugging tools
JTAG, SWD, logic analysers and oscilloscopes inspect running hardware.
In depth
JTAG/SWD provide breakpoints, single-step and memory inspection; logic analysers decode digital buses; oscilloscopes show analogue timing; serial logging and trace (ITM/ETM) help. Techniques: assert, binary search for faults, toggling a GPIO to time code.
Key points
- Hardware vs software breakpoints
- Heisenbugs
- Hardware in the loop
ExampleA logic analyser reveals an I²C NACK problem.
What is Debugging tools?
JTAG, SWD, logic analysers and oscilloscopes inspect running hardware.
Why is it important to understand debugging tools?
Debugging tools reveal what hardware and software actually do, which is essential when a bug only appears on real hardware.
What is the difference between JTAG and SWD?
JTAG uses more pins and a longer protocol, while SWD uses two wires and is common on ARM microcontrollers.
Why use a logic analyser rather than an oscilloscope?
A logic analyser captures many digital channels and decodes protocols, which is more efficient for digital timing and bus problems.
How is Debugging tools used in practice?
Typical applications include stepping through firmware with a JTAG or SWD debugger, capturing a bus signal with a logic analyser to check protocol timing and measuring a supply ripple with an oscilloscope during a fault.
What should I learn before Debugging tools?
Study "Watchdog timers" first (topic 75 of 104 in Electronics & Embedded). It covers the groundwork this topic builds on.
What are the key points of Debugging tools?
Hardware vs software breakpoints. Heisenbugs. Hardware in the loop.
Can you give an example of Debugging tools?
A logic analyser reveals an I²C NACK problem.
What comes after Debugging tools?
The next topic is "Real-time operating systems", which builds directly on this one.
How difficult is Debugging tools?
It is classed as Advanced in Electronics & Embedded (topic 76 of 104). It is an advanced topic. It assumes you are comfortable with the intermediate topics in Electronics & Embedded.