maholli / SAM32

Feather-sized SAMD51 with M4 core serving as UART bridge to WROOM ESP32
https://maholli.github.io/SAM32/
42 stars 6 forks source link

SD Card filesystem access #7

Open maholli opened 5 years ago

maholli commented 5 years ago
maholli commented 5 years ago

mounting an SD card on the ESP32 (SAM32v1):

  1. set SD_CS low in SAMD51 main.
  2. enter the esp32 REPL prompt. Current (sketchy) method is using the attached main.py main.py.txt
import uos
uos.sdconfig(uos.SDMODE_SPI, clk=5, mosi=18, miso=19, cs=14, maxspeed=16)
import os
os.mountsd(True)
os.listdir('/sd')

REPL output should look something like this: image

maholli commented 5 years ago

running files on ESP32 from SD card

  1. Save desired file to sd card (externally)
  2. boot with attached main.py main.py.txt
  3. mount sd like so: image
  4. run os.getcwd() and make sure you're in /sd, otherwise do os.chdir('/sd')
  5. now you you can do: import FILENAMEHERE.py