very strange behavior with sd and nodemcu
Posted: Sat Apr 20, 2019 8:59 am
i connected sd module with nodemcu board(software spi) and wrote some code:
import machine, sdcard, os
Pin = machine.Pin
cs = Pin(0)
mosi = Pin(5)
miso = Pin(16)
sck = Pin(4)
spi = machine.SPI(-1,sck = sck, mosi = mosi, miso = miso)
sd = sdcard.SDCard(spi, cs)
vfs = os.VfsFat(sd) #eio
os.mount(vfs, '/sd')
os.chdir('sd')
f = open('test', 'w')
f.write('hello world')
f.close()
with 2gb sdcard i get
OSError: [Errno 5] EIO
in vfs = os.VfsFat(sd) line
with 4 gb card i get freeze of the board in
sd = sdcard.SDCard(spi, cs) line
micropython version: esp8266-20190125-v1.10.bin
sd library i downloaded here https://learn.adafruit.com/micropython- ... icropython (green button)
import machine, sdcard, os
Pin = machine.Pin
cs = Pin(0)
mosi = Pin(5)
miso = Pin(16)
sck = Pin(4)
spi = machine.SPI(-1,sck = sck, mosi = mosi, miso = miso)
sd = sdcard.SDCard(spi, cs)
vfs = os.VfsFat(sd) #eio
os.mount(vfs, '/sd')
os.chdir('sd')
f = open('test', 'w')
f.write('hello world')
f.close()
with 2gb sdcard i get
OSError: [Errno 5] EIO
in vfs = os.VfsFat(sd) line
with 4 gb card i get freeze of the board in
sd = sdcard.SDCard(spi, cs) line
micropython version: esp8266-20190125-v1.10.bin
sd library i downloaded here https://learn.adafruit.com/micropython- ... icropython (green button)