I am trying to add some SD Card capabilities to a project and recently tried the example that comes with the IDF (update to date MASTER IDF). No matter what I did I couldn't get it to work.
Code: Select all
I (0) cpu_start: Starting scheduler on APP CPU.
I (259) example: Initializing SD card
I (259) example: Using SDMMC peripheral
I (259) gpio: GPIO[13]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
E (349) sdmmc_cmd: sdmmc_read_sectors_dma: sdmmc_send_cmd returned 0x109
E (349) diskio_sdmmc: sdmmc_read_blocks failed (265)
W (349) vfs_fat_sdmmc: failed to mount card (13)
E (349) example: Failed to mount filesystem. If you want the card to be formatted, set format_if_mount_failed = true.
After my experience with my I2C BNO055 where the IDF i2c scanner fails to see it but an Arduino I2C Scanner code works fine I thought I would try the Arduino SD_MMC example. No change to board config, all I did was compile and flash.
The Arduino example works perfect. Which makes me think there is nothing wrong with the hardware side and I am missing something on the SW side. But I would expect the IDF example would be correct software wise. Not sure I want to dig through all the Arduino code to find the difference. Therefore I have adjusted my project to use Arduino as a component (since WIRE and SD_MMC work for some of my modules) though I am still interested that the IDF SD card example (basically the reference implementation) fails. I would actually prefer to just use the IDF without additional Arduino component if possible.
Jeff