2016-08-10 01:29 PM
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 ?2016-08-10 01:40 PM
Pull BOOT0 High, Reset, Connect, Erase
You could also change ''Connect Under Reset'' options2016-08-10 02:15 PM
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,Gennady2016-08-10 03:11 PM
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?2016-08-10 03:56 PM
Pulling BOOT0 to ground should suffice.
The connection options for the debugger are in the lower left of the Keil Debugger Settings window.2016-08-10 06:41 PM
BOOT0 is at the GND.
Still resets to 0x1FF00238 and doesn't run on a board.