MicroPython v1.18 on 2022-01-17; ESP32 module with ESP32
I have been chasing this issue for THREE DAYS !!!
@yukky post sent a light bulb on...
I have two identical 2GB cards that give me two different errors
Also note that it reports its [SDCard] v2 card not [SDCard] v1 card
ERRORS...
Code: Select all
[SDCard] v2 card
sectors 1935360
Traceback (most recent call last):
File "main.py", line 11, in <module>
OSError: [Errno 19] ENODEV
[SDCard] v2 card
sectors 1935360
Traceback (most recent call last):
File "main.py", line 28, in <module>
File "sdcard.py", line 239, in readblocks
OSError: [Errno 5] EIO
So in sdcard.py I added 2 print() statments and commented out if/elif check for version and forced self.init_card_v1()
Code: Select all
# CMD8: determine card version
r = self.cmd(8, 0x01AA, 0x87, 4)
print('determine card version')
print(r)
# if r == _R1_IDLE_STATE:
# self.init_card_v2()
# elif r == (_R1_IDLE_STATE | _R1_ILLEGAL_COMMAND):
# self.init_card_v1()
# else:
# raise OSError("couldn't determine SD card version")
self.init_card_v1()
and now all works correctly....
Code: Select all
determine card version
1
[SDCard] v1 card
sectors 1966080
['System Volume Information']
['sd', 'boot.py', 'main.py', 'mysdcard.py', 'project.pymakr', 'sdcard.py', 'sdtest.py']
MicroPython v1.18 on 2022-01-17; ESP32 module with ESP32
r = self.cmd(8, 0x01AA, 0x87, 4) is returning... 1
These cheap Chinese Takeout cards trying to pass as v2 cards ???
Can 2GB cards be v2 ???
And what action should be tacken so "CMD8: determine card version" works properly ???
I have seen an enormous amount of posts regarding these ERRORs
I am not a seasoned coder... but these SD Card issues have been floating around for far too long!!!
I need this device to work properly with any SD card used.