Skip to content

Panic when calling timer.value() on an uninitialised timer (ESP32) #17035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
robert-hh opened this issue Mar 29, 2025 · 1 comment
Open

Panic when calling timer.value() on an uninitialised timer (ESP32) #17035

robert-hh opened this issue Mar 29, 2025 · 1 comment

Comments

@robert-hh
Copy link
Contributor

Discussed in https://github.com/orgs/micropython/discussions/17033

Originally posted by SergeiFranco March 29, 2025
I have encountered a peculiar problem:
if I call value() on a uninitialised timer I get a panic:
Here are steps to reproduce:

t0 = Timer(0)
t0.value()

Results in:

A fatal error occurred. The crash dump printed below may be used to help
determine what caused it. If you are not already running the most recent
version of MicroPython, consider upgrading. New versions often fix bugs.

To learn more about how to debug and/or report this crash visit the wiki
page at: https://github.com/micropython/micropython/wiki/ESP32-debugging

MPY version : v1.24.1 on 2024-11-29
IDF version : v5.2.2
Machine     : Generic ESP32 module with ESP32

Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x400d6790  PS      : 0x00060330  A0      : 0x800dd400  A1      : 0x3ffcf370  
A2      : 0x3ffd3890  A3      : 0x00000000  A4      : 0x00020002  A5      : 0x00000000  
A6      : 0x0000005c  A7      : 0x3ffbc984  A8      : 0x00000000  A9      : 0x00000000  
A10     : 0x00000003  A11     : 0x00060323  A12     : 0x00000001  A13     : 0x0000000d  
A14     : 0x3ffd6f40  A15     : 0x00000000  SAR     : 0x0000001a  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000008  LBEG    : 0x4000c46c  LEND    : 0x4000c477  LCOUNT  : 0xffffffff  


Backtrace: 0x400d678d:0x3ffcf370 0x400dd3fd:0x3ffcf390 0x400e4935:0x3ffcf3b0 0x400e49fd:0x3ffcf3d0 0x40084d22:0x3ffcf3f0 0x400dd51f:0x3ffcf490 0x400e4935:0x3ffcf4e0 0x400e494a:0x3ffcf500 0x400f2763:0x3ffcf520 0x400f2a58:0x3ffcf5b0 0x400d6274:0x3ffcf5f0




ELF file SHA256: 4ac361b7d

Rebooting...

Note: works on any timer (not just 0).

The micro details are:

MPY version : v1.24.1 on 2024-11-29
IDF version : v5.2.2
Machine     : Generic ESP32 module with ESP32
```</div>
@jonnor
Copy link
Contributor

jonnor commented Apr 25, 2025

Thanks for reporting. And for the MR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants