Who has had luck using SDIO 4-bit for SD Cards with IDF?
Posted: Thu Feb 28, 2019 2:09 am
I am having a tough time getting the sd card example or my own code working reliably.
The 2 dev boards I am using (DOIT ESP32 DevKit) I have
- used espefuse to set them for 3.3V flash so that GPIO 12 is not an issue for boot.
- jumpered GPIO 0 and GPIO 2 to ensure at boot GPIO 2 is low
- I have used 3 different SD Card board
- two are for micro cards and have 10k resistors on the board for the 6 data/cmd/clk lines
- the other is for full sized cards and does not have 10k resistors and in this case I added pull-ups to the 6 lines
- have used Master IDF, release 3.1.3, release 3.1.4, current release 3.2 branch
- I have used breadboard and also soldered up a prototype with short wires to try to minimize wire length and issues like that
- on breadboard my wires are 3" on one board and 6" on the other
I usually get 0x109 or 0x107 errors.
The weirdest part is that I have had it working and without changing the hardware side it just stops working and then doesn't ever seem to work again.
Last week board 1 and board 2 were wired the same but board 1 errored with 0x109 but board 2 worked fine. Switching the ESP32 board between configurations and the same configuration continued to work. Swapping the SD card the same config continued to work. Then I left the ESP32 on over night (just forgot to pull USB cable before went to bed). The next afternoon when I got back to it SD card access started to fail on the previously working config.
I am trying to build a data logging system for my track motorcycle. I was writing data to the SD Card fine then it just stopped. This same experience happened with config #1 several weeks back. I thought maybe I zapped it with static or something stupid (though didn't remember it). Though everything else still works (I2C, Serial).
The SD Card example and my code both error the exact same way.
So who has SD Card working and was there a trick to it?
Thanks, jeff
The 2 dev boards I am using (DOIT ESP32 DevKit) I have
- used espefuse to set them for 3.3V flash so that GPIO 12 is not an issue for boot.
- jumpered GPIO 0 and GPIO 2 to ensure at boot GPIO 2 is low
- I have used 3 different SD Card board
- two are for micro cards and have 10k resistors on the board for the 6 data/cmd/clk lines
- the other is for full sized cards and does not have 10k resistors and in this case I added pull-ups to the 6 lines
- have used Master IDF, release 3.1.3, release 3.1.4, current release 3.2 branch
- I have used breadboard and also soldered up a prototype with short wires to try to minimize wire length and issues like that
- on breadboard my wires are 3" on one board and 6" on the other
I usually get 0x109 or 0x107 errors.
The weirdest part is that I have had it working and without changing the hardware side it just stops working and then doesn't ever seem to work again.
Last week board 1 and board 2 were wired the same but board 1 errored with 0x109 but board 2 worked fine. Switching the ESP32 board between configurations and the same configuration continued to work. Swapping the SD card the same config continued to work. Then I left the ESP32 on over night (just forgot to pull USB cable before went to bed). The next afternoon when I got back to it SD card access started to fail on the previously working config.
I am trying to build a data logging system for my track motorcycle. I was writing data to the SD Card fine then it just stopped. This same experience happened with config #1 several weeks back. I thought maybe I zapped it with static or something stupid (though didn't remember it). Though everything else still works (I2C, Serial).
The SD Card example and my code both error the exact same way.
So who has SD Card working and was there a trick to it?
Thanks, jeff