-
Notifications
You must be signed in to change notification settings - Fork 247
Wiznet w5500 ethernet support #1541
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
base: public
Are you sure you want to change the base?
Wiznet w5500 ethernet support #1541
Conversation
Code required to support the W5500 Ethernet-SPI chipset, specifically for the ESP32 processors. This includes modifications to: - ethernet.c main Ethernet driving code. - Providing manifest.json files for both the ENC28J60 and W5500 SPI Ethernet chipsets - ESP32S3 CMakeLists.txt file to include needed Espressif SDK library components - Ethernet.md documentation to provide additional details of what needs to be modified to support Ethernet, especially on the ESP32 processors. - Added the SPI Ethernet module images to the assets directory (the picture of the ENC28J60 HAN module from atomsindustries.com is no longer available).
The updated ethernet-monitor example will show: - timeapi.io only accepts HTTPS connections, so this example illustrates how to make a HTTPS connection using Moddable - HTTPS requires the date and time to be set, or the certificate validation fails. This example also shows getting the time from SNTP service. - Using DNS pool entries for host name lookup. - Improved handling of the Ethernet callbacks to monitor the connection.
…o Wiznet_W5500_Ethernet_support * 'public' of https://github.com/rmontrosecbw/moddable: (25 commits) 419 ble server - first time mcsim mac background modes eliminate unnecessary floating point operations (@ps) mcrun option: -noCheckModule use MODDEF values version bump 5.11.0 idf v5.5.1 Incorporated suggestions from Peter. jsontest.com is no longer active. Replaced with code to use timeapi.io WIZnet W5500 Ethernet support ble notification isn't fixed in 5.5.1 mac ble pairing dialog mac ble error clears completion more security rand() returns signed integer wait for connection to be secured before starting discovery secure health temperature monitor example security: first try quiet warning esp-nimble#108 is fixed in IDF v5.5.1 ...
…o Wiznet_W5500_Ethernet_support * 'public' of https://github.com/rmontrosecbw/moddable: include manifest file of embedded:io/provider/MCP23X17 Add MCP23017 expander module to manifest add xsCallFunction* Moddable-OpenSource#1536 don't need to import UDP first try at 419 mDNS typings 419 mdns - first time xsbug & mcsim icons for macOS Tahoe xsbug & mcsim icons for macOS Tahoe xsbug & mcsim icons for macOS Tahoe The mbedtls include path in Espressif SDK version 5.5.x is $(IDF_PATH)/components/mbedtls/mbedtls/include/. This is correct in make.esp32.mk but was left out of nmake.esp32.mk Moddable-OpenSource#1534 Fix typo in controller fix default manifest for git repos Moddable-OpenSource#1532 option to use Map for txt record changes from TC53 discussion XS linker; fix byte code map of strings > 64 KB onReady isn't passed connection
- Added setStaticIP(ipAddr, netmask, gateway) and doDHCP() emthods - Added IPV6 address reporting (if available) to debug - Added reporting of link speed and duplex status to debug - Added MODDEF_ETHERNET_POWER_PIN, if set, will cycle power on the poin and then asset it to power up the Ethernet device - Initialize netif and event loop first, required before creating netif objects to ensure reliable creation of ESP network stack - For internal Phy, will scan for the address and report the found address and tell if mismatch with MODDEF_ETHERNET_INTERNAL_PHY_ADDRESS - Added MODDEF_ETHERNET_DEBUG, if set to 1, will print additional diagnostic messages on ESP32 log output - Added MODDEF_ETHERNET_INTERNAL_PHY_GPIO0_CLOCK_INPUT that will set GPIO0 to an input, since some WT32-ETH01 boards sonnect the clost to GPIO0 pin - Updated to Espresif 5.5.1 SDK calls - ethernet_monitor was changed to use HTTPS connection to timeapi.io and required specifying creation parameters to additional memory.
|
Thanks so much for the diligent work. And for your patience on. We've been busy. I expect we'll get through a review on this in the next week and merged from there. |
|
Hey – so I tried this with a (newly acquired) WT32-ETH01 board using the In reading the code I noticed this just above: #ifdef MODDEF_ETHERNET_INTERNAL_PHY_GPIO0_CLOCK_INPUT
// Configure GPIO0 as input to prevent conflict with external 50MHz oscillator (RMII_CLK)
// This is critical for WT32-ETH01 and similar boards with external clock source
I also tried uncommenting this block: // Explicit clock configuration (uncomment if sdkconfig settings aren't working)
// esp32_mac_config.clock_config.rmii.clock_mode = EMAC_CLK_EXT_IN;
// esp32_mac_config.clock_config.rmii.clock_gpio = EMAC_CLK_IN_GPIO;From what I understand, you would expect this board to work with the changes. Can you confirm that the code is as expected. If so, perhaps the hardware is bad or a different board revision? For what it is worth, here's the board I'm using. Thanks! |
You identified a problem with deprecated ESP Ethernet calls, so I got a few WT32-ETH01 boards to test the changes. They didn't work with the changes, and that led me down a rabbit hole to get them working. I don't know if Espressif changed how their stack works, but with these boards (probably all internal PHY devices) and the Espressif examples, you need to initialize netif and the event loop before creating netif objects (ethernet.c used first to make the network objects). While tracking down the problem, I added many debugging statements and gated them with the Moddable define ethernet_debug. We need to switch between static and DHCP, so I've added methods to support this and to report the IPv6 address (we will be supporting that). There are several additional MODDEF flags to support the WT32-ETH01 boards.
I didn't think this would require as many changes but it now allows better monitoring of the ESP32 Ethernet behavior.