← index #9674Issue #8084
Related · high · value 4.074
QUERY · ISSUE

ESP32_C3: timer_group: timer_init(271): HW TIMER NUM ERROR

openby iBoundaryopened 2022-10-19updated 2026-03-19
bugport-esp32

from machine import*
tim = Timer(-1)
tim.init(period=1000,callback = lambda t:print('rtos'))
E (6078630) timer_group: timer_init(271): HW TIMER NUM ERROR
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: (-258, 'ESP_ERR_INVALID_ARG')

I found out that virtual timer is not available in ESP32_C3 chip.

CANDIDATE · ISSUE

ESP32C3 Timer period doubled

closedby walklinewangopened 2021-12-14updated 2022-11-23
port-esp32

Run the test code

from machine import Timer, RTC

def timer_cb(_):
    print(rtc.datetime()[4:7])

rtc = RTC()
rtc.init((2000, 1, 1, 0, 0, 0, 0, 8))

t = Timer(0)
t.init(
    mode=Timer.PERIODIC,
    period=1000,
    callback=timer_cb
)

Result on ESP32C3 (IDF 4.3.1) board

>>> (0, 0, 2)
>>> (0, 0, 4)
>>> (0, 0, 6)
>>> (0, 0, 8)
>>> (0, 0, 10)

Result on ESP32 (IDF 4.3.1) board

>>> (0, 0, 1)
>>> (0, 0, 2)
>>> (0, 0, 3)
>>> (0, 0, 4)
>>> (0, 0, 5)

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