micropython power cycle in STM32XX

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
Posts: 81
Joined: Fri Sep 02, 2016 9:26 am

micropython power cycle in STM32XX

Post by ajie_dirgantara » Sat Jul 15, 2017 6:07 am


as micropython application is grow more and more to many applications, especially remote application, it is worth to concern about how micropython handles device on and off cycles. e.g. in noisy power environment, power loss, unstable power line network could result in unexpected power supply conditions.

my question is, how micropython handle this?

e.g. is there "blocking process" code somwhere inside that I must be aware of, which could potentially cause crash because of this? or all process is non-blocking and leave the hardware (stm32) to do the power cycle?

User avatar
Posts: 4242
Joined: Fri Jul 18, 2014 8:01 am
Location: UK

Re: micropython power cycle in STM32XX

Post by pythoncoder » Sat Jul 15, 2017 9:23 am

In any microcontroller system you must ensure that the chip has a stable power supply. This can involve filtering or backup batteries as determined by the environment in which the hardware is operating. Sometimes special circuitry is required to control the reset pin in the event of brownouts. The application-specific solution is in the domain of electronic engineering rather than firmware design.

Programming can be involved if the device needs to retain state between resets/power cycles but (in the MicroPython context) this is standard stuff - saving data to the filesystem or to the backup RAM.
Peter Hinch

Post Reply