Debug Support for low-power-mode

Hi all,

I’m using STM32F103x with openOCD and GDB.

My problem is that I want to include Low-power-mode (only Sleep Mode) in my code but If I do , I have several problems to re-program it again ( I always have to boots from system memory for it).

In documentation, I found:

For this, the debugger host must first set some debug configuration registers to change the low-power mode behavior:

● In Sleep mode, DBG_SLEEP bit of DBGMCU_CR register must be previously set by the debugger. This will feed HCLK with the same clock that is provided to FCLK (system clock previously configured by the software).

So, my question is how I set the DBGMCU_CR register with openOCD?

Thanks all