Running a WIZ550io (SPI Ethernet Module with W5500 chip)

EarthAndy
Posts: 12
Joined: Fri Jan 19, 2024 6:53 pm

Running a WIZ550io (SPI Ethernet Module with W5500 chip)

Postby EarthAndy » Fri Jan 19, 2024 7:17 pm

I am attempting to get a WIZ550io module with a ESP32-S3 (ESP32-S3-DevKitC-1-N8R2) running with the ESP-IDF 5.1.2 API.

https://www.wiznet.io/product-item/wiz550io/

I started with the esp-idf\examples\ethernet\basic project. I was able to configure the project to my IO (which was basically the same as the defaults for the project), and compile/flash. The project runs, appears to communicate with the W5500, gets a Link status, and then never gets an IP:

Code: Select all

I (339) main_task: Calling app_main()
I (359) esp_eth.netif.netif_glue: 4a:27:e2:66:2f:08
I (359) esp_eth.netif.netif_glue: ethernet attached to netif
I (369) main_task: Returned from app_main()
I (369) eth_example: Ethernet Started
I (2369) eth_example: Ethernet Link Up
I (2369) eth_example: Ethernet HW Addr 4a:27:e2:66:2f:08
I can unplug and re-plug the ethernet cable, and the the lights on the module act accordingly (and the example program shows the status as the link goes up and down, so I assume there's proper communication and interrupting happening with the device:

Code: Select all

I (146369) eth_example: Ethernet Link Down
I (150369) eth_example: Ethernet Link Up
I (150369) eth_example: Ethernet HW Addr 4a:27:e2:66:2f:08
Eventually I start to get a bunch of errors on the output:

Code: Select all

I (329) main_task: Started on CPU0
I (339) main_task: Calling app_main()
I (359) esp_eth.netif.netif_glue: 4a:27:e2:66:2f:08
I (359) esp_eth.netif.netif_glue: ethernet attached to netif
I (369) main_task: Returned from app_main()
I (369) eth_example: Ethernet Started
I (2369) eth_example: Ethernet Link Up
I (2369) eth_example: Ethernet HW Addr 4a:27:e2:66:2f:08
I (146369) eth_example: Ethernet Link Down
I (150369) eth_example: Ethernet Link Up
I (150369) eth_example: Ethernet HW Addr 4a:27:e2:66:2f:08
I (170369) eth_example: Ethernet Link Down
I (172369) eth_example: Ethernet Link Up
I (172369) eth_example: Ethernet HW Addr 4a:27:e2:66:2f:08
E (191969) w5500.mac: w5500_send_command(124): send command timeout
E (191969) w5500.mac: emac_w5500_transmit(496): issue SEND command failed
E (192469) w5500.mac: w5500_send_command(124): send command timeout
E (192469) w5500.mac: emac_w5500_stop(309): issue CLOSE command failed
E (192469) w5500.mac: emac_w5500_set_link(386): w5500 stop failed
E (192469) esp_eth: eth_on_state_changed(131): ethernet mac set link failed
E (192479) w5500.phy: w5500_update_link_duplex_speed(88): change link failed
E (192489) w5500.phy: w5500_get_link(112): update link duplex speed failed
E (194469) w5500.mac: w5500_send_command(124): send command timeout
E (194469) w5500.mac: emac_w5500_stop(309): issue CLOSE command failed
E (194469) w5500.mac: emac_w5500_set_link(386): w5500 stop failed
E (194469) esp_eth: eth_on_state_changed(131): ethernet mac set link failed
E (194479) w5500.phy: w5500_update_link_duplex_speed(88): change link failed
E (194489) w5500.phy: w5500_get_link(112): update link duplex speed failed
E (196069) w5500.mac: w5500_send_command(124): send command timeout
E (196069) w5500.mac: emac_w5500_transmit(496): issue SEND command failed
E (196469) w5500.mac: w5500_send_command(124): send command timeout
E (196469) w5500.mac: emac_w5500_stop(309): issue CLOSE command failed
E (196469) w5500.mac: emac_w5500_set_link(386): w5500 stop failed
These errors repeat indefinitely.

Now, I know that the default IP and Gateway of the WIZ550io (and W5500 chip directly) have default settings that will not work on my network - I'm on a different subnet. So I set up an SPI interface so that I could change the registers on the W5500 with my own network settings, however that did not change the outcome. I have had some trouble getting the W5500 to keep the settings, but that shouldn't be affecting the current state of my system:

Code: Select all

I (497) main_task: Calling app_main()
I (497) MainPrimary: [APP] MainPrimary Startup..
I (507) MainPrimary: [APP] Free memory: 317964 bytes
I (507) MainPrimary: [APP] IDF version: v5.1.2
I (517) Role01_main: [APP] Role_01 Startup..
I (517) Engineering Prototypes: ETHERNET DEV... 90
I (527) McuSpiPrimaryBusEsp32: McuSpiPrimaryBusEsp32 Constructing...
I (537) McuSpiPrimaryBusEsp32: SPI Primary Host Bus Initializing...
I (537) McuSpiPrimaryBusEsp32: SPI Primary Host Bus Initialized!
I (547) McuSpiPrimaryBusEsp32: McuSpiPrimaryBusEsp32 Constructed!
I (557) DevSpiPrimaryBus: DevSpiPrimary Initializing...
I (557) Engineering Prototypes: ETHERNET DEV... 94
I (567) McuEthernetW5500_Esp32: McuEthernetW5500_Esp32 Initializing...
I (577) McuSpiDeviceEsp32: McuSpiDeviceESP32 Constructing...
I (577) McuSpiDeviceEsp32: McuSpiDeviceESP32 Constructed!
I (587) DevSpiDevice: DevSpiDevice Initializing...
I (587) DevEthernetW5500: DevEthernetW5500 Constructing...
I (597) McuGpioDigitalEsp32: McuGpioDigitalEsp32 Initializing...
I (607) DevGpioDigital: DevGpioDigital Initializing...
I (607) gpio: GPIO[46]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
E (617) McuGpioDigitalEsp32: [0x3fcaaef4] SET Pin[46]=1
I (627) McuGpioDigitalEsp32: McuGpioDigitalEsp32 Initializing...
I (627) DevGpioDigital: DevGpioDigital Initializing...
I (637) gpio: GPIO[14]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (647) DevEthernetW5500: DevEthernetW5500 Initializing as SPI...
I (657) McuSpiDeviceEsp32: Set Device Chip Select to 10
I (657) McuSpiDeviceEsp32: Set Device HostID to 1
I (667) McuSpiDeviceEsp32: [0x3fcaae78] init() complete! [0]
E (667) McuGpioDigitalEsp32: [0x3fcaaf0c] GET Pin[14]=1
I (677) DevEthernetW5500: [0x3fcaae78] GET W5500 Version...
I (687) DevEthernetW5500: [0x3fcaae78] tx_buffer: 0x  00 39 04 FF FF FF FF FF FF  |   000 057 004 255 255 255 255 255 255
I (697) DevEthernetW5500: [0x3fcaae78] rx_buffer: 0x  01 02 03 00 FF FF FF FF FF  |   001 002 003 000 255 255 255 255 255
I (707) Engineering Prototypes: ESP32 MAC Address: [48:27:E2:66:2F:08]
I (717) DevEthernetW5500: [0x3fcaae78] SET W5500 MAC Address...
I (717) DevEthernetW5500: [0x3fcaae78] tx_buffer: 0x  00 09 04 48 27 E2 66 2F 08  |   000 009 004 072 039 226 102 047 008
I (737) DevEthernetW5500: [0x3fcaae78] rx_buffer: 0x  01 02 03 00 00 00 00 00 00  |   001 002 003 000 000 000 000 000 000
I (747) DevEthernetW5500: [0x3fcaae78] GET W5500 MAC Address...
I (747) DevEthernetW5500: [0x3fcaae78] tx_buffer: 0x  00 09 00 FF FF FF FF FF FF  |   000 009 000 255 255 255 255 255 255
I (767) DevEthernetW5500: [0x3fcaae78] rx_buffer: 0x  01 02 03 48 27 E2 66 2F 08  |   001 002 003 072 039 226 102 047 008
I (777) Engineering Prototypes: Set W5500 MAC Address to: [48:27:E2:66:2F:08]
I (787) DevEthernetW5500: [0x3fcaae78] SET W5500 IP Address...
I (787) DevEthernetW5500: [0x3fcaae78] tx_buffer: 0x  00 01 04 C0 A8 56 01 FF FF  |   000 001 004 192 168 086 001 255 255
I (797) DevEthernetW5500: [0x3fcaae78] rx_buffer: 0x  01 02 03 00 00 00 00 FF FF  |   001 002 003 000 000 000 000 255 255
I (807) DevEthernetW5500: [0x3fcaae78] GET W5500 IP Address...
I (817) DevEthernetW5500: [0x3fcaae78] tx_buffer: 0x  00 01 00 FF FF FF FF FF FF  |   000 001 000 255 255 255 255 255 255
I (827) DevEthernetW5500: [0x3fcaae78] rx_buffer: 0x  01 02 03 C0 A8 56 01 FF FF  |   001 002 003 192 168 086 001 255 255
I (837) Engineering Prototypes: Set Gateway to: [192.168.86.1]
I (847) DevEthernetW5500: [0x3fcaae78] SET W5500 Subnet Mask...
I (857) DevEthernetW5500: [0x3fcaae78] tx_buffer: 0x  00 05 04 FF FF FF 00 FF FF  |   000 005 004 255 255 255 000 255 255
I (867) DevEthernetW5500: [0x3fcaae78] rx_buffer: 0x  01 02 03 00 00 00 00 FF FF  |   001 002 003 000 000 000 000 255 255
I (877) DevEthernetW5500: [0x3fcaae78] GET W5500 Subnet Mask...
I (887) DevEthernetW5500: [0x3fcaae78] tx_buffer: 0x  00 05 00 FF FF FF FF FF FF  |   000 005 000 255 255 255 255 255 255
I (897) DevEthernetW5500: [0x3fcaae78] rx_buffer: 0x  01 02 03 FF FF FF 00 FF FF  |   001 002 003 255 255 255 000 255 255
I (907) Engineering Prototypes: Set Subnet Mask to: [255.255.255.0]
I (917) DevEthernetW5500: [0x3fcaae78] SET W5500 IP Address...
I (927) DevEthernetW5500: [0x3fcaae78] tx_buffer: 0x  00 0F 04 C0 A8 56 BA FF FF  |   000 015 004 192 168 086 186 255 255
I (937) DevEthernetW5500: [0x3fcaae78] rx_buffer: 0x  01 02 03 00 00 00 00 FF FF  |   001 002 003 000 000 000 000 255 255
I (947) DevEthernetW5500: [0x3fcaae78] GET W5500 IP Address...
I (957) DevEthernetW5500: [0x3fcaae78] tx_buffer: 0x  00 0F 00 FF FF FF FF FF FF  |   000 015 000 255 255 255 255 255 255
I (967) DevEthernetW5500: [0x3fcaae78] rx_buffer: 0x  01 02 03 C0 A8 56 BA FF FF  |   001 002 003 192 168 086 186 255 255
I (977) Engineering Prototypes: Set IP to: [192.168.86.186]
I (987) DevEthernetW5500: TOGGLING RESET!
E (987) McuGpioDigitalEsp32: [0x3fcaaef4] SET Pin[46]=0
E (997) McuGpioDigitalEsp32: [0x3fcaaef4] SET Pin[46]=1
E (1147) McuGpioDigitalEsp32: [0x3fcaaf0c] GET Pin[14]=1
I (1147) DevEthernetW5500: [0x3fcaae78] GET W5500 Version...
I (1147) DevEthernetW5500: [0x3fcaae78] tx_buffer: 0x  00 39 04 FF FF FF FF FF FF  |   000 057 004 255 255 255 255 255 255
I (1157) DevEthernetW5500: [0x3fcaae78] rx_buffer: 0x  01 02 03 00 FF FF FF FF FF  |   001 002 003 000 255 255 255 255 255
I (1167) DevEthernetW5500: [0x3fcaae78] GET W5500 MAC Address...
I (1177) DevEthernetW5500: [0x3fcaae78] tx_buffer: 0x  00 09 00 FF FF FF FF FF FF  |   000 009 000 255 255 255 255 255 255
I (1187) DevEthernetW5500: [0x3fcaae78] rx_buffer: 0x  01 02 03 48 27 E2 66 2F 08  |   001 002 003 072 039 226 102 047 008
I (1197) Engineering Prototypes: W5500 MAC Address: [48:27:E2:66:2F:08]
I (1207) DevEthernetW5500: [0x3fcaae78] GET W5500 IP Address...
I (1207) DevEthernetW5500: [0x3fcaae78] tx_buffer: 0x  00 0F 00 FF FF FF FF FF FF  |   000 015 000 255 255 255 255 255 255
I (1227) DevEthernetW5500: [0x3fcaae78] rx_buffer: 0x  01 02 03 C0 A8 56 BA FF FF  |   001 002 003 192 168 086 186 255 255
I (1237) Engineering Prototypes: W5500 IP [192.168.86.186]
I (1237) DevEthernetW5500: [0x3fcaae78] GET W5500 IP Address...
I (1247) DevEthernetW5500: [0x3fcaae78] tx_buffer: 0x  00 01 00 FF FF FF FF FF FF  |   000 001 000 255 255 255 255 255 255
I (1257) DevEthernetW5500: [0x3fcaae78] rx_buffer: 0x  01 02 03 C0 A8 56 01 FF FF  |   001 002 003 192 168 086 001 255 255
I (1267) Engineering Prototypes: W5500 Gateway [192.168.86.1]
I (1277) DevEthernetW5500: [0x3fcaae78] GET W5500 Subnet Mask...
I (1287) DevEthernetW5500: [0x3fcaae78] tx_buffer: 0x  00 05 00 FF FF FF FF FF FF  |   000 005 000 255 255 255 255 255 255
I (1297) DevEthernetW5500: [0x3fcaae78] rx_buffer: 0x  01 02 03 FF FF FF 00 FF FF  |   001 002 003 255 255 255 000 255 255
I (1307) Engineering Prototypes: W5500 Subnet [255.255.255.0]
E (1317) McuGpioDigitalEsp32: [0x3fcaaf0c] GET Pin[14]=1
I (1317) DevEthernetW5500: DevEthernetW5500 Initializing as Ethernet...
I (1337) esp_eth.netif.netif_glue: 4a:27:e2:66:2f:08
I (1337) esp_eth.netif.netif_glue: ethernet attached to netif
I (1347) McuEthernetW5500_Esp32: Ethernet Started
I (3347) McuEthernetW5500_Esp32: Ethernet Link Up
I (3347) McuEthernetW5500_Esp32: Ethernet HW Addr 4a:27:e2:66:2f:08
After a few seconds (15 or so?), the system starts reporting the same errors as above.

I was hoping to get some direction on how to address these issue, or if I need to be looking at the WIZNet forums, or the W5500 chip folks.

Thanks in advance.

DrMickeyLauer
Posts: 160
Joined: Sun May 22, 2022 2:42 pm

Re: Running a WIZ550io (SPI Ethernet Module with W5500 chip)

Postby DrMickeyLauer » Sat Jan 20, 2024 11:49 am

Try increasing the log level verbosity to DEBUG to see some more information. Which SPI-frequency do you use? Is this a custom PCB or a breadboard? I have noticed breadboard installations being very sensitive to high SPI frequencies.

ESP_ondrej
Posts: 181
Joined: Fri May 07, 2021 10:35 am

Re: Running a WIZ550io (SPI Ethernet Module with W5500 chip)

Postby ESP_ondrej » Mon Jan 22, 2024 8:19 am

There probably is some issue with SPI as @DrMickeyLauer mentioned.

1) Check the GPIO configuration once again. Ensure INT pin is connected too.
2) If custom board is not used and just wires are used, use wires as short as possible and with matching length.
3) Decrease SPI frequency to e.g. 4 MHz. Note that we are able to run W5500 at 40 MHz but it requires properly designed PCB!

EarthAndy
Posts: 12
Joined: Fri Jan 19, 2024 6:53 pm

Re: Running a WIZ550io (SPI Ethernet Module with W5500 chip)

Postby EarthAndy » Mon Jan 22, 2024 10:11 pm

Thanks for the direction, folks!

I am (was) using a the two modules on a breadboard just hooked up with loose 20cm plug wires. I took the time this morning to cut some solid-core copper wires, to length, and re-wired the SPI runs.

I was able to get the ethernet/basic project to build and connect and get an IP the first time I fired it up - so clearly the issue was my loosey-goosey wiring. I had been trying to get it going at 4MHz, but just as a test added a zero and got it to get an IP at 40MHz. Once my PCBs come in, it looks like it won't be an issue.

I pulled the module into my main application and swapped out my WiFi bits and got my MQTT publisher up and working over ethernet without too much issue.

Appreciate the help!

Who is online

Users browsing this forum: Bing [Bot] and 86 guests