logo elektroda
logo elektroda
X
logo elektroda

Why do I get an error when trying to use GPIO20 in the NodeMCU?

TvWidget 516 2
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 19655513
    TvWidget
    Level 38  
    On the ESP32-PICO-V3, the GPIO20 pin is brought out.
    When trying to use it in the NodeMCU, the message "GPIO_PIN mask error" appears.
    I found advice to modify the /sdk/esp-idf/components/soc/soc/esp32/gpio_periph.c file.
    I have replaced '0,'on the appropriate position with 'IO_MUX_GPIO20_REG,'. The error still appears. Does anyone have an idea what needs to be done to make it possible to use GPIO20 ?
  • ADVERTISEMENT
  • Helpful post
    #2 19655564
    khoam
    Level 42  
    TvWidget wrote:
    I changed '0,'to 'IO_MUX_GPIO20_REG,' at the appropriate position.
    .
    If you are actually using IDF version 4.4 [*], then this change was not needed . The relevant entry is already:
    Code: C / C++
    Log in, to see the code
    .

    Check how the macro is defined: SOC_GPIO_VALID_GPIO_MASK in /components/soc/esp32/include/soc/soc_caps.h. Should be:
    Code: C / C++
    Log in, to see the code
    .

    [*] The version tagged in github as 4.4-dev is a bit "backwards" compared to master and even the official 4.3 version.
  • #3 19655601
    TvWidget
    Level 38  
    I am using the "master" version.
    The advice solved the problem. Thank you very much.
ADVERTISEMENT