I am trying to find a way for the LPC55S69 to determine if an SWD programmer is connected to it. I want to avoid some sleep modes and other things when the programmer is attached.
The MCULink pulls SWCLK high (and the LPC's pin is pulled low internally) but unfortunately the JLINK programmers (at least the one I have) do not pull SWCLK high normally, it drives the line high only when clocking. Is there a registers in the LPC55S69 that might give me a some indication of whether or not a programmer is attached? I have been looking but I haven't found anything yet.
Thanks in advance for any help!
已解决! 转到解答。
Check DHCSR register. Bit 0 is '1' if device is running under debug control. I use that in my designs to disable powerdown etc.
Page 1535 in: https://developer.arm.com/documentation/ddi0553/br/
Check DHCSR register. Bit 0 is '1' if device is running under debug control. I use that in my designs to disable powerdown etc.
Page 1535 in: https://developer.arm.com/documentation/ddi0553/br/