Getting wrong information from wiz550io with STM32 Nucleo-F746ZG


My problem is similar to the one in this post.

This is the code that I’m running on the STM32 board:


  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};

  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",[0],[1],[2],[3]);
  printf("Gate way   : %d.%d.%d.%d\n\r",[0],[1],[2],[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:

SM mask:


DNS server: (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);
	} 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.

First, I suspect GW address must be located on the same local network?
Second, yes, looks like SPI communication problem. You will either need scope to see what is going on, or use W5500 interface at the very low level to see if it responds 0x01, 0x02 and 0x03 during the SPI command phase.

Yes, you are correct that the GW is wrong. For now, I have just been trying to make the device respond correctly, so I ignored that, but will fix it.

I will try with a logic analyzer and see if the data makes any sense when viewed there. It just really surprised me that the DNS was set correctly as I specified.

There is definitely something wrong with the clock it seems. I also don’t know why the CS behaves like that. I’m 100% certain that the pins are correctly connected, so it must be an issue with my setup.

DNS setting is a part of software and not part of the chip.

1 Like