Skip to content

Espressif: pin states after reset vary per pin; consider making reset_pins() match the hw behavior #6963

@dhalbert

Description

@dhalbert

On ESP32, and a lesser extent on ESP32-S2 and other chips, pin state after reset is not consistent. In general pins are to set an input state, but some have a pull-up enabled, some have a pull-down enabled, and some have neither. As an example, ESP32 GPIO2 has a pull-down enabled after reset.

The pin states are listed in the "Pin List" tables in the respective datasheets. Here is a clip from the ESP32 Pin List:
image
wpd is "weak pull-down; wpuis "weak pull-up";ie` is input enabled.

We currently use the ESP-IDF routine gpio_pin_reset() to reset a pin, which uniformly sets the pin to have its input and output disabled, with a pull-up. That does not always match the states given in the Pin Tables. "Input" vs "disabled" doesn't really matter, but the pulls do.

Consider whether it's worth replicating the default hw state instead of just using gpio_pin_reset().

Metadata

Metadata

Assignees

No one assigned

    Labels

    espressifapplies to multiple Espressif chips

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions