cancel
Showing results for 
Search instead for 
Did you mean: 

after configuring standby Jlink connection is lost

Posted on August 10, 2016 at 22:29

I am working with STM32L051 and need to enter STANDBY mode.

The configuration and entering STANDBY are as follows:

/******************************************************/
static void SystemPower_Config(void)
{
/* Enable Power Control clock */
__HAL_RCC_PWR_CLK_ENABLE();
/* Enable Ultra low power mode */
HAL_PWREx_EnableUltraLowPower();
/* Enable the fast wake up from Ultra low power mode */
HAL_PWREx_EnableFastWakeUp();
/* Enable debug in standby *. 
DBGMCU->CR |= 0x00000004;
}
/******************************************************/
static void Enter_standby(void)
{
/* The Following Wakeup sequence is highly recommended prior to each Standby mode entry
mainly when using more than one wakeup source this is to not miss any wakeup event.
- Disable all used wakeup sources,
- Clear all related wakeup flags, 
- Re-enable all used wakeup sources,
- Enter the Standby mode.
*/
/* Disable all used wakeup sources: PWR_WAKEUP_PIN1 */
HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN1);
/* Clear all related wakeup flags*/
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
/* Enable WakeUp Pin PWR_WAKEUP_PIN1 */
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1);
/* Enter the Standby mode */
HAL_PWR_EnterSTANDBYMode();
} 

After programming I can't access a controller by JLink, even for programming,

though controller IS NOT in standby mode. Messages are: - No Cortex-M SW Device Found - Error: Flash Download failed - Target DLL has been cancelled. Power cycling doesn't help. Is there any way to restore connectivityor completely reset the microcontroller ?
5 REPLIES 5
Posted on August 10, 2016 at 22:40

Pull BOOT0 High, Reset, Connect, Erase

You could also change ''Connect Under Reset'' options

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on August 10, 2016 at 23:15

It worked, thanks a lot!

Also I couldn't find 'Connect Under Reset' option.

Could you please tell me where is it?

Thank you again,

Gennady

Posted on August 11, 2016 at 00:11

Too early to celebrate :(

I erased a chip, restored BOOT0 at GND.

Now I can program a chip, but it doesn't start.

On debugging I can see that it resets to 0x1FF00238.

Once in a while it resets to normal 0x80000D4, and then it works on debug.

But it never starts on a board, on a power cycle.

Have I done something wrong? 

Posted on August 11, 2016 at 00:56

Pulling BOOT0 to ground should suffice.

The connection options for the debugger are in the lower left of the Keil Debugger Settings window.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on August 11, 2016 at 03:41

BOOT0 is at the GND.

Still resets to 0x1FF00238 and doesn't run on a board.