Target Application Performs Reset (Cortex-M) - Segger J-Link User Manual

Hide thumbs Also See for J-Link:
Table of Contents

Advertisement

280
8.8

Target application performs reset (Cortex-M)

For Cortex-M based target CPUs if the target application contains some code that
issues a reset (e.g. a watchdog reset), some special care needs to be taken regard-
ing breakpoints. In general, a target reset will leave the debug logic of the CPU
untouched meaning that breakpoints etc. are left intact, however monitior mode gets
disabled (bits in DEMCR get cleared). J-Link automatically restores the monitor bits
within a few microsenconds, after they have been detected as being cleared without
explicitly being cleared by J-Link.
However, there is a small window in which it can happen that a breakpoint is hit
before J-Link has restored the monitor bits. If this happens, instead of entering
debug mode, a HardFault is triggered. To avoid hanging of the application, a special
version of the HardFault_Handler is needed which detects if the reason for the Hard-
Fault was a breakpoint and if so, just ignores it and resumes execution of the target
application. A sample for such a HardFault handler can be downloaded from the SEG-
GER website:
Fault handler".
J-Link / J-Trace (UM08001)
https://www.segger.com/downloads/appnotes
CHAPTER 8
© 2004-2017 SEGGER Microcontroller GmbH & Co. KG
Monitor Mode Debugging
"Generic SEGGER Hard-

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the J-Link and is the answer not in the manual?

This manual is also suitable for:

J-trace

Table of Contents

Save PDF