Wednesday, February 1, 2023

SWD vs JTAG and the use of semihosting

  • JTAG (Joint test access group interface) [4] and SWD (Serial wire debug) [5] are interfaces used to connect to a remote embedded processor for debugging and tracking execution. 
    • SWD is a 2 wire interface which is ARM specific, while JTAG is used more widely in the industry. 
    • JTAG supports boundary scan [5] a mechanism used to inspect IC pin states and measure voltages.
  • Semihosting [1] is a way by which a target device connected via a JTAG or SWD interface can use a remote hosts (e.g. a laptops) keyboard and console. This is enabled via a C library compiled with the target's code that allows the injection of breakpoints when these inputs or outputs are required and allows communication with the remote host via a debugger interface (JTAG/SWD) [2].
  • Debugging or printing is usually slow with the JTAG interface because the clock speed is slow on those lines [3].
labels: embedded development, semihosting, SWD, JTAG interface, debugging, TLDR, Summary

References
[1] Semihosting - The ARM guide
[2] Semihosting ARM interface