← index #4873Issue #12957
Related · high · value 1.818
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

RTC issues on PYBD (STM32)

openby victorallumeopened 2023-11-13updated 2024-04-10
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.

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