STM32L476 wakeup by PA0 from deepsleep

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
Sunghwan_Chung
Posts: 5
Joined: Sat Feb 10, 2018 1:27 pm
Location: South Korea

STM32L476 wakeup by PA0 from deepsleep

Post by Sunghwan_Chung » Wed Jun 17, 2020 1:27 am

How can I make STM32L476 wake-up from deepsleep by pull-up the PA0 port.

I think additional register setting need like a pyboard (https://github.com/micropython/micropython/issues/3834).

shaoziyang
Posts: 363
Joined: Sun Apr 17, 2016 1:55 pm

Re: STM32L476 wakeup by PA0 from deepsleep

Post by shaoziyang » Wed Jun 17, 2020 1:41 am

You need set EWUP1 bit in registry PWR_CR3.

Code: Select all

import stm

A0 = Pin('A0', Pin.IN, pull=Pin.PULL_DOWN) 
stm.mem32[stm.PWR+0x08] |= 1

Sunghwan_Chung
Posts: 5
Joined: Sat Feb 10, 2018 1:27 pm
Location: South Korea

Re: STM32L476 wakeup by PA0 from deepsleep

Post by Sunghwan_Chung » Wed Jun 17, 2020 1:46 am

Thanks it works.

shaoziyang wrote:
Wed Jun 17, 2020 1:41 am
You need set EWUP1 bit in registry PWR_CR3.

Code: Select all

import stm

A0 = Pin('A0', Pin.IN, pull=Pin.PULL_DOWN) 
stm.mem32[stm.PWR+0x08] |= 1

Post Reply