loboris wrote:You must use
espefuse.py set_flash_voltage 3.3V without sdcard inserted, the same as for flashing...
Have you tried the SPI mode? You have to use the latest master branch of esp-idf. You can use the same wiring that worked on arduino, the new
SD Card example has all the instruction needed, just set the pins you are using...
I tried to set the flash voltage and also the flashing itself without sd card connected (nothing was connected to the ESP32).
Tried today SPI, its also not working.
When i flash the ESP (without! SD Card) i'll get
E (237) sdmmc_req: handle_idle_state_events unhandled: 00000004 00000000
E (237) sdmmc_cmd: sdmmc_card_init: send_op_cond (1) returned 0x107
E (237) example: Failed to initialize the card (263). Make sure SD card lines have pull-up resistors in place.
when i plug in the sd card adapter and type 'make monitor' i'll get
E (417) sdmmc_cmd: sdmmc_card_init: send_scr returned 0x109
E (417) example: Failed to initialize the card (265). Make sure SD card lines have pull-up resistors in place.
It's the same with 4-bit, 1-bit and SPI. I also soldered a new sd card adapter to test everything, but the issues are still the same.
I can't do ' set_flash_voltage 3.3V', when i type (without! SD Card) ' python components/esptool_py/esptool/espefuse.py --port COM3 set_flash_voltage 3.3V' i'll get
$ python components/esptool_py/esptool/espefuse.py --port COM3 set_flash_voltage 3.3V
espefuse.py v2.1-beta1
Connecting........_____....._
and thats it.
Does have 'set_flash_voltage 3.3V' and 'gpio_pullup_en(GPIO_NUM_12);' the same effect?
ESP_igrr wrote:1. and 3.
I wrote my problem two week ago on
github.
negativekelvin wrote:If you can program your board the auto reset circuit is working fine, you don't need to worry about gpio 0 and 2.
So i wired now everything together for 4-line mode. IO2 is connected to GND. I start the flashing and when it begins, i unplugged IO2 from GND and connected IO2 to D0 of the sd card adapter.
Still it's
Code: Select all
E (417) sdmmc_cmd: sdmmc_card_init: send_scr returned 0x109
E (417) example: Failed to initialize the card (265). Make sure SD card lines have pull-up resistors in place.
I added
sdmmc_host_t config = SDMMC_HOST_DEFAULT();
config.max_freq_khz = SDMMC_FREQ_PROBING; // << add this line
to my code. 'sdmmc_host_t config = SDMMC_HOST_DEFAULT();' is also new in my sd card example (newest with SPI support)), so it looks now like this
But i get
warning: variable 'config' set but not used [-Wunused-but-set-variable]
sdmmc_host_t config = SDMMC_HOST_DEFAULT();
But config is just a reference to SDMMC_HOST_DEFAULT(), so 'host.max_freq_khz = SDMMC_FREQ_PROBING;' should also work, or not?
ESP_igrr wrote:2.
See above. I can't do
set_flash_voltage 3.3V
i don't know why, but it stucks here.
Edit: Ok, i wired IO0 to IO2. Now the blue led is glowing. I don't have a IO0 Pin on my board, so i had to do it
this way.
Still no set flash voltage, but error message changed:
E (417) sdmmc_cmd: sdmmc_read_sectors: sdmmc_send_cmd returned 0x109
E (417) diskio_sdmmc: sdmmc_read_blocks failed (265)
W (417) vfs_fat_sdmmc: failed to mount card (1)
E (427) example: Failed to mount filesystem. If you want the card to be formatted, set format_if_mount_failed = true.
i set the flag to true, but thats no changing the message.
Tried another micro sd inside the sd card adapter:
E (247) diskio_sdmmc: sdmmc_read_blocks failed (263)
W (247) vfs_fat_sdmmc: failed to mount card (13)
W (247) vfs_fat_sdmmc: partitioning card
W (257) vfs_fat_sdmmc: formatting card
E (257) sdmmc_cmd: sdmmc_write_sectors: sdmmc_send_cmd returned 0x109
E (267) diskio_sdmmc: sdmmc_write_blocks failed (265)
E (267) example: Failed to mount filesystem. If you want the card to be formatted, set format_if_mount_failed = true.
Referencing to
this post, 0x109 has something to do with the pull ups.
Next Edit: Okay, somethings happens here. My circuit is still like the one thats necessary for 4-line, but i changed the sd card
Code: Select all
example code to 1 line and add
host.flags = SDMMC_HOST_FLAG_1BIT;
host.max_freq_khz = SDMMC_FREQ_PROBING;
Now i'll get
Name: SS08G
Type: SDHC/SDXC
Speed: default speed
Size: 7583MB
CSD: ver=1, sector_size=512, capacity=15529984 read_bl_len=9
SCR: sd_spec=2, bus_width=5
I (287) example: Opening file
I (447) example: File written
I (537) example: Renaming file
I (557) example: Reading file
I (577) example: Read from file: 'Hello SS08G!'
I (577) example: Card unmounted
1-bit seems to work now. Next step, 4 bit. 1 bit even works now without ' host.max_freq_khz = SDMMC_FREQ_PROBING;'
Next and last Edit: Ok. I seriously don't know what i have done.
This is my code. Set flash voltage still not works, but 'gpio_pullup_en(GPIO_NUM_12);' seems to work. Also wiring IO0 to IO2 works.
Adding
Code: Select all
// host.flags = SDMMC_HOST_FLAG_1BIT;
host.max_freq_khz = SDMMC_FREQ_PROBING;
is the rest of my solution. This works when uncommenting 1-line SD mode and in 4-line SD mode.