QUERY · ISSUE
stm32: time.time() always returning 0
port-stm32
We're running a Pyboard-D SF6W and the RTC seems to hang from time to time.
MicroPython v1.10-445-ga9b1d3ca3-dirty on 2019-06-18; PYBD_SF6W with STM32F767IIK
Type "help()" for more information.
>>> import time
>>> time.time()
0
Soft Reset (doesn't work)
Software accessible resets do not fix the issue... the following attempts to reboot are done without removing power.
machine.reset
>>> import machine
>>> machine.reset()
...
MicroPython v1.10-445-ga9b1d3ca3-dirty on 2019-06-18; PYBD_SF6W with STM32F767IIK
Type "help()" for more information.
>>> import time
>>> time.time()
0
pyb.hard_reset()
>>> import pyb
>>> pyb.hard_reset()
...
MicroPython v1.10-445-ga9b1d3ca3-dirty on 2019-06-18; PYBD_SF6W with STM32F767IIK
Type "help()" for more information.
>>> import time
>>> time.time()
0
Physical Reset (ie: completely remove power)
However, if pyboard is completely powered off (tested for ~3sec).
The problem is resolved.
MicroPython v1.10-445-ga9b1d3ca3-dirty on 2019-06-18; PYBD_SF6W with STM32F767IIK
Type "help()" for more information.
>>> import time
>>> time.time()
473385659
CANDIDATE · ISSUE
RTC issues on PYBD (STM32)
bug
We've encountered a number of issues using the RTC on PYBD across a number of devices. These include
- RTC stopping entirely (subsequent calls to the RTC return exactly the same value)
- RTC blocking for ~1 sec when getting or setting the time
- RTC returning a plausible but incorrect value (I think a bit has become 'stuck')
These faults are often intermittent making debugging quite difficult.
As such, for our application code we are now using a 'soft' RTC based off CPU ticks, and synchronising from the network on a regular basis.