ESP32 stuck in boot and then randomly continues

Hello all,

I bought a CYD (2.4inch_ESP32-2432S024 by Shenzhen Jingcai) from a 3rd party supplier since I had some remaining credit on the website: now I want to try and implement some IoT features with it.
It is very well documented and has a ton of demo sketches to use with the Arduino IDE (my preferred IDE).

I’m trying (and was successful) to connect my ESP32 to my wifi network, but the manner in which has raised questions:

When downloading the sketch (Just pressing upload, not pressing anything on the board: arduino runs through it without problems) the serial monitor will repeat the boot message for 20 minutes after which it suddenly executes the program and starts searching for the wifi network… Why would my ESP32 be stuck in a boot loop and then randomly come out of it? (it says “boot:0x13”, but according to the schematic it is connected to IO0/ pin25, could that also be a problem?)

A different program running the LED light does not do this, and executes normally (1x boot message).

This is the message on the serial monitor:

16:18:14.665 -> rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
16:18:14.707 -> configsip: 0, SPIWP:0xee
16:18:14.707 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
16:18:14.707 -> mode:DIO, clock div:1
16:18:14.707 -> load:0x3fff0030,len:4744
16:18:14.707 -> load:0x40078000,len:15672
16:18:14.707 -> load:0x40080400,len:3152
16:18:14.707 -> entry 0x4008059c
16:18:20.070 -> ets Jul 29 2019 12:21:46
... (repeats until:)
16:37:07.108 -> rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
16:37:07.108 -> configsip: 0, SPIWP:0xee
16:37:07.108 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
16:37:07.108 -> mode:DIO, clock div:1
16:37:07.108 -> load:0x3fff0030,len:4744
16:37:07.108 -> load:0x40078000,len:15672
16:37:07.108 -> load:0x40080400,len:3152
16:37:07.108 -> entry 0x4008059c
16:37:13.550 -> -------------------------Waiting for automatic network configuration...

This is the Github for the CYD

Code ran on Arduino IDE 2.3.6 with ESP32 v3.3.0.
”Tools” settings as per instruction from the github.

#include <Arduino.h>
#include "WiFi.h"

void mySmartWifiConfig()
{
  WiFi.mode(WIFI_MODE_STA);
  Serial.println("-------------------------Enable smart distribution network:");
  WiFi.beginSmartConfig();
  while (1)
  {
    Serial.print(".");
    delay(500);
    if (WiFi.smartConfigDone())
    {
      Serial.println("-------------------------Network configuration successful");
      Serial.printf("-------------------------SSID:%s", WiFi.SSID().c_str());
      Serial.printf("-------------------------PSW:%s", WiFi.psk().c_str());
      break;
    }
  }
}

bool autoConfig()
{
  WiFi.disconnect(true,true);
  WiFi.begin();
  for (size_t i = 0; i < 20; i++)
  {
    int wifiStatus = WiFi.status();
    if (wifiStatus == WL_CONNECTED)
    {
      Serial.println("-------------------------Automatic connection successful!");
      return 1;
    }
    else
    {
      delay(1000);
      Serial.println("-------------------------Waiting for automatic network configuration...");
    }
  }
  Serial.println("-------------------------Unable to automatically configure the network!");
  return 0;
}

void setup()
{
  Serial.begin(115200);
  delay(5000);
  if (!autoConfig())
  {
    mySmartWifiConfig();
  }
}
void loop()
{
  if (WiFi.isConnected())
  {
    Serial.println("-------------------------Network connected");
    delay(1000);
  }
}

I grabbed a DOIT esp32 board loaded and ran your sketch. what do you mean by

Here is my output

My board has no wires connected only the USB.

0x13 is not a pin number, but a boot status value. 0x13 is a value indicating a normal boot.

https://docs.espressif.com/projects/esptool/en/latest/esp32/advanced-topics/boot-mode-selection.html

BTW, the Github link is invalid. Just gives me a 404 error.

I see, the github has been taken down since I last visited it. I have the zip on my computer, but unsure how to share it here.

I mean that the schematic puts it on GPIO0, being pin 25 of ESP32 processor. I’ve heard that something like that could cause problems, but I’m unsure.

I see that your serial monitor says “rst:0x1 (POWERON_RESET)” as opposed to my “rst:0x3 (SW_RESET)”. Hmmm.. Could it be that my board doesn’t reset and stays in bootloop after upload..? I’m not that familiar with booting sequences.

That is most likely your problem. Show the settings being used here with a screen grab.

These are the schematics from the zip-file (the github is down).

These are the settings that come recommended and that I’ve also used:

What are you talking about? have NO wires on the board. Why would I? If you have added some jumpers to the board remove them and try again.

I haven’t connected jumpers either but it’s a CYD (cheap yellow display: pre-soldered buttons and LCD touch display)

Either way: I’ve tried plugging it back in 4 times already to recreate the boot sequence but now it does it after just 1 boot message… I still wonder what the problem was but at least it seems to run consistent right now.

EDIT after 8h: And just like that it’s back (even when using another cable).

Hi, we also encountered this problem and found that the boot loop problem disappears if we downgrade the esp32 board to v3.2.1. The v3.3.0 probably has a hidden bug.

I had a similar problem. Those settings fixed the problem: FLASH MODE : DIO , Flash frequency : 40MHz, upload speed: 115200.