Broken EEPROM ESP32 cam ai thinker

I have esp32 ai thinker cam. There is a code, which runs a qr scanner on camera and outputs the decoded qr value.. I modified it and it was writting into eeprom. Then I created a function to clear the whole (EEPROM.length()) memory and after it if I reset the chip I see this:

assert failed: insert_free_block heap_tlsf.c:233 (current && "free list cannot have a null entry")

The meaning:

  1. The chip ups
  2. Is there a wifi auth string in eeprom?
  3. if yes - connect to wifi
  4. if not - scan qr
  5. if decoded qr - write into eeprom and next time provide this auth string instead of scanning again
  6. if clicked on button(digital write) - clear the eeprom memory and scan qr again(lets say user went to restourant and wants to scan its qr)

The code is really big, let me know which part would you need to be able to help me

What I've tried:

  1. Burn bootloader
  2. Erase everything with ESP Tool
  3. erase and burn
  4. burn and erase
  5. Played with partitioning

I knew, that EEPROM is only for me, like the soft will use a dynamic data and eeprom is just a storage for me, but when I wrote 0 to all addresses, my qr scanner stopped to work and the chip reboots endless

This is the whole error

01:10:27.693 -> ets Jul 29 2019 12:21:46
01:10:27.693 -> 
01:10:27.693 -> rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
01:10:27.726 -> configsip: 0, SPIWP:0xee
01:10:27.726 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
01:10:27.726 -> mode:DIO, clock div:2
01:10:27.726 -> load:0x3fff0030,len:1184
01:10:27.726 -> load:0x40078000,len:13232
01:10:27.726 -> load:0x40080400,len:3028
01:10:27.726 -> entry 0x400805e4
01:10:27.918 -> [    18][D][esp32-hal-cpu.c:244] setCpuFrequencyMhz(): PLL: 480 / 2 = 240 Mhz, APB: 80000000 Hz
01:10:28.368 -> [   461][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
01:10:28.368 -> 
01:10:28.368 -> auth not found
01:10:28.496 -> 
01:10:28.496 -> assert failed: insert_free_block heap_tlsf.c:233 (current && "free list cannot have a null entry")
01:10:28.496 -> 
01:10:28.496 -> 
01:10:28.496 -> Backtrace: 0x40083755:0x3ffc82d0 0x4008a035:0x3ffc82f0 0x4008f7bd:0x3ffc8310 0x4008e928:0x3ffc8440 0x4008f1d1:0x3ffc8470 0x4008f37c:0x3ffc8490 0x40083dba:0x3ffc84b0 0x400e1d89:0x3ffc84d0 0x400e1861:0x3ffc8510 0x400d2282:0x3ffc8560 0x400d2332:0x3ffc8580 0x400d405e:0x3ffc85d0
01:10:28.528 -> 
01:10:28.528 -> 
01:10:28.528 -> 
01:10:28.528 -> 
01:10:28.528 -> ELF file SHA256: 9ce610d535ced5b8
01:10:28.528 -> 
01:10:28.560 -> Rebooting...

(if auth not found, it'll try to scan QR via camera, and the error is when trying to scan)

UPDATE

During debugging I found that:

  1. there is a call of built-in func esp_camera_init
  2. Serial output before is showing
  3. After it I have this error

So the error in this function

Have you considered using FRAM, it can be gotten as SPI, I2C or parallel. It is non volatile memory that works at processor speeds, no delays. 32K x 8 for a few dollars.

No, I havn't. But the question is about eeprom. How could I fix it

I do not know of any ESP32 devices that have an internal EEPROM memory at all. It is pseudo EEPROM which is is saved in a location in the external (generally) FLASH.

This is explained in the manual and several forums. In the ESP32 EEPROM is non existent but simulated in RAM and saved in flash. You need to commit the EEPROM to flash with this statement"
EEPROM.commit();, for more information check ESP32 Flash Memory - Save Permanent Data | Random Nerd Tutorials

1 Like

I tried to restore it somehow and tried to write -1 to each item, 0 to each item and so on. Something was broken when I ran first time eeprom.write(i, 0) eeprom.commit()
after it nothing works. Do you have any idea, what do I need to write in "eeprom" so my soft starts to work?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.