Cannot use GPIO17 for UART0, UART1, UART2 TX - causes guru mediation errors.

thereza
Posts: 5
Joined: Tue Dec 01, 2015 3:11 am

Cannot use GPIO17 for UART0, UART1, UART2 TX - causes guru mediation errors.

Postby thereza » Fri Jul 06, 2018 2:36 am

I'm cross-posting this from the arduino-esp32 forum. We have the exact same problem with the ESP32 IDF. Whenever we try to write to GPIO17 the system faults.

Hardware:
Board: Custom
CPU: ESP32-D2WD
Core Installation/update date: ?Jan 12, 2018?
IDE name: ?Arduino IDE?
Flash Frequency: ?80Mhz?
Upload Speed: ?921600?

Description:
Cannot get any uart to output to GPIO17 (even though this is the default for UART2). I've also tried with uart0 and uart1. When I set it to uart0, I can get the console debug output sent to the uart but it's just a guru meditation error with the registers. when i use uart 0 or uart 1 I get gibberish out.

Our device needs to output serial on pin 17, and just about every other pin but 17 seems to work. Any thoughts on how to proceed?

Sketch:
HardwareSerial Serial2(2);

void setup() {
//Serial2.begin(115200);
Serial2.begin(115200, SERIAL_8N1, 16, 17);
Serial2.print("ESP32_BOOTED\r\n");
}


void loop() {
Serial2.printf("Hello, world\r\n");
}
Debug Messages:

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, 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:0x3fff0018,len:4
load:0x3fff001c,len:956
load:0x40078000,len:0
load:0x40078000,len:13076
entry 0x40078ad0
Guru Meditation Error: Core 1 panic'ed (LoadProhibited)
. Exception was unhandled.
Register dump:
PC : 0x400d0b38 PS : 0x00060530 A0 : 0x800e2f62 A1 : 0x3ffca620
A2 : 0x3ffc2204 A3 : 0x00000000 A4 : 0x00060023 A5 : 0x3ffc7d7c
A6 : 0x00000000 A7 : 0x00000000 A8 : 0x800d0894 A9 : 0x3ffca5f0
A10 : 0x3ffc2204 A11 : 0x3f400ef0 A12 : 0x0800001c A13 : 0x00000010
A14 : 0x00000011 A15 : 0x00000000 SAR : 0x0000000f EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000080 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

Backtrace: 0x400d0b38:0x3ffca620 0x400e2f5f:0x3ffca640

Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, 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:0x3fff0018,len:4
load:0x3fff001c,len:956
load:0x40078000,len:0
load:0x40078000,len:13076
entry 0x40078ad0
Guru Meditation Error: Core 1 panic'ed (LoadProhibited)
. Exception was unhandled.
Register dump:
PC : 0x400d0b38 PS : 0x00060530 A0 : 0x800e2f62 A1 : 0x3ffca620
A2 : 0x3ffc2204 A3 : 0x00000000 A4 : 0x00060023 A5 : 0x3ffc7d7c
A6 : 0x00000000 A7 : 0x00000000 A8 : 0x800d0894 A9 : 0x3ffca5f0
A10 : 0x3ffc2204 A11 : 0x3f400ef0 A12 : 0x0800001c A13 : 0x00000010
A14 : 0x00000011 A15 : 0x00000000 SAR : 0x0000000f EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000080 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

Backtrace: 0x400d0b38:0x3ffca620 0x400e2f5f:0x3ffca640

Rebooting...
ets Jun 8 2016 00:22:57

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: Cannot use GPIO17 for UART0, UART1, UART2 TX - causes guru mediation errors.

Postby ESP_igrr » Sat Jul 07, 2018 5:56 am

On D2WD, pins GPIO16, GPIO17, SD_CMD, SD_CLK,
SD_DATA_0, SD_DATA_1 are used to connect the built-in SPI Flash chip. Using them for some other purpose will interfere with code execution from flash, leading to illegal instruction exception. Also note that D2WD uses a 1.8V flash chip, so all pins in VDD_SDIO domain use 1.8V supply voltage.

thereza
Posts: 5
Joined: Tue Dec 01, 2015 3:11 am

Re: Cannot use GPIO17 for UART0, UART1, UART2 TX - causes guru mediation errors.

Postby thereza » Fri Jul 13, 2018 8:07 pm

thanks. it seems that documentation was only just recently added to the datasheet. I wish it had been in there before we designed our PCBs. Also, it's only mentioned in a side not, but not listed in the pinouts section - I suggest it's added there as well with an asterisk.

Reza

Who is online

Users browsing this forum: dzungpv, Majestic-12 [Bot] and 66 guests