Hello,
I’ve a problem with the W5500-EVB-PICO.
I try to setup the PHY configuration to be sure that the speed is 100 Mbps and the communication is full duplex.
gpio_init(LED_PIN);
gpio_set_dir(LED_PIN, GPIO_OUT);
stdio_init_all();
uint32_t real_clock = clock_get_hz( clk_sys );
printf("%d\r\n",real_clock);
/* Launch Wiznet driver */
wizchip_spi_initialize(); // Initialize the SPI with DMA capability
wizchip_cris_initialize(); // Initialize cris
wizchip_reset(); // Reset the Wiznet chipset
wizchip_initialize(); // Initialize the Wiznet chipset
wizchip_check(); // Check the Wiznet configuration?
wiz_NetInfo g_net_info = {
.mac = {0x00, 0x08, 0xDC, 0x12, 0x34, 0x56}, // MAC address
.ip = {172, 16, 18, 244}, // IP address 172.16.18.244
.sn = {255, 255, 0, 0}, // Subnet Mask
.gw = {172, 16, 16, 254}, // Gateway
.dns = {8, 8, 8, 8}, // DNS server
.dhcp = 0 // DHCP enable/disable
};
set_PHY_configuration( );
reset_PHY( );
Where the set_PHY_configuration() is defined as shown below:
void set_PHY_configuration(void)
{
/* PHY configuration structure */
wiz_PhyConf phy_conf;
/* Configure PHY */
phy_conf.by = PHY_CONFBY_SW;
phy_conf.mode = PHY_MODE_MANUAL;
phy_conf.speed = PHY_SPEED_100;
phy_conf.duplex = PHY_DUPLEX_FULL;
/* Apply PHY configuration */
wizphy_setphyconf(&phy_conf);
}
The green LED flashes briefly after reset and then remains lit.
The yellow LED flashes for a long time and then stays on.
While the yellow LED is flashing, I have to wait because the W5500 is not yet ready to create a socket.
When the yellow LED is stable ( ON ) , I can successfully set up the network socket.
I use this function to check the link status:
while (! (wizphy_getphylink( ) == PHY_LINK_ON ) )
But I can’t find any other function to check that the W5500 and network are fully configured and ready to be programmed with a socket after a reset.
Which register do I have to test? Is there a specific function to check that the Wiznet PHY and network are ready?
Kind regards