ESP32S3 Pin reset (not the reset pin) - Pin 39 and 40 are stuck high

Hello,

I'm trying to use pin 39 and 40 on an ESP32S3 zero mini for UART.

I did not get any UART communication through these lines when I tried simple sketches so I started debugging. I tested with a multimeter and found the pins stay high.

Even if I do this it still stays high.
PinMode(39,OUTPUT);
digitalWrite(39,LOW);

I think I found a possible issue. Pins 39 and 40 are connected to the JTAG pins and may be preconfigured as per this forum: ESP32-S3 gpio_set_level() problem - ESP32 Forum

In that forum they're using a different program for the code (platformIO). They needed to use a command called gpio_reset_pin() for these pins to work.

I am after a way to do the same in arduino IDE so I can use those pins. Any experience or suggestions out there?

I'm sure someone will ask if I can just change the pins i'm using - i prefer not change pins so I dont have to re-order my boards that I solder the ESP32S3 zero mini, to. But ultimately if it comes to it, I will order new PCBs but would prefer if this could be fixed in software.

Thank you!

see ESP32 Pin Reference

on a ESP32-S3 DevkitC-1 the following works OK using pins 39 and 40

// ESP32-S3 DevkitC-1  Serial1 test - for loopback test connect pin GPIO40 U1TXD to pin GPIO39 U1RXD"
// ss https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/_images/ESP32-S3_DevKitC-1_pinlayout_v1.1.jpg

#define RXD1 39
#define TXD1 40

void setup() {
  // initialize both serial ports:
  Serial.begin(115200);
  Serial1.begin(9600, SERIAL_8N1, RXD1, TXD1);
  Serial.println();
  Serial.println("\n\nESP32-S3 DevkitC-1 serial1  test pin GPIO40 U1TXD pin GPIO39 U1RXD");
  Serial.write("   for loopback test connect pin GPIO40 U1TXD to pin GPIO39 U1RXD\n");
}

void loop() {
  // read from port 1, send to port 0:
  if (Serial1.available()) {
    int inByte = Serial1.read();
    Serial.write(inByte);
  }

  // read from port 0, send to port 1:
  if (Serial.available()) {
    int inByte = Serial.read();
    //Serial.write(inByte);
    Serial1.write(inByte);
  }
}

if I connect GPIO39 and GPIO40 serial monitor displays (text entered on keyboard is echoed to display)

ESP32-S3 DevkitC-1 serial1  test pin GPIO40 U1TXD pin GPIO39 U1RXD
   for loopback test connect pin GPIO40 U1TXD to pin GPIO39 U1RXD
loopback test 1234567890

test 2

the ESP32S3 zero mini has a different pin layout and well may have restrictions on GPIO40 and 39

have a look at esp32-s3-pinouts

EDIT: can you give a link to your ESP32S3 Zero Mini or at least a photo?

This usually happens when people don’t prototype their project and validate their design. You’ll likely need to cut traces and add jumper wires to fix it.

even after prototyping one can still have problems, e.g. PCB layout problems, end user changes specification, etc etc
usually takes two or three prototypes to get final product

1 Like

It is this one: https://www.waveshare.com/wiki/ESP32-S3-Zero
There are pins on the bottom, too which arnt shown on that website.

This website does show the bottom: https://www.waveshare.com/esp32-s3-zero.htm

This is indeed my second prototype. My first one was successful but I decided to make it more compact and change the layout. So I changed some of the pin assignments assuming it would be fine. I checked this pinout diagram and it stated UART on pins 39, 40 which was why I thought it was a safe to use them.

I cut the traces from pins 39, 40 and connected the UART to 14 and 16 and the UART does indeed work on pins 14, 16.

I'll do the loopback test on pins 39,40 just in case.
Thanks.

Sorry, do you mind explaining how this would help me?

I gave it a go on a fresh ESP32S3 zero with nothing else connected. I connected pin 39 to pin 40.
Then I ran the loopback test. It did not show anything in the serial monitor (I double checked the baud rate).
I then connected two other pins as a random test (I chose 17 and 18) and the loopback test works for those.

esp32-s3-pinouts states
GPIO39, GPIO40, GPIO41, GPIO42

The behaviour of these pins is determined by eFuses in conjunction with GPIO3. By default, if you haven't burnt any eFuses yet, these pins are safe to use. JTAG will be available over USB.

If you wish to use these pins for JTAG, you must burn some eFuses, and control GPIO3 at start up. See the datasheet section 2.6.4 for full details.

possibly the JTAG has been enabled on the ESP32S3 Zero Mini??

34 OK input only
35 OK input only
36 OK input only
39 OK input only

Thanks Horace, i'll go read how to burn efuses. Hopefully its within my capabilities.

I think you're looking at the wrong product

ran code of post 3 on a ESP32S3 Zero modified to use GPIO39 and 40 and the loopback test worked OK
how did you connect to the GPIO 39 and 40 pads on the back of the PCB?
not easy - I assume designed for surface mount

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.