esp32: fix pullup/pulldown on RTC GPIO pins - #5578
Open
pottekkat wants to merge 1 commit into
Open
Conversation
Signed-off-by: Navendu Pottekkat <navendu@apache.org>
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3477
Issue
Pins with RTC function ignore the
IO_MUX_GPIO0_FUN_WPUandIO_MUX_GPIO0_FUN_WPDbits, soPinInputPullupandPinInputPulldowndid nothing.The issue is that these pins (with RTC function, see ESP32 TRM table 6.11-1) have their pull configuration controlled instead by the
RTC_IOregisters.Fix
The
Pin.Configurefunction now callsconfigureRTCPullto setRUEandRDE(pullup and pulldown, respectively) bits inRTC_IOmapping the GPIO to RTC as shown in table 6.11-1 in the TRM shared above and also mirroring ESP-IDF esp_hal_gpio/esp32/rtc_io_periph.c#L57.Testing
Tested on an ESP32 development board (exact model) by configuring pullup and then pulldown with nothing connected and confirmed the level through
Pin.Getand also by measuring the voltage.You can use the test script referenced in the original issue #3477 to validate the fix. Or something like this that checks all pins with this issue: