Skip to content

Commit

Permalink
Add LittleFS, SD, and SDFS Filesystems and File:: interface (#49)
Browse files Browse the repository at this point in the history
Pull in the ESP8266 File/Dir/etc. filesystem and port LittleFS
and SD/SDFS to the RP2040.

See https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html
for more information
  • Loading branch information
earlephilhower committed Apr 3, 2021
1 parent 1eb48f7 commit 4e50fe8
Show file tree
Hide file tree
Showing 28 changed files with 3,453 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
[submodule "system/pyserial"]
path = tools/pyserial
url = https://github.com/pyserial/pyserial.git
[submodule "libraries/LittleFS/lib/littlefs"]
path = libraries/LittleFS/lib/littlefs
url = https://github.com/littlefs-project/littlefs.git
[submodule "libraries/SdFat"]
path = libraries/SdFat
url = https://github.com/earlephilhower/ESP8266SdFat.git
[submodule "pico-extras"]
path = pico-extras
url = https://github.com/raspberrypi/pico-extras.git
26 changes: 17 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,17 @@ Them hit the upload button and your sketch should upload and run.
In some cases the Pico will encounter a hard hang and its USB port will not respond to the auto-reset request. Should this happen, just
follow the initial procedure of holding the BOOTSEL button down while plugging in the Pico to enter the ROM bootloader.

# Uploading with Picoprobe
# Uploading Filesystem Images
The onboard flash filesystem for the Pico, LittleFS, lets you upload a filesystem image from the sketch directory for your sketch to use. Download the needed plugin from
* https://github.com/earlephilhower/arduino-pico-littlefs-plugin/releases

To install, follow the directions in
* https://github.com/earlephilhower/arduino-pico-littlefs-plugin/blob/master/README.md

For detailed usage information, please check the ESP8266 repo documentation (ignore SPIFFS related notes) available at
* https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html

# Uploading Sketches with Picoprobe
If you have built a Raspberry Pi Picoprobe, you can use OpenOCD to handle your sketch uploads and for debugging with GDB.

Under Windows a local admin user should be able to access the Picoprobe port automatically, but under Linux `udev` must be told about the device and to allow normal users access.
Expand All @@ -88,15 +98,17 @@ The installed tools include a version of OpenOCD (in the pqt-openocd directory)
Relatively stable and very functional, but bug reports and PRs always accepted.
* digitalWrite/Read
* shiftIn/Out
* SPI master (tested using SdFat 2.0 https://github.com/greiman/SdFat ... note that the Pico voltage regulator can't reliably supply enough power for a SD Card so use external power, and adjust the `USE_SIMPLE_LITTLE_ENDIAN` define in `src/sdfat.h` to 0)
* SPI master
* analogWrite/PWM
* tone/noTone
* Wire/I2C Master and Slave (tested using DS3231 https://github.com/rodan/ds3231)
* Wire/I2C Master and Slave
* EEPROM
* USB Serial(ACM) w/automatic reboot-to-UF2 upload)
* Hardware UART
* Servo
* Servo, glitchless
* Overclocking and underclocking from the menus
* analogRead and Pico chip temperature
* Filesystems (LittleFS and SD/SDFS)
* I2S audio output
* printf (i.e. debug) output over USB serial

Expand All @@ -105,13 +117,9 @@ The RP2040 PIO state machines (SMs) are used to generate jitter-free:
* Tones
* I2S Output

# Todo
Some major features I want to add are:
* Installable filesystem support (SD, LittleFS, etc.)
* Updated debug infrastructure

# Tutorials from Across the Web
Here are some links to coverage and additional tutorials for using `arduino-pico`
* The File:: class is taken from the ESP8266. See https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html
* Arduino Support for the Pi Pico available! And how fast is the Pico? - https://youtu.be/-XHh17cuH5E
* Pre-release Adafruit QT Py RP2040 - https://www.youtube.com/watch?v=sfC1msqXX0I
* Adafruit Feather RP2040 running LCD + TMP117 - https://www.youtube.com/watch?v=fKDeqZiIwHg
Expand Down

0 comments on commit 4e50fe8

Please sign in to comment.