Hello,
My problem is similar to the one in this post.
This is the code that I’m running on the STM32 board:
W5500Init();
HAL_Delay(500);
wiz_NetInfo defaultNetInfo = { .mac = {0x00,0x08,0xdc,0xff,0xee,0xdd},
.ip = {192,168,1,130},
.sn = {255,255,255,0},
.gw = {192,168,0,254},
.dns = {8, 8, 8, 8},
.dhcp = NETINFO_STATIC};
wizchip_setnetinfo(&defaultNetInfo);
wizchip_getnetinfo(&defaultNetInfo);
printf("Mac address: %02x:%02x:%02x:%02x:%02x:%02x\n\r",defaultNetInfo.mac[0],defaultNetInfo.mac[1],defaultNetInfo.mac[2],defaultNetInfo.mac[3],defaultNetInfo.mac[4],defaultNetInfo.mac[5]);
printf("IP address : %d.%d.%d.%d\n\r",defaultNetInfo.ip[0],defaultNetInfo.ip[1],defaultNetInfo.ip[2],defaultNetInfo.ip[3]);
printf("SM Mask : %d.%d.%d.%d\n\r",defaultNetInfo.sn[0],defaultNetInfo.sn[1],defaultNetInfo.sn[2],defaultNetInfo.sn[3]);
printf("Gate way : %d.%d.%d.%d\n\r",defaultNetInfo.gw[0],defaultNetInfo.gw[1],defaultNetInfo.gw[2],defaultNetInfo.gw[3]);
printf("DNS Server : %d.%d.%d.%d\n\r",defaultNetInfo.dns[0],defaultNetInfo.dns[1],defaultNetInfo.dns[2],defaultNetInfo.dns[3]);
I’m getting
IP address: 2.0.3.0
SM mask: 2.0.3.0
Gateway: 2.0.3.0
DNS server: 8.8.8.8 (Correct)
It might be that I am reading data from the SPI wrong. However, I set up my code very simiarly to how this is done. Are there any reasons that I would be getting the specific bytes 0x2, 0x0, 0x3, 0x0?
I also tried to add this check in the init function:
do {
if(ctlwizchip(CW_GET_PHYLINK, (void*)&tmp) == -1)
{
printf("Unknown PHY Link status.\r\n", 1, 10);
return;
}
} while (tmp == PHY_LINK_OFF);
And I found out that that freezes, so the PHYLINK register is always set to PHY_LINK_OFF. However, I can see my wiz550io LED blinking green and the orange LED is on. Is this a router problem? SPI problem?
Thank you in advance.