I was hoping that the Debug Monitor ISR would help with a low level project. After reading https://forum.pjrc.com/threads/26358...Debugger-Stack and https://forum.pjrc.com/threads/28058...ight=C_DEBUGEN. I'm having difficulty following the instructions to turn off C_DEBUGEN. It says to sleep for 100 ms or more.

Here is my code:

Code:
#include <Snooze.h>

#define ARM_DHCSR (*(uint32_t*)0xE000EDF0)

SnoozeTimer timer;
SnoozeBlock config_teensy(timer);

void setup() {
  pinMode(13, OUTPUT);

#ifdef __MK20DX128__
  return;
#endif
  delay(1000);

  digitalWrite(13, HIGH);
  delay(100);
  digitalWrite(13, LOW);
#ifdef __IMXRT1062__
  timer.setTimer(1);
#else
  timer.setTimer(500);
#endif
  Snooze.sleep(config_teensy);
  digitalWrite(13, HIGH);
}

void loop() {
  delay(1000);
  Serial.print("DHCSR=");Serial.println(ARM_DHCSR, HEX);
}
Running on a Teensy 3.2, the C_DEBUGEN bit is never disabled. Here is the output:

Code:
DHCSR=3010001
DHCSR=1010001
DHCSR=1010001
DHCSR=1010001
DHCSR=1010001
DHCSR=1010001
DHCSR=1010001
DHCSR=1010001
DHCSR=1010001
DHCSR=1010001
DHCSR=1010001
DHCSR=1010001
DHCSR=1010001
DHCSR=1010001
What am I doing wrong?