I am working on ARM Cortex-M0+. I need put CPU to a deep sleep mode to measure its standby power consumption. I use Keil uLink debugger to load the firmware. However debugger stops CPU to sleep when connecting. Is it possible to disable debugger port after I load/run the firmware? How can I do that?
-
what did you try and/or not understand from the arm documentation on the subject? – old_timer May 16 '17 at 18:00
-
@old_timer I failed to find anything with Google, which is a surprise since the Keil documentation seems to be well indexed. – Sean Houlihane May 16 '17 at 19:34
-
why are you using Google and Keil to find arm documents on the arm website? anytime you want to use an arm chip you go get the trm and architectural reference manual, you want to use a mips you get matching manuals from them, for non-ip cores, atmel avr, you go there, ti msp430 you get those docs...step one in bare metal development (well step one is get the schematic, step two is get the docs for all the parts on the schematic). – old_timer May 16 '17 at 19:36
-
@old_timer Thank you for your replies. Yes, I did read ARM architecture manual/technical reference manual and google. Unfortunately, I couldn't find this information. – yelInv May 17 '17 at 13:26
-
There is a register that I found that said enable the debugger, which implies you can disable it. it also talked about software needs to enable the debug port, but all the chips I have tried it comes up enabled (something they can easily do at compile time (for the chip) no doubt). So the implication is you can disable it. So in the armv6-m archtectural reference manual under debug port, find this enable bit, see if the register is accessible from software as implied elsewhere in the doc, and see if you can turn it off and then try to come in from SWD and see what happens... – old_timer May 17 '17 at 13:45
1 Answers
It seems this function may fall in the grey area between architected functionality, device specific features, and tool capabilities.
The ARM ADIv5 debug interface certainly can request DEBUGPWRUP. When tools connect over SWD or JTAG, they have to set this before being able to make accesses. The bit won't be cleared by simply pulling the connection (there is no liveness indication on the target side). Clearing this bit using a debug toolchain (as opposed to a low-level drive) might be tricky.
Some STM32 devices seem to provide DBGMCU_Config in a the vendor-specific library to control the interaction between sleep states and debug. It's permitted to either emulate low power states (i.e. remain active, just stalled) or sleep even when debug is connected.
This level of detail is generally described in the device specific documentation from the vendor, and there may be more than one way of achieving what you need. A power-sensitive part is more likely to have an app-note on the type of measurement you're looking for.

- 1,698
- 16
- 22