Describe the process of debugging a hard fault or a segmentation fault on an embedded target using a JTAG debugger.