SAM32 icon indicating copy to clipboard operation
SAM32 copied to clipboard

SD Card filesystem access

Open maholli opened this issue 6 years ago • 2 comments

  • [x] via SAMD51 SPI
  • [x] via ESP32 SPI

maholli avatar Jan 06 '19 23:01 maholli

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 avatar Jan 08 '19 21:01 maholli

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

maholli avatar Jan 08 '19 21:01 maholli