Enable Monitor Debugging - Segger J-Link User Manual

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

Advertisement

8.2

Enable Monitor Debugging

As explained before, by default J-Link uses halt mode debugging. In order to enable
monitor mode debugging, the J-Link software needs to be explicitly told to use moni-
tor mode debugging. This is done slightly differently from IDE to IDE. In general, the
IDE does not notice any difference between halting and monitor debug mode. If J-
Link is unable to locate a valid monitor in the target memory, it will default back to
halt mode debugging in order to still allow debugging in general.
In the following, some examples on how to enable monitor mode debugging for dif-
ferent IDEs are given:
8.2.1
GDB based debug solutions
For GDB based debug solutions there is a .gdbinit file which contains commands that
can be executed by GDB / GDBServer. In this .gdbinit file the following line needs to
be added to enable monitor mode debugging (Second command only needed in case
of monitor interrupt forwarding, see Forwarding of Monitor Interrupts on page 279):
monitor exec SetMonModeDebug = 1
monitor exec SetMonModeVTableAddr = <Addr>
8.2.2
IAR EWARM
In IAR EWARM there are so-called macro files available to customize certain opera-
tions. In this file, the following function with the following line needs to be present
(Second line only needed in case of monitor interrupt forwarding, see Forwarding of
Monitor Interrupts on page 279):
/*********************************************************************
*
*
execUserSetup()
*
*
Function description
*
Called once after the target application is downloaded.
*
Implement this macro to set up the memory map, breakpoints,
*
interrupts, register macro files, etc.
*/
execUserSetup() {
__message "Macro-execUserSetup(): Enabling monitor mode";
__jlinkExecCommand("SetMonModeDebug = 1");
__jlinkExecCommand("SetMonModeVTableAddr = <Addr>");
}
The macro file also needs to be selected to be used in the project:
J-Link / J-Trace (UM08001)
© 2004-2017 SEGGER Microcontroller GmbH & Co. KG
273

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?

Questions and answers

This manual is also suitable for:

J-trace

Table of Contents

Save PDF