← index #7204Issue #11140
Related · high · value 2.027
QUERY · ISSUE

Hang when accessing filesystem if using timers/interrupts

openby rkarlsbaopened 2021-05-01updated 2022-02-21
bugport-rp2

Hi all

I have an rpi pico loaded with micropython and I have this issue detailed on the links below

https://www.raspberrypi.org/forums/viewtopic.php?f=146&t=310648
https://forum.micropython.org/viewtopic.php?f=21&t=10430

It is reproducable on current micropython by others and it seems to be a bug. Please help :)

CANDIDATE · ISSUE

rp2: Reading pin value from IRQ hangs forver

openby GuillaumeLeclercopened 2023-03-28updated 2026-03-25
bugport-rp2proposed-close
from machine import Pin, idle, disable_irq, enable_irq
from time import sleep_ms

pin = Pin(1, Pin.IN)

def on_change(pin):
    state = disable_irq()
    pin.value()
    enable_irq(state)

pin.irq(on_change, Pin.IRQ_RISING | Pin.IRQ_FALLING)

for i in range(1000):
        idle()
        sleep_ms(100)
        print("WORKING")

It seems impossible to read the value of the pin object passed as an argument to the callback. As soon as it is triggered the RPI Pico stop working until I unplug/replug it. Using the pin from the global context works or even recreating a new Pin instance, but not using the one passed as an argument

firmware: rp2-pico-20230116-unstable-v1.19.1-803-g1583c1f67.uf2

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