I am trying to program a custom ESP32-S3-WROOM-1 chip. I have connected a GY-91 sensor to it, and I’m trying to program the ESP32 to read the data from the sensor and print it in the serial monitor. However, whenever I run the code, I get the following error:
40380fa5:0x3fceb1b0 0x4200be8d:0x3fceb2e0 0x40376bf7:0x3fceb310 570 0x40043ab6:0x3fceb6f0 0x40034c45:0x3fceb710
ELF file SHA256: c7918c183e8b6165
E (178) esp_core_dump_flash: Core dump flash config is corrupted! CRC=0x7bd5c66f instead of 0x0
E (186) esp_core_dump_elf: Elf write init failed!
E (191) esp_core_dump_common: Core dump write failed with error=-1
Rebooting...
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x2b (SPI_FAST_FLASH_BOOT)
Saved PC:0x40376f21
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3818,len:0xf88
load:0x403c9700,len:0x4
load:0x403c9704,len:0xa14
load:0x403cc700,len:0x2d64
entry 0x403c988c
E (102) spi_flash: Detected size(8192k) smaller than the size in the binary image header(16384k). Probe failed.
assert failed: do_core_init startup.c:350 (flash_ret == ESP_OK)
Is this an error with the code, or is there something wrong with my settings?
Sketch uses 301273 bytes (22%) of program storage space. Maximum is 1310720 bytes.
Global variables use 18624 bytes (5%) of dynamic memory, leaving 309056 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.6
Serial port COM3
Connecting...
Chip is ESP32-S3 (revision v0.2)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 3c:84:27:fd:c6:bc
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00004fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00059fff...
Compressed 18272 bytes to 12149...
Writing at 0x00000000... (100 %)
Wrote 18272 bytes (12149 compressed) at 0x00000000 in 0.3 seconds (effective 498.8 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 146...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.0 seconds (effective 538.6 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 706.7 kbit/s)...
Hash of data verified.
Compressed 301632 bytes to 170709...
Writing at 0x00010000... (9 %)
Writing at 0x0001bddd... (18 %)
Writing at 0x00024474... (27 %)
Writing at 0x00029df6... (36 %)
Writing at 0x0002f478... (45 %)
Writing at 0x0003491e... (54 %)
Writing at 0x00039f60... (63 %)
Writing at 0x000428a1... (72 %)
Writing at 0x0004c2eb... (81 %)
Writing at 0x00051aa9... (90 %)
Writing at 0x00057320... (100 %)
Wrote 301632 bytes (170709 compressed) at 0x00010000 in 2.0 seconds (effective 1189.2 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
It sure looks like a wrong flash memory size. Have you tried uploading a simple program using a different machine definition, such as a generic ESP32-S3 Dev Module, with memory selected as 8Mb? Also, try setting “Erase All Flash Before Sketch Upload” to enabled (provided you don’t have anything important stored in flash).
Lots of threads including ones on ESP website say to try a full chip erase. I see in your log it only erased the bits it was going to use.
I dont use Arduino, so not sure what options you have.
if you have the esptools then…
esptool.py erase_flash
But their may be a better way.
For testing with a simple sketch it probably doesn’t matter much, but you should have ‘ESP32S3 Dev Module’. I don’t know of a way to work back from an installed definition to look up the original source, but I believe that the generic ESP32 S3 is at: Installing - - — Arduino ESP32 latest documentation
That’s a default boot message for an alternative upload tool.
Can you confirm that you have set “USB CDC on Boot” to ‘Enabled’? It was enabled by default for the other machine definition but it might not be enabled for the default S3, and I think your model requires it.
To be honest I will leave an official version to someone that knows. I would need to read up to confirm.
that said, pending a more official response, my best guess would be:
Enabling the USB CDC on boot would be telling the ESP32 to use the “USB” port as a CDC compatible device. Your framework would then use that CDC protocol/method to flash the firmware and allow the serial debugging etc.
While the Serial Debugging my support other methods and you computer auto detected the correct com port, it may have caused the actual flashing of the firmware to not work as intended, thus corrupt firmware flash = not working as expected.
My understanding is that, for those devices that do not have a dedicated USB device on board, the MCU has to be told to go into USB Serial mode. This is similar to an earlier procedure that involved holding certain GPIO pins high or low in order for the board to distinguish between programming mode and execution mode at startup. The configuration command is required because the USB GPIO pins are not dedicated to USB, but are available (when not downloading) for any serial communication, or, in the case of configurable GPIO, for any other purpose.
You’re bang on, with USB CDC enabled serial for the device is the on board USB CDC port, otherwise in the case of the ESP32 S3 it will default to serial being UART0