Hard hang on accessing the filesystem

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
royk
Posts: 3
Joined: Sat May 01, 2021 6:52 pm

Hard hang on accessing the filesystem

Post by royk » Sat May 01, 2021 7:05 pm

Hi all

I'm seeing this problem where if I have an interrupt driven task and then try to access the filesystem on a pi pico, it just hangs. This behaviour is explained here https://www.raspberrypi.org/forums/view ... 6&t=310648 with code examples and some comments and a member of that forum confirming the same error is in official micropython as that distributed by the raspberry pi foundation. I don't know the guts of micropython, being merely a user, so I don't really know what to do about it. Can anyone in here help out?

thanks

roy

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Hard hang on accessing the filesystem

Post by Roberthh » Sat May 01, 2021 7:41 pm

I can replicate that with the my own build, using the script below based on the script in the cited forum:

Code: Select all

from machine import Pin, Timer
import uos, time

led = Pin(25, Pin.OUT)
timer = Timer()

count = 0

f = open("afile", "w")
f.write("This is a file\n")
f.close()

def blink(timer):
  global count; count = count + 1
  led.toggle()

timer.init(freq=4, mode=Timer.PERIODIC, callback=blink)

while True:
    uos.rename("afile", "bfile")
    time.sleep(0.1111)
    uos.rename("bfile", "afile")
    time.sleep(0.1111)
    print("count =", count)

It runs typically up to count=5 and then stops.

Edit: This is worth raising an issue at the git repository https://github.com/micropython/micropython

royk
Posts: 3
Joined: Sat May 01, 2021 6:52 pm

Re: Hard hang on accessing the filesystem

Post by royk » Sat May 01, 2021 9:16 pm


User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Hard hang on accessing the filesystem

Post by Roberthh » Sun May 02, 2021 6:40 pm

Please let the title of that isseu start with 'rp2:', which makes it better visible. You can edit the title.

Post Reply