micropython/micropython-lib

OSError 19: ENODEV

Shade3652 opened this issue · 1 comments

I was using a spi microSD card reader and I hooked up everything. I could run

import sdcard
from machine import Pin, SPI
import vfs
from time import sleep

#webrepl.start()

spi = SPI(0,
baudrate=1000000,
polarity=0,
phase=0,
bits=8,
firstbit=SPI.MSB,
sck=Pin(18),
mosi=Pin(19),
miso=Pin(16))

cs = Pin(15, mode = Pin.OUT, value = 1)

sd = sdcard.SDCard(spi, cs)
sus = vfs.VfsFat(sd);

But when I tried to vfs.mount(sus, "/sd"), It would shoot OSError 19 (ENODEV)

Does anyone know how to solve this?

I FOUND THE ERROR. I shouldn't have re-assigned sd. Just removing any sd = after is was already declared fixed everything!