jomjol / AI-on-the-edge-device

Easy to use device for connecting "old" measuring units (water, power, gas, ...) to the digital world
https://jomjol.github.io/AI-on-the-edge-device-docs/
5.67k stars 612 forks source link

Failed to initialize the card (ESP_ERR_INVALID_CRC) and GPIO2 #197

Closed paszczus closed 3 years ago

paszczus commented 3 years ago

Hello, I have bought 2 pieces of ESP32-CAM and flash first of it without any problems. I have a problem with second one. First problem was that i was unable to flash it same as first one (by doing connection between GND and GPIO2). I also need to make a connection between GPIO2 and GND. After that i was able to flash it, hurray! But there is another problem. I am unable to boot because of ESP_ERR_INVALID_CRC on SD-Card. It's exactly the same card which is working fine with first piece of ESP32-CAM. I was trying also another SD-card with same error. I found some solutions like Setting DTR=1 RTS=1 or DTR=0 and RTS=0 or changing SDMMC_FREQ_DEFAULT from 20000 to 5000. Is there something that can be done @jomjol or it's hardware problem and i should replace it ?

jomjol commented 3 years ago

Sound strongly for a hardware problem. Two thinks:

  1. You should connect GPIO0 to GND and not GPIO2 - typo here?
  2. Maybe you can post the serial output during bootup, that might give some more hints.
paszczus commented 3 years ago
  1. Yes, sorry. GPIO0 + GND and GPIO2 + GND for flashing mode
  2. [1B][0;32mI (253) esp_image: segment 1: paddr=0x00055968 vaddr=0x3ffb0000 size=0x03fac ( 16300) load[1B][0m [1B][0;32mI (261) esp_image: segment 2: paddr=0x0005991c vaddr=0x40080000 size=0x00404 ( 1028) load[1B][0m [1B][0;32mI (261) esp_image: segment 3: paddr=0x00059d28 vaddr=0x40080404 size=0x062f0 ( 25328) load[1B][0m [1B][0;32mI (281) esp_image: segment 4: paddr=0x00060020 vaddr=0x400d0020 size=0x144868 (1329256) map[1B][0m [1B][0;32mI (856) esp_image: segment 5: paddr=0x001a4890 vaddr=0x400866f4 size=0x159b4 ( 88500) load[1B][0m [1B][0;32mI (915) boot: Loaded app from partition at offset 0x10000[1B][0m [1B][0;32mI (915) boot: Disabling RNG early entropy source...[1B][0m [1B][0;32mI (916) psram: This chip is ESP32-D0WD[1B][0m [1B][0;32mI (920) spiram: Found 64MBit SPI RAM device[1B][0m [1B][0;32mI (925) spiram: SPI RAM mode: flash 40m sram 40m[1B][0m [1B][0;32mI (930) spiram: PSRAM initialized, cache is in low/high (2-core) mode.[1B][0m [1B][0;32mI (938) cpu_start: Pro cpu up.[1B][0m [1B][0;32mI (941) cpu_start: Application information:[1B][0m [1B][0;32mI (946) cpu_start: Project name: esp32cam-server-only[1B][0m [1B][0;32mI (952) cpu_start: App version: 0.0.9.3[1B][0m [1B][0;32mI (957) cpu_start: Compile time: Apr 23 2021 07:11:49[1B][0m [1B][0;32mI (963) cpu_start: ELF file SHA256: 7e20672ca0a05801...[1B][0m [1B][0;32mI (969) cpu_start: ESP-IDF: 3.40100.200827[1B][0m [1B][0;32mI (975) cpu_start: Starting app cpu, entry point is 0x40081868[1B][0m [1B][0;32mI (0) cpu_start: App cpu up.[1B][0m [1B][0;32mI (1873) spiram: SPI SRAM memory test OK[1B][0m [1B][0;32mI (1873) heap_init: Initializing. RAM available for dynamic allocation:[1B][0m [1B][0;32mI (1873) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM[1B][0m [1B][0;32mI (1879) heap_init: At 3FFC0D70 len 0001F290 (124 KiB): DRAM[1B][0m [1B][0;32mI (1886) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM[1B][0m [1B][0;32mI (1892) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM[1B][0m [1B][0;32mI (1899) heap_init: At 4009C0A8 len 00003F58 (15 KiB): IRAM[1B][0m [1B][0;32mI (1905) cpu_start: Pro cpu start user code[1B][0m [1B][0;32mI (1910) spiram: Adding pool of 4096K of external SPI memory to heap allocator[1B][0m [1B][0;32mI (1935) spi_flash: detected chip: generic[1B][0m [1B][0;32mI (1935) spi_flash: flash io: dio[1B][0m [1B][0;32mI (1935) cpu_start: Starting scheduler on PRO CPU.[1B][0m [1B][0;32mI (0) cpu_start: Starting scheduler on APP CPU.[1B][0m [1B][0;32mI (1943) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations[1B][0m [1B][0;32mI (1963) server-main: Using SDMMC peripheral[1B][0m [1B][0;31mE (2163) sdmmc_sd: sdmmc_init_sd_scr: send_scr (1) returned 0x109[1B][0m [1B][0;31mE (2163) server-main: Failed to initialize the card (ESP_ERR_INVALID_CRC). Make sure SD card lines have pull-up resistors in place.[1B][0m SD-Card could not be inialized - STOP THE PROGRAMM HERE

paszczus commented 3 years ago

And here is output from working one:

[1B][0;32mI (1983) server-main: Using SDMMC peripheral[1B][0m Name: SD
Type: SDHC/SDXC Speed: 20 MHz Size: 30159MB [1B][0;32mI (2423) server_ota: Start CheckOTAUpdateCheck ...[1B][0m Start CheckOTAUpdateCheck ... [1B][0;32mI (2433) server_ota: SHA-256 for the partition table: : 9d4a2809ae90fb20709a8ca3dd3ac3462e1e73286bcd31b689060c91de06fa3a[1B][0m [1B][0;32mI (2493) server_ota: SHA-256 for bootloader: : b69ec5faa77b3a984bf51f6e2d45c58afdbd88c49a2e7074aa7b225fb625f330[1B][0m [1B][0;32mI (3033) server_ota: SHA-256 for current firmware: : 5837012484620ec00a3915b89772ec38d5b78394b54e38552a24998e4484e048[1B][0m

jomjol commented 3 years ago

You have a problem with the SD-card. You could test to format it again and then copy the data again. Some guys have told, that formating under Linux is working better than windows, this I cannot confirm up to now

paszczus commented 3 years ago

As i said, SAME card is working fine on same ESP32-CAM with same firmware and i have tested this on two SD-cards.

paszczus commented 3 years ago

...but i will format it under Linux and let you know ;-)

jomjol commented 3 years ago

Sorry, did not have your comment in mind. Than I suppose a hardware error. But anyway, I'm curious on your result.

jomjol commented 3 years ago

No further update - please reopen if needed

paszczus commented 3 years ago

Hi. I have ordered 3 new devices and all of them are working fine so that one from this thread is definitely broken. I have formatted sd card from linux as well but this didn't help for that problem.