This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Monitor Mode Debug still hits NRF_BREAKPOINT_COND

My environment is:

Windows 7

JLink Plus v9.3

IAR EWARM 8.30.1

SDK 15.0.0

Softdevice S132 from SDK 15.0.0

My hardware is a custom board with a Rigaldo BMD300 module (contains the nRF52832) and a few SPI-to-UART bridges.

I have monitor mode debugging enabled but I still hit the NRF_BREAKPOINT_COND in the app_error_fault_handler() sometimes.  The J-LINK RTT Viewer shows monitor mode enabled:

LOG: J-Link RTT Viewer V6.34f: Logging started.
LOG: Terminal 0 added.
LOG: Device "NRF52832_XXAA" selected.
LOG: ConfigTargetSettings(): Enable Monitor Mode Debugging
LOG: Found SW-DP with ID 0x2BA01477
LOG: Found SW-DP with ID 0x2BA01477
LOG: Scanning AP map to find all available APs
LOG: AP[2]: Stopped AP scan as end of AP map has been reached
LOG: AP[0]: AHB-AP (IDR: 0x24770011)
LOG: AP[1]: JTAG-AP (IDR: 0x02880000)
LOG: Iterating through AP map to find AHB-AP to use
LOG: AP[0]: Core found
LOG: AP[0]: AHB-AP ROM base: 0xE00FF000
LOG: CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
LOG: Found Cortex-M4 r0p1, Little endian.
LOG: FPUnit: 6 code (BP) slots and 2 literal slots
LOG: CoreSight components:
LOG: ROMTbl[0] @ E00FF000
LOG: ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
LOG: ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
LOG: ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
LOG: ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
LOG: ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
LOG: ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
LOG: RTT Viewer connected.

All I did to enable monitor mode was add the three files (JLINK_MONITOR.c, JLINK_MONITOR.h, and JLINK_MONITOR_ISR_IAR.s) and added a JLinkScript file to the project directory where EWARM creates the .jlink file.  The JLinkScript file is:

/*********************************************************************
*               (c) SEGGER Microcontroller GmbH & Co. KG             *
*                        The Embedded Experts                        *
*                           www.segger.com                           *
**********************************************************************

-------------------------- END-OF-HEADER -----------------------------

File    : EnableMonitorModeDebugging.JLinkScript
Purpose : Enable Monitor Mode Debugging
Literature:
  [1]  J-Link User Guide (UM08001_JLink.pdf), chapter "Monitor Mode Debugging"

*/

/*********************************************************************
*
*       Constants (similar to defines)
*
**********************************************************************
*/

/*********************************************************************
*
*       Global functions
*
**********************************************************************
*/

/*********************************************************************
*
*       ConfigTargetSettings()
*
*  Function description
*    Called before InitTarget(). Mainly used to set some global DLL variables to customize the
*    normal connect procedure. For ARM CoreSight devices this may be specifying the base
*    address of some CoreSight components (ETM, �) that cannot be auto-detected by J-Link
*    due to erroneous ROM tables etc. May also be used to specify the device name in case
*    debugger does not pass it to the DLL.
*
*  Return value
*    >= 0:  O.K.
*     < 0:  Error
*
*  Notes
*    (1) May not, under absolutely NO circumstances, call any API functions that perform target
*    (2) Should only set some global DLL variables
*/
int ConfigTargetSettings(void) {
  JLINK_SYS_Report("ConfigTargetSettings(): Enable Monitor Mode Debugging");
  JLINK_ExecCommand("SetMonModeDebug = 1");
  JLINK_ExecCommand("SetMonModeVTableAddr = 0x26000");  // Needed in case of the monitor mode interrupts needs to be forwarded, see section "Forwarding of Monitor Interrupts" in the J-Link User Guide (UM08001)
  return 0;
}

/*************************** end of file ****************************/

Any idea why monitor mode debug causes  an error?

Parents Reply Children
No Data
Related