Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDF claims IO20 is invalid, but ESP-PICO-V3 exposes IO20 (IDFGH-4154) #6016

Closed
corecode opened this issue Oct 22, 2020 · 3 comments · Fixed by sainsaar/esp-idf#1
Closed

IDF claims IO20 is invalid, but ESP-PICO-V3 exposes IO20 (IDFGH-4154) #6016

corecode opened this issue Oct 22, 2020 · 3 comments · Fixed by sainsaar/esp-idf#1
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@corecode
Copy link
Contributor

Environment

  • Development Kit: none
  • Module or chip used: [ESP32-PICO-V3]
  • IDF version (run git describe --tags to find it):
    // v4.1-352-g5d258af93
  • Build System: CMake
  • Compiler version (run xtensa-esp32-elf-gcc --version to find it):
    // xtensa-esp32-elf-gcc (crosstool-NG esp-2020r3) 8.4.0
  • Operating System: Linux
  • Using an IDE?: No
  • Power Supply: external 5V

Problem Description

ledc_channel_config does not accept IO20 and reports

ledc: ledc_channel_config(380): gpio_num argument is invalid

Expected Behavior

IO20 can be used

Actual Behavior

IO20 cannot be used

Steps to reproduce

  1. call ledc_channel_config with gpio_num = 20

Fix

diff --git a/components/soc/esp32/gpio_periph.c b/components/soc/esp32/gpio_periph.c
index d8a30b0af..0a6eee285 100644
--- a/components/soc/esp32/gpio_periph.c
+++ b/components/soc/esp32/gpio_periph.c
@@ -35,7 +35,7 @@ const uint32_t GPIO_PIN_MUX_REG[GPIO_PIN_COUNT] = {
     IO_MUX_GPIO17_REG,
     IO_MUX_GPIO18_REG,
     IO_MUX_GPIO19_REG,
-    0,
+    IO_MUX_GPIO20_REG,
     IO_MUX_GPIO21_REG,
     IO_MUX_GPIO22_REG,
     IO_MUX_GPIO23_REG,
@github-actions github-actions bot changed the title IDF claims IO20 is invalid, but ESP-PICO-V3 exposes IO20 IDF claims IO20 is invalid, but ESP-PICO-V3 exposes IO20 (IDFGH-4154) Oct 22, 2020
@ginkgm
Copy link
Collaborator

ginkgm commented Oct 23, 2020

Hello @corecode ,
according to the datasheet (section A.4), there is no such GPIO20 on the chip. So it's not available.

The dev board may be desinged in this way to support more modules, but for ESP32, the pin is not available even if you remove the restriction.

@boarchuz
Copy link
Contributor

@ginkgm
PICO-V3 datasheet notes:
Comparing to other ESP32 series chips, ESP32-PICO-V3 has an additional pin GPIO20

@alessandro-montanari
Copy link

I'm using the pico v3 and having the same problem. Using the same fix suggested by @corecode I can use the pin 20 just fine.

See also #387

alberto-frsky added a commit to alberto-frsky/esp-idf that referenced this issue Apr 21, 2021
Some newer ESP32 variants (like ESP32-PICO-V3 and ESP32-PICO-MINI-02)
do implement this pin and it can be used as a normal GPIO.

This patch enables it unconditionally, leaving the responsability
of using it correctly to the developer.

Fixes espressif#6016
Fixes espressif#6837
alberto-frsky added a commit to alberto-frsky/esp-idf that referenced this issue May 5, 2021
Some newer ESP32 variants (like ESP32-PICO-V3 and ESP32-PICO-MINI-02)
do implement this pin and it can be used as a normal GPIO.

This patch enables it unconditionally, leaving the responsability
of using it correctly to the developer.

Fixes espressif#6016
Fixes espressif#6837
@espressif-bot espressif-bot added Resolution: Done Issue is done internally Status: Done Issue is done internally labels Aug 30, 2021
espressif-bot pushed a commit that referenced this issue Oct 12, 2021
Some newer ESP32 variants (like ESP32-PICO-V3 and ESP32-PICO-MINI-02)
do implement this pin and it can be used as a normal GPIO.

Fixes #6016
Fixes #6837

Closes #6918

(cherry picked from commit 6deaefd)
espressif-bot pushed a commit that referenced this issue Dec 4, 2021
Some newer ESP32 variants (like ESP32-PICO-V3 and ESP32-PICO-MINI-02)
do implement this pin and it can be used as a normal GPIO.

Fixes #6016
Fixes #6837

Closes #6918

(cherry picked from commit 6deaefd)
espressif-bot pushed a commit that referenced this issue Dec 4, 2021
Some newer ESP32 variants (like ESP32-PICO-V3 and ESP32-PICO-MINI-02)
do implement this pin and it can be used as a normal GPIO.

Fixes #6016
Fixes #6837

Closes #6918

(cherry picked from commit 6deaefd)
espressif-bot pushed a commit that referenced this issue Dec 10, 2021
Some newer ESP32 variants (like ESP32-PICO-V3 and ESP32-PICO-MINI-02)
do implement this pin and it can be used as a normal GPIO.

Fixes #6016
Fixes #6837

Closes #6918

(cherry picked from commit 6deaefd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
5 participants