← index #4873Issue #2457
Related · medium · value 1.373
QUERY · ISSUE

stm32: time.time() always returning 0

openby fragmuffinopened 2019-06-25updated 2019-08-16
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

stmhal: RTC stops ticking and cannot be updated after soft reboot

closedby ryannathansopened 2016-09-26updated 2016-09-27

After ctrl-D, the RTC does not tick and any calls to setting the datetime of the RTC take a long time and seem to fail and time out.

Tested on STM32F439 and PYBLITEV1.0 (STM32F411)

>>> r = pyb.RTC()
>>> r.datetime((2016, 9, 26, 0, 4, 19, 24, 135))
>>> r.datetime()
(2016, 9, 26, 0, 4, 19, 25, 85)
>>> r.datetime()
(2016, 9, 26, 0, 4, 19, 26, 112)
>>> r.datetime()
(2016, 9, 26, 0, 4, 19, 27, 133)
>>> r.datetime()
(2016, 9, 26, 0, 4, 19, 28, 174)
PYB: sync filesystems
PYB: soft reboot
>>> r = pyb.RTC()
>>> r.datetime()
(2016, 9, 26, 0, 4, 19, 37, 197)
>>> r.datetime()
(2016, 9, 26, 0, 4, 19, 37, 197)
>>> r.datetime()
(2016, 9, 26, 0, 4, 19, 37, 197)
>>> pyb.RTC().datetime((2016, 9, 26, 0, 4, 19, 37, 198)) #long wait, maybe 3 seconds before return
>>> r.datetime()
(2016, 9, 26, 0, 4, 19, 37, 197)
>>> r.datetime()
(2016, 9, 26, 0, 4, 19, 37, 197)
>>> r.datetime()
(2016, 9, 26, 0, 4, 19, 37, 197)

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied