This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to detect LPC4357 if in debug mode?

How to detect the LPC4357(Cortex M4) is running in debug mode? I mean run the code via Keil Ulink-ME. Is there any register can be used to check?

Parents
  • Leo,
    I use this on Cortex M3, I'm not sure if you can do the same on M4 but my guess is "yes". Check if the register is the same etc

            // On Cortex CPU's, only enable watchdog if not running in debugger
            if ((CoreDebug->DHCSR & 0x0001)==0) {
                    Chip_WWDT_Start(LPC_WWDT);
            }
    

Reply
  • Leo,
    I use this on Cortex M3, I'm not sure if you can do the same on M4 but my guess is "yes". Check if the register is the same etc

            // On Cortex CPU's, only enable watchdog if not running in debugger
            if ((CoreDebug->DHCSR & 0x0001)==0) {
                    Chip_WWDT_Start(LPC_WWDT);
            }
    

Children