Skip to content

Commit 374d7d6

Browse files
authored
Gate Ethernet module on managed SPI PHY components for IDF 6 (#668)
* Gate Ethernet module on managed SPI PHY components for IDF 6. In-tree CONFIG_ETH_SPI_ETHERNET_* is gone; enable eth when espressif W5500/DM9051/KSZ8851 components are present. * changelog: note eth SPI PHY managed-component gating for IDF 6
1 parent b1c8938 commit 374d7d6

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ remote_component = { name = "espressif/lan87xx", version = "1.*" }
2828
- WebSocket: `EspWebSocketClient::drop()` no longer panics when `esp_websocket_client_close` returns `ESP_FAIL` (e.g. after a network disconnection); errors are now logged instead of unwrapped
2929
- BT: Fixed panic when an A2DP sink disconnects from the ESP while streaming audio.
3030
- Thread: `scan`, `energy_scan` and the IPv6 receive callbacks no longer pass the wrong context pointer to OpenThread (the closure box instead of the `ThreadDriverInner`), fixing a type-confusion crash when the callbacks fire.
31+
- Ethernet: `mod eth` is enabled again on ESP-IDF 6.0+ when SPI Ethernet PHYs are provided as managed components (`espressif/w5500`, `espressif/dm9051`, `espressif/ksz8851snl`), not only via the removed in-tree `CONFIG_ETH_SPI_ETHERNET_*` Kconfig options
3132

3233
### Added
3334
- Compatibility with ESP-IDF V6.0, and some pre-release 6.0.x.

src/eth.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ use embedded_svc::eth::*;
1414
any(
1515
esp_idf_eth_spi_ethernet_dm9051,
1616
esp_idf_eth_spi_ethernet_w5500,
17-
esp_idf_eth_spi_ethernet_ksz8851snl
17+
esp_idf_eth_spi_ethernet_ksz8851snl,
18+
// ESP-IDF 6.0+ managed components
19+
esp_idf_comp_espressif__dm9051_enabled,
20+
esp_idf_comp_espressif__w5500_enabled,
21+
esp_idf_comp_espressif__ksz8851snl_enabled,
1822
)
1923
))]
2024
use crate::hal::gpio;

src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,18 @@ pub mod espnow;
4848
esp_idf_comp_esp_event_enabled,
4949
))]
5050
#[cfg(any(
51+
// On-chip EMAC (ESP32); RMII PHYs such as lan87xx are used only with EMAC
5152
all(esp32, esp_idf_eth_use_esp32_emac),
5253
any(
5354
esp_idf_eth_spi_ethernet_dm9051,
5455
esp_idf_eth_spi_ethernet_w5500,
55-
esp_idf_eth_spi_ethernet_ksz8851snl
56+
esp_idf_eth_spi_ethernet_ksz8851snl,
57+
// ESP-IDF 6.0+ ships SPI Ethernet PHYs as managed components
58+
esp_idf_comp_espressif__dm9051_enabled,
59+
esp_idf_comp_espressif__w5500_enabled,
60+
esp_idf_comp_espressif__ksz8851snl_enabled,
5661
),
57-
esp_idf_eth_use_openeth
62+
esp_idf_eth_use_openeth,
5863
))]
5964
pub mod eth;
6065
#[cfg(all(feature = "alloc", esp_idf_comp_esp_event_enabled))]

0 commit comments

Comments
 (0)