Skip to content

Classic ESP32: GPIO17 is not always needed for PSRAM #5334

Closed

Description

@wled-install

What happened?

The following line in pin_manager.cpp:

if (gpio == 16 || gpio == 17) return !psramFound(); // PSRAM pins on ESP32-D0WDR2-V3 (these are IO)

prevents using GPIO17 together with PSRAM. Modules that have "in-package" PSRAM integrated (like ESP32-WROOM-32E-N8R2, ESP32-WROOM-32E-N4R2 based on ESP32-D0WDR2-V3 / ESP32-D0WDRH2-V3) do not use GPIO17 for PSRAM. In this case GPIO17 can be used for other purposes (for example for Ethernet clock).

GPIO17 is only used for PSRAM on modules with external "off-package" PSRAM (like WROOVER uses).

Please refer to ESP32 Datasheet, pages 20-21. https://documentation.espressif.com/esp32_datasheet_en.pdf

To Reproduce Bug

Compile and install as it is on ESP32-D0WDR2-V3 / ESP32-D0WDRH2-V3 based Controller.

Expected Behavior

On ESP32-D0WDR2-V3 / ESP32-D0WDRH2-V3 the GPIO17 should not be reserved for PSRAM.

Install Method

Self-Compiled

What version of WLED?

0.15.x, 0.16.x

Which microcontroller/board are you seeing the problem on?

ESP32

Relevant log/trace output

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. changed the title [-]Classic ESP32: GPIO17 is not alway needed for PSRAM[/-] [+]Classic ESP32: GPIO17 is not always needed for PSRAM[/+] on Feb 1, 2026
  2. softhack007 commented on Feb 1, 2026

    @softhack007
    Member

    Hi @wled-install 👋

    If we just allow the PIN on boards that do need gpio17 for PSRAM, we'll be facing lots of user complaints like "lights freeze after changing the pin, homeassistent cannot connect" 😉 . Similar if we unlock the pin via build flag, because users will often install the wrong firmware as they don't understand the difference - "ethernet broken after updating WLED".

    It means we need a reliable way to identify - at runtime - the new package that you mention, while still keeping 16 & 17 protected on the normal "WROVER-B" boards.

    If you have both kinds of boards at hand, can you do a quick check of what ESP.getChipModel() reports on both boards (arduino-esp32 v2.0.9) ? If the function returns a different string for internal "in-package" PSRAM modules, then it might be possible to change the line you mention into something like

    if ((strncmp_P(PSTR("whatever-getChipModel-says"), ESP.getChipModel(), 15) == 0) {  // allow gpio17 on modules with in-package PSRAM
        if (gpio == 16) return !psramFound();
        if (gpio == 17) return true;
    } else if (gpio == 16 || gpio == 17) return !psramFound(); // PSRAM pins on ESP32-D0WDR2-V3 (these are IO)
  3. added
    board request
    and removed on Feb 1, 2026
  4. wled-install commented on Feb 1, 2026

    @wled-install
    ContributorAuthor

    Hi, unfortunately I only have ESP32-WROOM-32E-N8R2 with "in-package" PSRAM. ESP.getChipModel() reports "ESP32-D0WDR2-V3". It fits exactely to espressif documentation. There is also "ESP32-D0WDRH2-V3" with in-package PSRAM.
    I would say for both GPIO17 should not be blocked.

    So the code should be:

    if ((strncmp_P(PSTR("ESP32-D0WDR2-V3"), ESP.getChipModel(), 15) == 0) || (strncmp_P(PSTR("ESP32-D0WDRH2-V3"), ESP.getChipModel(), 16) == 0)) {  // allow gpio17 on modules with in-package PSRAM
        if (gpio == 16) return !psramFound();
        if (gpio == 17) return true;
    } else if (gpio == 16 || gpio == 17) return !psramFound(); // PSRAM pins on modules with off-package PSRAM
    

    According to espressif datasheet, there are two versions of ESP32-WROVER-(I)E modules. The version that uses 2MB in-package PSRAM (ESP32-D0WDR2-V3 based) and the version that uses 8 MB off-package PSRAM (ESP32-D0WD-V3 based). Only the second one uses GPIO17. The code above should also work correctly also for ESP32-WROVER-(I)E modules.

  5. softhack007 commented on Feb 14, 2026

    @softhack007
    Member

    PR #5338 merged; using gpio17 on this special board will be possible with a "V4" build (wled 16.0-alpha).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    board requestenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions