OK !
Then, with Keil, STM32L053C8T6 and ST-Link V1, it is possible!!
The important thing is to enable the clock for the debugger...
Then, you enable the debugger for the desired condition, in my case for the stop condition:
RCC->APB2ENR |= RCC_APB2ENR_DBGEN;
DBGMCU->CR |= DBGMCU_CR_DBG_STOP; // Way 1)
DBGMCU->CR = 0x00000002; // Way 2)
In the same way you can enable/disable the other conditions:
RCC->APB2ENR |= RCC_APB2ENR_DBGEN;
// DBGMCU->CR |= DBGMCU_CR_DBG_SLEEP;
DBGMCU->CR |= DBGMCU_CR_DBG_STOP;
// DBGMCU->CR |= DBGMCU_CR_DBG_STANDBY;
// DBGMCU->CR = 0x00000000;
// DBGMCU->CR = 0x00000001;
// DBGMCU->CR = 0x00000002;
// DBGMCU->CR = 0x00000004;
// DBGMCU->CR = 0x00000007;
Warning: these bits, once set, remain active until the next power on.
To use this method, I implemented a directive that activates these functions when needed.