MCU detecting if an SWD programmer is attached

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

MCU detecting if an SWD programmer is attached

跳至解决方案
966 次查看
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!  

标签 (1)
0 项奖励
1 解答
958 次查看
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

 

在原帖中查看解决方案

2 回复数
959 次查看
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

 

949 次查看
plong44
Contributor II

Thanks, that works!

0 项奖励