1

I have ESP32-CAM that I plan to use as a simple security camera. I tested the software and it was working perfectly. I programmed it using FTDI programming board with 5V. After testing everything I decided to power it with an old adapter (5V 160mA) I had for some time but when I powered with adapter the power started flickering. When I noticed it I immediately unplugged the adapter but since then I started getting stuck in bootloop. Here is the output I get:

12:56:10.663 -> ets Jul 29 2019 12:21:46
12:56:10.667 -> 
12:56:10.667 -> rst:0x1 (POWERON_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
12:56:10.667 -> waiting for download
12:56:49.327 -> ets Jul 29 2019 12:21:46
12:56:49.327 -> 
12:56:49.327 -> rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
12:56:49.327 -> configsip: 0, SPIWP:0xee
12:56:49.327 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
12:56:49.327 -> mode:DIO, clock div:2
12:56:49.327 -> load:0x3fff0030,len:1344
12:56:49.327 -> load:0x40078000,len:13836
12:56:49.327 -> load:0x40080400,len:3608
12:56:49.327 -> entry 0x400805f0
12:56:50.707 -> ets Jul 29 2019 12:21:46
12:56:50.707 -> 
12:56:50.707 -> rst:0x8 (TG1WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
12:56:50.707 -> configsip: 0, SPIWP:0xee
12:56:50.707 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
12:56:50.707 -> mode:DIO, clock div:2
12:56:50.707 -> load:0x3fff0030,len:1344
12:56:50.707 -> load:0x40078000,len:13836
12:56:50.707 -> load:0x40080400,len:3608
12:56:50.707 -> entry 0x400805f0
12:56:52.086 -> ets Jul 29 2019 12:21:46
12:56:52.086 -> 
12:56:52.086 -> rst:0x8 (TG1WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
12:56:52.086 -> configsip: 0, SPIWP:0xee
12:56:52.086 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
12:56:52.086 -> mode:DIO, clock div:2
12:56:52.086 -> load:0x3fff0030,len:1344
12:56:52.086 -> load:0x40078000,len:13836
12:56:52.086 -> load:0x40080400,len:3608
12:56:52.086 -> entry 0x400805f0

It keeps going like this. I can upload new code without any problems but every code I upload gets stuck in this exact bootloop. Load and entry adresses does not change. I also tried programming with arduino nano instead of ftdi but nothing changed.

I am using Arduino IDE 2.0.0 on Linux Mint 21 OS. I also tried it on Windows 10 but the results didn't change. I am quite new to ESP32 so I don't know how to debug it either.

Thanks in advance.

##############

UPDATE 25/10/2022

After timemage's comment I tried a few more codes and one of arduino ide's example codes ran once with error. I couldn't get the error log but there was something like "PSRAM ID Read error 0xffffff" and another log pointing to a corrupted address.

After that I tried uploading another sketch without PSRAM with following settings:

  • Board: ESP32 Dev Module
  • CPU frequency: 240MHz(WiFi/BT)
  • Events run on: Core 1
  • Flash frequency: 80MHz
  • Flash mode: QIO
  • Flash size: 4MB(32Mb)
  • Arduino runs on: Core 1
  • PSRAM: Disabled
  • Partition scheme: Huge APP(3MB No OTA/1MB SPIFFS)
  • Upload speed: 115200

and it worked. But I need PSRAM for my project. So my question is: can it be a hardware problem ? If not, how can I fix it ?

Thanks again.

5
  • "every code I upload gets stuck in this exact bootloop" This holds true if that new code is just a blink sketch or hello world on serial?
    – timemage
    Oct 24, 2022 at 17:21
  • @timemage It holded true for every sketch I tried so far. But after your comment I tried more sketches and made some more progress and edited my question, so thanks. Oct 25, 2022 at 20:27
  • Selecting "AI Thinker ESP32-CAM" doesn't expose the menu option called "PSRAM". You say "tried uploading another sketch without PSRAM" This makes me wonder: What board have you been selecting? If not the AI Thinker ESP32-CAM, what happens when you switch to it? Were you using AI Thinker board and then switched to a generic option just so that you'd be able to test with PSRAM set to "Disabled"?
    – timemage
    Oct 25, 2022 at 20:55
  • @timemage I selected "ESP32 Dev Module". Added details about configurations to question. Oct 26, 2022 at 15:55
  • It is starting to look like damage. I took your custom settings and tested them on a ESP32-CAM with nothing attached and did not get your boot loop. The PSRAM chip is not under the RF shield, which makes it comparatively replaceable. If it were me, I might consider probing the PSRAM chip from another board, but it's not clear how to do that with the the ESP32 in reset, because the SPI FLASH chip on the same bus is not pulled to inactive and that contact is not exposed. Hopefully someone else has a better idea of what if anything to try next.
    – timemage
    Oct 26, 2022 at 19:53

4 Answers 4

1
  1. Is your esp32_cam comes with PSRAM? I had a program running on esp32 wrover with PSRAM, the same code could not run on esp32 wroom. After checking, the esp32 wroom does not come with PSRAM.

  2. Say that the esp32_cam does come with PSRAM, how do you initilize it?

  3. My code has ISR to force shutdown after 15min of wakeup from deep sleep, I will get the same error with reset when there is a while loop or for loop, and i missed these 2 line of codes. vTaskDelay( 3 / portTICK_PERIOD_MS ); esp_task_wdt_reset();

hopefully, this helps.

0

I got the same "rst:0x8 (TG1WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)" and crash when using the M5stack-Timer-Camera after doing a "SerialM.setDebugOutput(true);" then starting the camera with "camera_init()" and then doing an "EEPROM.commit".

When I remove the "SerialM.setDebugOutput(true);" the error/crash goes away and instead I just get a (Serial-Terminal) warning of "cam_hal: EV-EOF-OVF" when doing an "EEPROM.commit".

So in my case I suspect that the "SerialM.setDebugOutput(true)" was causing the "cam_hal: EV-EOF-OVF" error message to crash during the "EEPROM.commit".

0

From my personal experience working with the ESP-CAM's ESP32-s3 chip, the particular error is the result of an invalid line of code.

The best way to address this is to look very closely at the code that you've written, for some of the errors you may introduce through the arduino ide may not be caught in the compilation process.

For example, I was building out a UART shell using the same processor.

My code was producing the same error because of this code here:

private:
    size_t commandsLen = 1;
    string commands[1]{
        "lcdcam"
    };

I was able to fix the reset loop by correcting the syntax in my string array. Which was missing an equals sign.

The following modification fixed my particular issue, and odds are that your problem is syntax related like mine.

private:
    size_t commandsLen = 1;
    string commands[1] = {
        "lcdcam"
    };

Edit: Upon further inspection, there was an additional issue that also caused this error.

Take the following code into consideration:

public:
    bool commandSwitch(Uart uart, BosCommand cmd){
        if(cmd.getCommandLength() <= 0){
            sendOutput(uart, "Failed to find commands.\n\r");
            return false;
        }
        string target = cmd.getCommandArg(0);
 
        if(target == "lcdcam"){
            BosCommandSwitch targetCmd;
            targetCmd.init(uart, cmd);
            return targetCmd.process();
        }else{  
           // removed                
        }
        return false;
    }

The issue is that the processor doesn't like it when I declare the BosCommandSwitch class inside the if logic. Not only did fixing the string array correct the reset bug, but moving the declaration of the class object up into the private section of my class allowed all my code to run without the automated reset.

private:
    BosCommandSwitch targetCmd;
public:
    bool commandSwitch(Uart uart, BosCommand cmd){
        if(cmd.getCommandLength() <= 0){
            sendOutput(uart, "Failed to find commands.\n\r");
            return false;
        }
        string target = cmd.getCommandArg(0);
 
        if(target == "lcdcam"){
            targetCmd.init(uart, cmd);
            return targetCmd.process();
        }else{  
           // removed                
        }
        return false;
    }

I believe that the issue is related to memory allocation. Once you get deep into logic, you reduce the amount of available memory in a particular region. Though this is just speculation on my part.

-1

I had a similar problem when running test code for a data input module based on the NodeMCU-32s board. The board would reset about once per second with that same error. That turned out to be my error. I had confused the physical pin number of the board with the GPIO number. I am assuming that trying to read GPIO pins that are not routed to the chip pins was still accessing internal registers, and was enough to initialize the watchdog timer. Since I was otherwise doing nothing to the watchdog, (like resetting it frequently,) the watchdog was properly doing its job and resetting the part. This wasn't obvious to me. In the Arduino environment, setting Tools->Core Debug Level to Verbose gave some clues. Turning off some of my use of GPIO inputs also got me to a point where the watchdog error stopped, and from there I was able to proceed. So long story shorter, I recommend checking your pin assignments for IO!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.