Code: Select all
MPY: soft reboot
MicroPython v1.13-290-g556ae7914 on 2021-01-21; Raspberry Pi Pico with RP2040
Type "help()" for more information.
>>> import os
>>> os.listdir('/')
[]
>>>
Code: Select all
MPY: soft reboot
MicroPython v1.13-290-g556ae7914 on 2021-01-21; Raspberry Pi Pico with RP2040
Type "help()" for more information.
>>> import os
>>> os.listdir('/')
[]
>>>
Code: Select all
import os
import machine, rp2
# Try to mount the filesystem, and format the flash if it doesn't exist.
# Note: the flash requires the programming size to be aligned to 256 bytes.
bdev = rp2.Flash()
try:
vfs = os.VfsLfs2(bdev, progsize=256)
except:
os.VfsLfs2.mkfs(bdev, progsize=256)
vfs = os.VfsLfs2(bdev, progsize=256)
os.mount(vfs, "/")
del os, bdev, vfs
Code: Select all
/mnt/qnap2/data/Projects/MicroPython/rshell> ls /flash
Cannot access '/flash': No such file or directory
/mnt/qnap2/data/Projects/MicroPython/rshell> repl
Entering REPL. Use Control-X to exit.
>
MicroPython de1239b6a-dirty on 2021-01-26; Raspberry Pi Pico with RP2040
Type "help()" for more information.
>>>
>>> import os
>>> os.listdir('/')
['flash/']
>>> os.listdir('/flash/')
['rats.py']
>>>
Default builds for ESP8266, ESP32 and CircuitPython also mount at '/'. I was thinking of PyBoard and some ESP builds (eg M5Stack) with their /flash to be exceptionspythoncoder wrote: ↑Tue Jan 26, 2021 3:23 pmI was expecting the filesystem to be mounted on /flash or /pyboard. Unfortunately it is mounted at '/' which confuses rshell.
Code: Select all
robert@hh3:~$ rshell -p /dev/ttyACM0
Using buffer-size of 32
Connecting to /dev/ttyACM0 (buffer-size 32)...
Trying to connect to REPL connected
Testing if ubinascii.unhexlify exists ... Y
Retrieving root directories ... /main.py/ /runtest.py/
Setting time ... Jan 26, 2021 17:57:00
Evaluating board_name ... pyboard
Retrieving time epoch ... Jan 01, 1970
Welcome to rshell. Use Control-D (or the exit command) to exit rshell.
Code: Select all
ls /