AnsweredAssumed Answered

after configuring standby Jlink connection is lost

Question asked by palitsky.gennady on Aug 10, 2016
Latest reply on Aug 11, 2016 by palitsky.gennady
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 connectivity or completely reset the microcontroller ?

 

Outcomes