Skip to content

esp32/modnetwork: Enable PHY_GENERIC on ESP32-P4.#19034

Open
sfe-SparkFro wants to merge 1 commit intomicropython:masterfrom
sparkfun:esp32_p4_phy_generic
Open

esp32/modnetwork: Enable PHY_GENERIC on ESP32-P4.#19034
sfe-SparkFro wants to merge 1 commit intomicropython:masterfrom
sparkfun:esp32_p4_phy_generic

Conversation

@sfe-SparkFro
Copy link
Copy Markdown
Contributor

Summary

Fixes #19033.

Testing

Tested on an ESP32-P4 board. PHY_GENERIC is now available, and works in my testing (can obtain IP address, get data from a website, etc.).

Trade-offs and Alternatives

Could PHY_GENERIC just always be enabled? From what I can tell poking through the ESP-IDF PHY implementations, the all non-generic PHYs do the same initialization (esp_eth_phy_802_3_obj_config_init()) as the generic PHY, plus additional stuff. I don't see why the generic PHY is disabled if the other PHYs are enabled.

Generative AI

I did not use generative AI tools when creating this PR.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

Code size report:

Reference:  github/workflows: Bump codecov/codecov-action from 5 to 6. [8c6dfa5]
Comparison: esp32/modnetwork: Always enable PHY_GENERIC. [merge of 8e4ea02]
  mpy-cross:    +0 +0.000% 
   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
      esp32:    +0 +0.000% ESP32_GENERIC
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@dpgeorge
Copy link
Copy Markdown
Member

dpgeorge commented Apr 7, 2026

Could PHY_GENERIC just always be enabled?

Yes, it looks like it could be.

Also, I think the logic to enable MICROPY_PY_NETWORK_LAN in ports/esp32/mpconfigport.h should be updated to include || CONFIG_IDF_TARGET_ESP32P4.

Also enable MICROPY_PY_NETWORK_LAN if SOC_EMAC_SUPPORTED
is defined, which enables on ESP32-P4.

Signed-off-by: Dryw Wade <dryw.wade@sparkfun.com>
@sfe-SparkFro sfe-SparkFro force-pushed the esp32_p4_phy_generic branch from c1da5f1 to 8e4ea02 Compare April 9, 2026 15:00
@sfe-SparkFro
Copy link
Copy Markdown
Contributor Author

Could PHY_GENERIC just always be enabled?

Yes, it looks like it could be.

Done!

Also, I think the logic to enable MICROPY_PY_NETWORK_LAN in ports/esp32/mpconfigport.h should be updated to include || CONFIG_IDF_TARGET_ESP32P4.

Good catch! Changed it to check SOC_EMAC_SUPPORTED instead of specific chips.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

esp32: network.PHY_GENERIC not available on ESP32-P4

2 participants