MCU detecting if an SWD programmer is attached

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCU detecting if an SWD programmer is attached

Jump to solution
949 Views
plong44
Contributor II

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!  

Labels (1)
0 Kudos
1 Solution
941 Views
carstengroen
Senior Contributor II

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/

 

carstengroen_0-1645519811788.png

 

View solution in original post

2 Replies
942 Views
carstengroen
Senior Contributor II

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/

 

carstengroen_0-1645519811788.png

 

932 Views
plong44
Contributor II

Thanks, that works!

0 Kudos