Boot Loop on ESP32-S3
Posted: Tue Sep 13, 2022 1:24 pm
In troubleshooting a USB problem, I've somehow stumbled into a condition that I don't know how to recover from.
I'm using an ESP32-S3-DevKitC bare, nothing connected but a USB cable to UART connector. VSCode, PlatformIO, Arduino framework.
After flashing, I get the following infinite loop on the USB console:
```
ELF file SHA256: 0000000000000000
Rebooting...
�ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x18 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40376b40
SPIWP:0xee
Octal Flash Mode Enabled
For OPI Flash, Use Default Flash Boot Mode
mode:SLOW_RD, clock div:1
load:0x3fce3808,len:0x43c
load:0x403c9700,len:0xbec
load:0x403cc700,len:0x2a3c
SHA-256 comparison failed:
Calculated: dcde8d8a4817d9bf5d5d69a7247667264e4e10ac7493514868b61f5aa6146539
Expected: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
Attempting to boot anyway...
entry 0x403c98d8
assert failed: do_core_init startup.c:298 (flash_ret == ESP_OK)
Backtrace:0x40376f36:0x3fceb1800x40379ce9:0x3fceb1a0 0x4037f2a5:0x3fceb1c0 0x42009292:0x3fceb2f0 0x403768a1:0x3fceb320 0x403cd6ef:0x3fceb350 0x403cd9ae:0x3fceb380 0x403c992d:0xD
```
My platformio.ini:
```
[env]
framework = arduino
platform = espressif32
build_unflags = -Os
build_flags =
-DDEBUG_MODE
-Wswitch
-O3
-mlongcalls
debug_init_break = tbreak setup
lib_extra_dirs =
~/git/libraries/
[env:esp32-s3]
platform = https://github.com/platformio/platform-espressif32.git
board = esp32-s3-devkitc-1
debug_init_break = tbreak setup
debug_tool = custom
debug_server =
/home/michalk/git/openocd-esp32/src/openocd
-s
/home/michalk/git/openocd-esp32/tcl/
-f
/home/michalk/git/openocd-esp32/tcl/board/esp32s3-builtin.cfg
build_flags =
${env.build_flags}
```
My source code:
```
#include "Arduino.h"
#define SerialUART Serial
#define SerialCDC USBSerial
void setup() {
SerialUART.begin(115200);
SerialUART.println("SerialUART: Hello World!");
}
void loop() {
SerialUART.print("SerialUART ");
SerialUART.println(millis());
delay(500);
}
```
I'm using an ESP32-S3-DevKitC bare, nothing connected but a USB cable to UART connector. VSCode, PlatformIO, Arduino framework.
After flashing, I get the following infinite loop on the USB console:
```
ELF file SHA256: 0000000000000000
Rebooting...
�ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x18 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40376b40
SPIWP:0xee
Octal Flash Mode Enabled
For OPI Flash, Use Default Flash Boot Mode
mode:SLOW_RD, clock div:1
load:0x3fce3808,len:0x43c
load:0x403c9700,len:0xbec
load:0x403cc700,len:0x2a3c
SHA-256 comparison failed:
Calculated: dcde8d8a4817d9bf5d5d69a7247667264e4e10ac7493514868b61f5aa6146539
Expected: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
Attempting to boot anyway...
entry 0x403c98d8
assert failed: do_core_init startup.c:298 (flash_ret == ESP_OK)
Backtrace:0x40376f36:0x3fceb1800x40379ce9:0x3fceb1a0 0x4037f2a5:0x3fceb1c0 0x42009292:0x3fceb2f0 0x403768a1:0x3fceb320 0x403cd6ef:0x3fceb350 0x403cd9ae:0x3fceb380 0x403c992d:0xD
```
My platformio.ini:
```
[env]
framework = arduino
platform = espressif32
build_unflags = -Os
build_flags =
-DDEBUG_MODE
-Wswitch
-O3
-mlongcalls
debug_init_break = tbreak setup
lib_extra_dirs =
~/git/libraries/
[env:esp32-s3]
platform = https://github.com/platformio/platform-espressif32.git
board = esp32-s3-devkitc-1
debug_init_break = tbreak setup
debug_tool = custom
debug_server =
/home/michalk/git/openocd-esp32/src/openocd
-s
/home/michalk/git/openocd-esp32/tcl/
-f
/home/michalk/git/openocd-esp32/tcl/board/esp32s3-builtin.cfg
build_flags =
${env.build_flags}
```
My source code:
```
#include "Arduino.h"
#define SerialUART Serial
#define SerialCDC USBSerial
void setup() {
SerialUART.begin(115200);
SerialUART.println("SerialUART: Hello World!");
}
void loop() {
SerialUART.print("SerialUART ");
SerialUART.println(millis());
delay(500);
}
```