How can I edit file located on an SD card connected via SPI?
Posted: Tue May 26, 2020 1:45 pm
Hi,
I'm using a simple STM32F411-based board with an SD card connected via SPI (I can't enable SDIO, as it blocks 3 SPI ports!),
To enable that I have copied the sdcard.py driver to the internal flash filesystem and have put the following into main.py:
That allows me to import libraries from the SD card and import scripts. However, I can't easily access scripts on the SD card for editing.
I tried to copy them using the rshell, but rshell says that the /sdcard directory does not exist.
Is there any convenient way to modify the files on so mounted SD card without removing it physically and puting it into the card reader?
TIA & Regards,
Wojtek
I'm using a simple STM32F411-based board with an SD card connected via SPI (I can't enable SDIO, as it blocks 3 SPI ports!),
To enable that I have copied the sdcard.py driver to the internal flash filesystem and have put the following into main.py:
Code: Select all
import pyb
import machine
import sdcard
import os
import sys
s1=pyb.SPI(1)
sd1=sdcard.SDCard(s1,cs=machine.Pin('A4'))
os.mount(sd1,"/sdcard")
sys.path.append("/sdcard")
I tried to copy them using the rshell, but rshell says that the /sdcard directory does not exist.
Is there any convenient way to modify the files on so mounted SD card without removing it physically and puting it into the card reader?
TIA & Regards,
Wojtek