Page 1 of 1

micropython power cycle in STM32XX

Posted: Sat Jul 15, 2017 6:07 am
by ajie_dirgantara
Hi,

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?

Re: micropython power cycle in STM32XX

Posted: Sat Jul 15, 2017 9:23 am
by pythoncoder
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.