Skip to content

PWM All timers in use on reload #6061

Closed
@Neradoc

Description

@Neradoc

Running on a Clue, I get "All timers in use" error when using PWMOut after a few reloads.
I originally noticed that on the Xiao NRF52 using adafruit_rgbled, and reproduced it on a Feather NRF52.
Couldn't reproduce on other ports.

This code takes 4 reloads to error. Less if more pins are used.

import board
import time
import pwmio
pins = [board.D0, board.D1, board.D2, board.D3, board.D4,]
pwms = []
for pin in pins:
    print(pin)
    pwm = pwmio.PWMOut(pin)
    pwms.append(pwm)
while True:
    time.sleep(1)
[...]
Code stopped by auto-reload.
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
board.P0
board.P1
board.P2
board.P3
board.P4
Traceback (most recent call last):
  File "code.py", line 13, in <module>
RuntimeError: All timers in use

NOTE: I noticed this goes at least as far back as 7.0.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions