-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Arduino Nano ESP32 board] Reboot loop upon using Serial0 #9662
Comments
I forgot to mention that there is no problem on |
Do you have this issue if you use the vanilla esp32s3 variant rather than the Nano? |
I have an access to an ESP32-S3-EYE, I will test it later |
@zul00 - When using PlatformIO + Arduino Core 2.0.16 or 2.0.14, please add The PlatformIO ESP32 Nano board definition lacks the USB Mode and CDC on Boot necessary flags:ARDUINO_USB_MODE=1 ==> HW USB Serial JTAG interface of the S3 ARDUINO_USB_CDC_ON_BOOT=1 ==> Using this setting, CORE_DEBUG_LEVEL=5 ==> sets a debug level message output. Level: 0 to 5. For the Example from this post, this shall be the configuration:
|
I tested the configuration above, but I still got a reboot loop with a report that 10:40:19.139 > ESP-ROM:esp32s3-20210327
10:40:19.442 > Build:Mar 27 2021
10:40:19.442 > rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
10:40:19.474 > Saved PC:0x420248d6
10:40:19.474 > SPIWP:0xee
10:40:19.474 > mode:DIO, clock div:1
10:40:19.474 > load:0x3fce3808,len:0x44c
10:40:19.474 > load:0x403c9700,len:0xbe4
10:40:19.474 > load:0x403cc700,len:0x2a68
10:40:19.474 > entry 0x403c98d4
10:40:19.561 > [ 92][V][esp32-hal-ledc.c:231] analogWrite(): GPIO 46 - Using Channel 7, Value = 183
10:40:19.561 > [ 100][V][esp32-hal-ledc.c:231] analogWrite(): GPIO 0 - Using Channel 6, Value = 255
10:40:19.561 > [ 108][V][esp32-hal-ledc.c:231] analogWrite(): GPIO 45 - Using Channel 5, Value = 71
...
10:40:22.444 > [ 3006][V][esp32-hal-ledc.c:231] analogWrite(): GPIO 45 - Using Channel 5, Value = 255
10:40:22.495 > [ 3036][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
10:40:22.495 > [ 3046][V][esp32-hal-uart.c:330] uartBegin(): UART0 baud(115200) Mode(800001c) rxPin(115) txPin(0)
10:40:22.495 > [ 3055][V][esp32-hal-uart.c:416] uartBegin(): UART0 not installed. Starting installation
10:40:22.495 > ESP-ROM:esp32s3-20210327
10:40:22.828 > Build:Mar 27 2021
10:40:22.828 > rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
10:40:22.828 > Saved PC:0x420248d6
10:40:22.828 > SPIWP:0xee
10:40:22.828 > mode:DIO, clock div:1
10:40:22.828 > load:0x3fce3808,len:0x44c
10:40:22.828 > load:0x403c9700,len:0xbe4
10:40:22.828 > load:0x403cc700,len:0x2a68
10:40:22.828 > entry 0x403c98d4 What is weird is that it mentioned about initializing the uart0 on an incorrect pin. I adjusted the sketch to void setup() {
Serial0.begin(115200, SERIAL_8N1, SOC_RX0, SOC_TX0); // or
// Serial0.begin(115200, SERIAL_8N1, 44, 43);
} But the result is still the same. I am guessing that is happening before it went into the |
@zul00 - Arduino ESP32 Nano board has an exclusive pin remapping scheme Please use the pins as defined in the pinout pdf file or/and in this header file: void setup() {
Serial0.begin(115200, SERIAL_8N1, D0, D1); // or
// Serial0.begin(115200, SERIAL_8N1, RX, TX); // this also works for the ESP32 Nano
// Serial0.begin(115200, SERIAL_8N1, 44, 43); <-- remapped
} |
Thanks @SuGlider ! Now I understand that there is a remap there. So this one also works :) Serial0.begin(115200, SERIAL_8N1, 0, 1); So I think the problem with the sketch below is because in the Serial0.begin(115200); And those |
Should there be a fix? Maybe HardwareSerial can have an If you think that is a good idea, I am willing to contribute :) |
There are a few ways to fix it. The Or the mapping function shall check if the requested pin does exist and return The main problem is that the mapping function defined in the variant folder of this board returns a value from an array, but the array max number of items is shorter than 43 or 44 (Rx/Tx real pins), causing it to return trash values for the "pins" out of the array range. |
Looks this ticket was already answered, closing. If needed, you can reopen it. |
Board
Arduino Nano ESP32
Device Description
Default devkit from Arduino
Hardware Configuration
The UART0 bus is connected to an FTDI serial adapter
Version
latest master (checkout manually)
IDE Name
PlatformIO
Operating System
Ubuntu 22.04
Flash frequency
240Mhz
PSRAM enabled
yes
Upload speed
115200
Description
My platform was on espressif32@6.7.0 which uses arduino@2.0.16.
When using the setup above I got a reboot loop upon using Serial0, I expect there is no reboot loop.
Below is the message that was captured from UART0 port
However, if I downgraded the platform to espressif32@6.6.0 which uses arduino@2.0.14, it works as expected.
I am new to both Arduino and PlatformIO, so let me know if I posted in the correct repository.
Thanks,
Zul
Sketch
PlatformIO configuration
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: