-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Description
Hardware:
Board: Adafruit Feather ESP32-S2
Core Installation version: 2.0.1
IDE name: Arduino IDE
Description:
pinMode() has no effect on pins 9, 11 or A4. Other pins work as expected.
Replacing digitalWrite() with equivalent GPIO register accesses does not work; issue is likely in pinMode().
Replacing pinMode() with equivalent gpio_set_direction() call does work.
A different workaround, though I don’t know if this is universally correct fix or will break something else, is to edit esp32-hal-gpio.c and move line 41:
#define USE_ESP_IDF_GPIO 1
…up 2 lines so it’s in the CONFIG_IDF_TARGET_ESP32S2 condition rather than the #else. Test code then works on all pins.
(EDIT: perhaps it’s also still needed in the #else, I haven’t tested on “classic” ESP32 with the change)
Sketch:
// Just the standard Arduino blink, but on different pin. Also try 9 or A4:
void setup() {
pinMode(11, OUTPUT);
}
void loop() {
digitalWrite(11, HIGH);
delay(100);
digitalWrite(11, LOW);
delay(100);
}