ESP32-HUB75-MatrixPanel-DMA icon indicating copy to clipboard operation
ESP32-HUB75-MatrixPanel-DMA copied to clipboard

ESP32 crashes when enabling a second serial port

Open mrcodetastic opened this issue 3 years ago • 7 comments

Originally posted by nospamsam2011 January 9, 2023 Good day All,

I was curious if anyone else has experienced startup issues when creating second serial port on the ESP32? I ask because as soon as I create a second serial port (Serial1 or Serial2), the ESP32 crashes. The IO pins do not conflict with the HUB75 pins and so I figured before I start digging deep, I would see if anyone else had a similar experience and if so what they had to do to enable a second serial port.

Thanks in advance!

mrcodetastic avatar Feb 01 '23 21:02 mrcodetastic

The link you provided indicates the the discussion has been deleted... Can you provide a different link or why was the discussion deleted?

nospamsam2011 avatar Feb 05 '23 23:02 nospamsam2011

Discussion has been moved to an issue

mrcodetastic avatar Feb 05 '23 23:02 mrcodetastic

Can you provide a sample sketch that causes this crash so I can replicate / test?

mrcodetastic avatar Feb 05 '23 23:02 mrcodetastic

Good day mrfaptastic,

My apologies for the response delay! Digging deeper I found that the 2nd serial port issue is dependent upon the Rx/Tx pins selected. If I use GPIO's 32/35 then the serial port crashes. To rule out any issue with your library, I created a simple sketch which is simply the Serial and Serial2 ... and sure enough the GPIO Pins selected for Tx/Rx can crash the system. Consequently, the Serial2 issue has nothing to do with your library.

My apologies for mistakenly correcting this issue!

Cheers,

Sam

nospamsam2011 avatar Feb 14 '23 21:02 nospamsam2011

As a follow up to this and if anyone else get's caught by this issue... Although the ESP32 names pins as GPIO, some pins are input only. Effectively GPIO Pins from GPIO34 and up can only be used as inputs. In my case I had GPIO35 set as serial2's Tx (output) which caused the system crash. This is annoying, as these pins should have been called GPI insted of GPIO... Sadly, this means a board change to remap the Tx pin to another pin... argh...

You can see the various pin functionality on Page 60 of the ESP32 technical Reference Manual (Revision 4.8).

Cheers,

Sam

nospamsam2011 avatar Feb 14 '23 22:02 nospamsam2011

Lots of useful information on this site ... https://randomnerdtutorials.com/esp32-pinout-reference-gpios/ In particular that page for GPIO. Cheers Daz

DarrylStrong avatar Feb 15 '23 12:02 DarrylStrong

Need to fix the file HardwareSerial.cpp as in this video https://www.youtube.com/watch?v=GwShqW39jlE&t=203s ESP32 aditional RS232

MichaelAndronov avatar Mar 01 '23 14:03 MichaelAndronov