ESP32-CAM: cannot get sdcard operation to work #13407
-
getting first hand-on experience with this mpu and got the primary goal for buing it to work (the camera) to work and managed to send the pictures to a simple webserver. As next step, I want to save the pictures using the sdcard reader/writer this mcu has.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The sdcard onboard of esp32-cam (AIThinker) is wired as sdmmc device. Using SPI to access the sdcard will not work as you mention. You have to use >>> import machine, os
>>> sd=machine.SDCard()
>>> sd.info()
(4016046080, 512)
>>> os.mount(sd, "/sd")
>>> fn = '/sd/test'
>>> f = open(fn, 'w')
>>> msg = 'hello world!'
>>> w=f.write(msg)
>>> w == len(msg)
True
>>> f.flush()
>>> f.close()
>>> f = open(fn)
>>> ms = f.read()
>>> ms == msg
True
>>> f.close()
>>> os.umount("/sd")
>>> sd.deinit() Using an SD card with a capacity greater than 4GB will cause the system to hang. The firmware used in the test is MicroPython v1.20.0-206-g33b403dfb compiled with idf4.4.6 which support OV2640. |
Beta Was this translation helpful? Give feedback.
The sdcard onboard of esp32-cam (AIThinker) is wired as sdmmc device.
Using SPI to access the sdcard will not work as you mention. You have to use
sd=machine.SDCard()
.Using an SD card with a capacity greater than 4GB will cause the system to hang.
The firmware used in the test is MicroPython v1.20.0-206-g33b403dfb compiled with idf4.4.6 which suppor…