Hi everyone,
I'm migrating an ESP32-S2 project from **ESP-IDF v4.3** to **ESP-IDF v5.4.2** and have encountered an issue with **GPIO46**.
### Hardware
* Chip: ESP32-S2
* ESP-IDF: v5.4.2
* Same hardware that has been running successfully with ESP-IDF v4.3.
### Button Connection
GPIO46 is connected to a push button that shorts the pin to GND when pressed.
There is **no external pull-up resistor**, as the original project relied on the internal pull-up.
### Code
```c
gpio_config_t btn_config = {
.pin_bit_mask = (1ULL << GPIO_NUM_46),
.mode = GPIO_MODE_INPUT,
.pull_up_en = GPIO_PULLUP_ENABLE,
.pull_down_en = GPIO_PULLDOWN_DISABLE,
.intr_type = GPIO_INTR_NEGEDGE
};
esp_err_t err = gpio_config(&btn_config);
ESP_LOGI(TAG, "gpio_config() = %s", esp_err_to_name(err));
```
or
```c
gpio_reset_pin(GPIO_NUM_46);
gpio_set_direction(GPIO_NUM_46, GPIO_MODE_INPUT);
gpio_pulldown_dis(GPIO_NUM_46);
ESP_LOGI(TAG, "BUTTON=%d", GPIO_NUM_46);
esp_err_t err = gpio_pullup_en(GPIO_NUM_46);
ESP_LOGI(TAG, "gpio_pullup_en returned %s", esp_err_to_name(err));
```
### Output
```
BUTTON = 46
E (...) gpio: gpio_pullup_en(78): GPIO number error (input-only pad has no internal PU)
gpio_pullup_en returned ESP_ERR_INVALID_ARG
```
### Observations
* `BUTTON` is definitely GPIO46.
* `gpio_config()` returns `ESP_OK`.
* ISR installation succeeds.
* ISR handler is added successfully.
* `gpio_pullup_en(GPIO_NUM_46)` returns `ESP_ERR_INVALID_ARG`.
* The log reports `gpio_pullup_en(78)` instead of GPIO46.
* The exact same hardware and application worked correctly with ESP-IDF v4.3.
### Questions
1. Has GPIO46 support changed between ESP-IDF v4.3 and v5.4.2?
2. Is `gpio_pullup_en(GPIO_NUM_46)` expected to return `ESP_ERR_INVALID_ARG` on ESP32-S2?
3. Why does the driver print `gpio_pullup_en(78)` when GPIO46 is passed?
4. Is this an intentional change, a regression, or a logging issue in the GPIO driver?
Any clarification would be greatly appreciated.
ESP32-S2 GPIO46 internal pull-up works in ESP-IDF v4.3 but returns `ESP_ERR_INVALID_ARG` in v5.4.2
-
Vyshnav S H
- Posts: 2
- Joined: Mon Jul 27, 2026 11:20 am
Who is online
Users browsing this forum: Google [Bot], Qwantbot and 3 guests