I’m encountering an interesting phenomenon with the UART on the ESP32-S3-DevKitC-1-N16R8.
I’ve already found a practical solution, so I’m not stuck in a situation where I can’t find a way out.
However, I don’t fully understand why this phenomenon occurs.
(I’ve discussed this with my AI, Claude, but we haven’t reached a conclusion yet.)
Could someone please explain?
[Problem]
The following is a very simple test program.
Building and loading the program works without problems.
-
During setup() execution, it generates a “Guru Meditation Error: Core 1 panic’ed (Interrupt wdt timeout on CPU1),” restarts, and then repeats.
-
Using HardwareSerial UART1(2); does not cause the problem.
I understand that when using the Arduino framework with the ESP32-S3, there are two objects by default: Serial1(1) and Serial2(2).
However, even though the fundamental issue is that “the same hardware resource is being referenced by different objects,” the problem persists in Serial1 while it doesn’t occur in Serial2. This is something I don’t fully understand.
====main.cpp====
#include <Arduino.h>
HardwareSerial UART1(1);
//#define UART1 Serial1
void setup()
{
UART1.begin(115200,SERIAL_8N1,7,6);
}
void loop()
{
}
====platformio.ini====
[env:esp32-s3-devkitc1-n16r8]
platform = espressif32
board = esp32-s3-devkitc1-n16r8
framework = arduino
====Build log excerpt====
Verbose mode can be enabled via
-v, --verboseoption
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-s3-devkitc1-n16r8.html
PLATFORM: Espressif 32 (55.3.35) > Espressif ESP32-S3-DevKitC-1-N16R8V (16 MB Flash Quad, 8 MB PSRAM Octal)
HARDWARE: ESP32S3 240MHz, 320KB RAM, 16MB Flash
DEBUG: Current (esp-builtin) On-board (esp-builtin) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- contrib-piohome @ 3.4.4
- framework-arduinoespressif32@3.3.5
- framework-arduinoespressif32-libs @5.5.0+sha.9bb7aa84fe
- tool-esptoolpy @ 5.1.0
- tool-mklittlefs @ 3.2.0
- toolchain-xtensa-esp-elf @ 14.2.0+20251107
LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 43 compatible libraries
Scanning dependencies…
No dependencies
Building in release mode
Compiling .pio/build/esp32-s3-devkitc1-n16r8/src/main.cpp.o
[Related Information]
Although it’s not a simple matter because the hardware is different,
the exact same main.cpp worked without any problems on the XIAO-ESP32-C3.
[Current Solution]
A: Use
HardwareSerial UART1(2); // if you can use UART #2
B: Use the default Serial1 as is.
If you don’t want to use the name Serial1 and insist on using UART1, use the following:
#define UART1 Serial1