-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
ports/esp32: Add support for SPI-based ethernet chips #10420
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
Conversation
169992b
to
a2c2865
Compare
I'm sorry, you already made it clear that this PR implementation does not use that implementation that I linked before. Thank you. |
Love this PR. Would be a great addition, especially with ESP-IDF 4.4 underlying support. |
ef4f210
to
385ae05
Compare
@dpgeorge Thanks for the review. I updated the PR. |
37d00d9
to
9dd8d06
Compare
@dpgeorge I think all your comments so far have been addressed. |
Add support for various SPI-based ethernet chips (W5500, KSZ8851SNL, DM9051) to the ESP32 port. This leverages the existing support in ESP-IDF for these chips -- which configures these chips in "MAC raw" mode -- and the existing support for network.LAN in the ESP32 port. In particular, this doesn't leverage the wiznet5k support that is used on the rp2 and stm32 ports (because that's for native use of lwIP). Tested on the POE Featherwing (with the SJIRQ solder jumper bridged) and a ESP32-S3 feather. A note about the interrupt pin: The W5500 implementation within ESP-IDF relies on hardware interrupt, and requires the interrupt pin from the W5500 to be wired to a GPIO. This is not the case by default on the Adafruit Ethernet FeatherWing, which makes it not directly compatible with this implementation.
`esp_eth_ioctl(ETH_CMD_S_MAC_ADDR)` sets the MAC address of the hardware device, but we also need to notify the upper layers of the change so that e.g. DHCP work properly.
9dd8d06
to
c7301b8
Compare
I rebased this on latest master. |
Thanks @damz for this, it's a good enhancement! |
Hello I'm very happy that we are closer to have SPI-based ethernet chips really supported on the ESP32 family! That feature is something amazing for many projects! I have some questions:
Thank you in advance! |
Hello I test Is there any examples for using SPI-based Ethernet chips ? Does i need compile firmware myself? Also test nightly firmware |
What?
Add support for various SPI-based ethernet chips (W5500, KSZ8851SNL, DM9051) to the ESP32 port.
The impetus for this was to support the POE Featherwing, which is based on the Wiznet W5500 chip.
How?
Leverage the existing support in ESP-IDF for these chips, and the existing support for
network.LAN
in the ESP32 port.In particular, this doesn't leverage the wiznet5k support that is used on the rp2 and stm32 ports.
A note on testing
I tested this on the POE Featherwing (with the SJIRQ solder jumper bridged) and a ESP32-S3 feather.
While I do not have access to hardware using the other chips, the set up method for them comes from the ethernet/basic example from ESP-IDF 4.4, so I am relatively confident that it is correct.
A note about the interrupt pin
The W5500 implementation within ESP-IDF relies on hardware interrupt, and requires the interrupt pin from the W5500 to be wired to a GPIO. This is not the case by default on the Adafruit Ethernet FeatherWing, which makes it not directly compatible with this implementation.