QUERY · ISSUE
Hang when accessing filesystem if using timers/interrupts
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
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