ESP32 Reboots when doing serial comms

Brento
Posts: 21
Joined: Mon Apr 20, 2020 10:02 am

ESP32 Reboots when doing serial comms

Postby Brento » Thu Jul 09, 2020 11:56 pm

I have a custom designed PCB that intermittently reboots with the following message:

Code: Select all

Guru Meditation Error: Core  0 panic'ed (IllegalInstruction). Exception was unhandled.
Core 0 register dump:
PC      : 0x400d5f70  PS      : 0x00060730  A0      : 0x00000000  A1      : 0x3ffc4e50
A2      : 0x00000000  A3      : 0x00000000  A4      : 0x00000000  A5      : 0x00000000
A6      : 0x00000000  A7      : 0x00000000  A8      : 0x800d6042  A9      : 0x3ffc4e10
A10     : 0x00000000  A11     : 0x00000000  A12     : 0x3ffc3cc8  A13     : 0x00000000
A14     : 0x3ffc3c80  A15     : 0x00000000  SAR     : 0x00000000  EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000

Backtrace: 0x400d5f70:0x3ffc4e50 0x7ffffffd:0x3ffc4e70
It is running the following code:

Code: Select all

void loop()
{
	delay(5000);		
	Serial.println("beep");
}
With a meter on the 3V line, I measure a stable 3.294 volts at all times. After 9 beeps, it always reboots.

However, if I REMOVE the call Serial.println("beep"), reboot doesn't happen. My guess is that is partially related to power. I tried lowering to 9600 baud, but it still happens. Any ideas how fix, or work around, this? The power 'should' be good enough, since it was designed to allow up to 2A current.

Has anyone ever seen something like this before?

usulrasolas
Posts: 26
Joined: Tue Jun 09, 2020 5:27 pm

Re: ESP32 Reboots when doing serial comms

Postby usulrasolas » Fri Jul 10, 2020 12:07 am

that's the only code running on the entire board? print shouldn't draw hardly any current or cause any appreciable voltage loss from what I know?

Brento
Posts: 21
Joined: Mon Apr 20, 2020 10:02 am

Re: ESP32 Reboots when doing serial comms

Postby Brento » Fri Jul 10, 2020 12:13 am

that's the only code running on the entire board? print shouldn't draw hardly any current or cause any appreciable voltage loss from what I know?
In the loop, yes.

The setup has some initialization routines, and where the baud rate is set, of course.

If I make a call to serial.println in the loop, it eventually reboots. Without that line, it will run indefinitely.

Brento
Posts: 21
Joined: Mon Apr 20, 2020 10:02 am

Re: ESP32 Reboots when doing serial comms

Postby Brento » Sat Jul 11, 2020 12:11 am

Update.

I am now wondering if there is some sort of conflict possible with ledcWrite and the use of the serial port.

It seems that if I comment out ledcWrite from the setup, Serial.println("beep") works fine indefinitely.

Code: Select all

void setup()
{
	Serial.begin(9600);
	Serial.println("setup begin");

	ledcSetup(1, 25000, 8);
	ledcAttachPin(10, 1);
	ledcWrite(1, 20);
}

void loop()
{
	delay(5000);//limit click speed
	Serial.println("beep");
}
Also, if I comment out Serial.println("beep"), ledcWrite works properly, and the program works fine indefinitely.

But, with BOTH lines, it will reboot after about a minute. I am using the D2WD version of the processor. This behavior was not noticed on the D0WD version.

chegewara
Posts: 2364
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP32 Reboots when doing serial comms

Postby chegewara » Mon Jul 13, 2020 3:28 am

Brento wrote:
Sat Jul 11, 2020 12:11 am

ledcAttachPin(10, 1);
Pin 10 is reserved.
Pins pins 6-11 are used for flash on module.

Brento
Posts: 21
Joined: Mon Apr 20, 2020 10:02 am

Re: ESP32 Reboots when doing serial comms

Postby Brento » Tue Jul 14, 2020 2:30 am

Yes, thanks for your help. I re-posted this on another topic, when I realized this might not be a hardware issue. I think this solves it.

Problem was unique to the D2WD in that it has more reserved flash pins than the D0WD. I incorrectly assumed that the additional flash pins needed for the D2WD freed up the GPIO9 and 10.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: ESP32 Reboots when doing serial comms

Postby WiFive » Wed Jul 15, 2020 9:15 pm

They should be free but they are 1.8v gpios so you might be Browning out the sdio 1.8v internal regulator by driving a buzzer

Who is online

Users browsing this forum: No registered users and 22 guests