arduino-esp32 icon indicating copy to clipboard operation
arduino-esp32 copied to clipboard

Serial2 wont work.

Open khryssmar opened this issue 10 months ago • 6 comments

Board

ESP32-WROOM-32D

Device Description

Breadboard.

Hardware Configuration

IO17 and IO16 to GPS.

Version

latest master (checkout manually)

IDE Name

Arduino

Operating System

Windows 10

Flash frequency

80Mhz

PSRAM enabled

yes

Upload speed

921600

Description

I am using Serial2 to connect to UBX Neo6m. After 2.0.15, it doesnt work anymore.

Sketch

Serial passthrough

Debug Message

NA

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • [X] I confirm I have checked existing issues, online documentation and Troubleshooting guide.

khryssmar avatar Apr 13 '24 14:04 khryssmar

@khryssmar - please provide more information and a simple sketch that can be used to reproduce the issue.

Thanks in advance.

SuGlider avatar Apr 13 '24 15:04 SuGlider

A quick test reports that Serial2 is using pins 4 and 25 by default... I'll investigate it.

ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13964
load:0x40080400,len:3600
entry 0x400805f0
[     4][D][esp32-hal-cpu.c:244] setCpuFrequencyMhz(): PLL: 480 / 2 = 240 Mhz, APB: 80000000 Hz
[    37][V][esp32-hal-uart.c:330] uartBegin(): UART2 baud(115200) Mode(800001c) rxPin(4) txPin(25)
[    46][V][esp32-hal-uart.c:416] uartBegin(): UART2 not installed. Starting installation
[    56][V][esp32-hal-uart.c:463] uartBegin(): UART2 initialization done.

SuGlider avatar Apr 13 '24 15:04 SuGlider

Yes... it was the PR https://github.com/espressif/arduino-esp32/pull/8800 from 3.0.0 that has been imported into 2.015 by https://github.com/espressif/arduino-esp32/pull/9176

This breaks the UART pins...

Name ESP32 S2 S3 C3
UART0 RX SOC_RX0 3 44 44 20
UART0 TX SOC_TX0 1 43 43 21
UART1 RX RX1 ~9~ -> 26 ~18~ -> 4 15 18
UART1 TX TX1 ~10~ -> 27 ~17~ -> 5 16 19
UART2 RX RX2 ~16~ -> 4 -- 19 --
UART2 TX TX2 ~17~ -> 25 -- 20 --

SuGlider avatar Apr 13 '24 16:04 SuGlider

@khryssmar - a quick workaround would be to initialize Serial2 passing the pins, for example: Serial2.being(115200, SERIAL_8N1, 16, 17); // baud rate, mode, RxPin, TxPin

SuGlider avatar Apr 13 '24 16:04 SuGlider

The Serial2 pins were changed because psram is typically on 16 & 17. With a WROOM module, they are available.

lbernstone avatar Apr 13 '24 17:04 lbernstone

It was changed for 3.0.0 as a breaking change. But for 2.0.x it should reamain the same, not breaking previous sketches.

SuGlider avatar Apr 13 '24 20:04 SuGlider

Issue is solved, will be included in release 2.0.16, which we will release in approximately one week. We will wait for a while to test and possibly catch other issues.

Thanks @khryssmar for quick response and pointing out this problem!

VojtechBartoska avatar Apr 15 '24 12:04 VojtechBartoska

I'm experiencing the same problem, as I installed 2.0.15 version. How can I take the 2.0.16? The IDE shows 2.0.15 as latest version:

image

sblendorio avatar Apr 21 '24 10:04 sblendorio

Hello,

2.0.16 is not released yet, we are still working on it. We will release it in 1 - 2 weeks.

VojtechBartoska avatar Apr 23 '24 09:04 VojtechBartoska

@VojtechBartoska thanks.

I read that 3.0 will have a breaking change. Where do I find the corresponding code for using Serial2?

Thanks again!

sblendorio avatar Apr 23 '24 09:04 sblendorio

I would like to reopen the issue. Encountered this again. Please fix. @SuGlider

image image

khryssmar avatar Aug 12 '24 14:08 khryssmar

@VojtechBartoska thanks.

I read that 3.0 will have a breaking change. Where do I find the corresponding code for using Serial2?

Thanks again!

https://docs.espressif.com/projects/arduino-esp32/en/latest/migration_guides/2.x_to_3.0.html#id14

SuGlider avatar Aug 13 '24 19:08 SuGlider

I would like to reopen the issue. Encountered this again. Please fix. @SuGlider

image image

This change is valid for Arduino Core 3.x.x Explanation in https://github.com/espressif/arduino-esp32/issues/10152#issuecomment-2286991672

Arduino Core 2.0.15, 2.0.16 and 2.0.17 had a mistake using new pins. Arduino Core 2.0.14 and lower use the original pins.

Arduino Core from release/v2.x branch uses the same pins as before: Fixed with https://github.com/espressif/arduino-esp32/pull/9502

SuGlider avatar Aug 13 '24 19:08 SuGlider