-
-
Notifications
You must be signed in to change notification settings - Fork 509
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
Add Support for W5500 SPI Ethernet Controller (without multiple devices using the same SPI bus) #2068
Conversation
I can confirm this PR is working fine withe the Fusionboard and POE Hat. |
#if CONFIG_IDF_TARGET_ESP32S3 | ||
ETHSPI.begin(pin.w5500_sclk, pin.w5500_mosi, pin.w5500_miso, pin.w5500_cs, pin.w5500_int, pin.w5500_rst, SPI3_HOST); | ||
#else | ||
MessageOutput.println("No SPI3_HOST avialable on current device."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Classic ESP32 also has SPI3, right? Also there is a typo here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Classic ESP32 Wroom only has HSPI and VSPI, ie two SPI Busses 🚌 according to my memory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ESP32 integrates 4 SPI peripherals: SPI0, SPI1, SPI2 (commonly referred to as HSPI), and SPI3 (commonly referred to as VSPI).
This code doesn't make use of two SPI buses. If CMT2300A is configured, it just gives up.
And sure enough, when I edit it to use SPI3_HOST it works just fine. On classic ESP32 (I used ESP32 mini)
This PR is no more required as the SpiManager was now merged. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns. |
With the upcoming end of support of devices with 4 MB flash on OpenDTU-OnBattery (#1025) there is an upcoming problem with the ethernet support. Currently there is no S3-Version of the WT32-ETH01 and also the S3 doesn't include an Ethernet MAC anymore.
So I started to research alternatives and found the W5500. Based on #1200 I've updated to master and simplified the implementation by e.g. removing the SpiPatcher logic. This way the libraries (NRF + CMT) don't need to be modified.
As a trade-off with this branch it is only possible to connect the W5500 with NRF or W5500 with CMT or NRF and CMT without ethernet. Furthermore because SPI3_HOST is not available on e.g. C3 the W5500 will not work and a warning will be outputted.
Multiple devices using the same SPI bus (implemented in #1200) would be best option for the future, but for now I think this is the fastest way to implement the W5500 without doing changes to other libraries.
I hope we can merge this PR into the master, so that there is an option for S3 + Ethernet in the future.