espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.79k stars 7.31k forks source link

ESP32-S3 enabling GPIO41 after burning EFuses (IDFGH-11004) #12190

Open Stencht opened 1 year ago

Stencht commented 1 year ago

Answers checklist.

General issue report

Hi,

I have custom PCB's with ESP32-S3-WROOM-1 which use GPIO41 as an output, but for some reason I am not able to set this pin high. This is topic is similar to one on the espressif forum, but it grow stale so I am hoping this forum is more alive :)

The code works on a dev-board using the same chip with the same code, the only difference is that the custom boards use DFU/CDC (so no UART). For which I had to burn the efuse USB_PHY_SEL.

I noticed that GPIO_NUM_41 is used for JTAG when enabled. For what I could tell it should already be disabled, but just to be sure I followed the instructions as described in the datasheet under 'JTAG Signal Source Control':

  1. Set GPIO3 high (should matter)
  2. Burned fuses DIS_PAD_JTAG and DIS_USB_JTAG, which should permanently disable JTAG

But still no luck.

Other test:

Any ideas? The only idea I have left is opting for a flying wire to a GPIO I can set :(

Stencht commented 1 year ago

Update:

image
Stencht commented 1 year ago

I can confirm that it is not a hardware issue.

After recreating the circuit on breadboard and confirming the correct value at pin 41 on a new ESP32-S3-DevKitC-1, I burned the efuse USB_PHY_SEL to 1. After doing this, the same behaviour occurs as with my custom boards. Then I proceeded with flashing the other two efuses (DIS_USB_JTAG & DIS_PAD_JTAG), still no change.

I did notice some interesting things:

Current method of setting GPIO41 as output (which worked before burning efuse):

// Configure IO
ESP_ERROR_CHECK(gpio_pullup_dis(PWR_SWITCH_PERIPHERALS_GPIO));
ESP_ERROR_CHECK(gpio_pulldown_dis(PWR_SWITCH_PERIPHERALS_GPIO));
ESP_ERROR_CHECK(gpio_intr_disable(PWR_SWITCH_PERIPHERALS_GPIO));
ESP_ERROR_CHECK(gpio_set_direction(PWR_SWITCH_PERIPHERALS_GPIO, GPIO_MODE_OUTPUT));
// Set output high
ESP_ERROR_CHECK(gpio_set_level(PWR_SWITCH_PERIPHERALS_GPIO, 1));

Maybe the default function of the pin has changed? Although I would think that gpio_set_direction would set it as a GPIO (and not as MTDI or CLK_OUT1).

image

Any help would be highly appreciated!

Stencht commented 1 year ago

Nobody? 😥

faizannazir commented 10 months ago

Nobody? 😥

Screenshot_20240121_194632_com android chrome

Screenshot_20240121_194623_com android chrome

BY Default they are gpio d+ and d- are used for jtag?

adixmasz commented 5 months ago

In my case (custom board with ESP32-S3-WROOM-1U-N8) pin GPIO41 works when invoke gpio_reset_pin(GPIO_NUM_41) before set its direction and level.

gpio_reset_pin(GPIO_NUM_41); // Gpio needs reset to exit JTAG mode gpio_set_direction(GPIO_NUM_41, GPIO_MODE_OUTPUT); gpio_set_level(GPIO_NUM_41, 1);

Take it from that thread: https://www.esp32.com/viewtopic.php?t=38364 on forum you have mention before