[W5100S-EVB-Pico]: How to set PHY_SPEED to 100Mbit/s ?

Hello all,

sorry for making another post, but there is a lack of basic examples on wiznet GitHub…

As a starting point I followed the DHCP_DNS example and modified it into a simple UDP-sender to test the performance on the “PC”-side using “iperf”. However, the bandwidth is limited to 8-9MBit/s and I think the PHY is working at 10MBit/s and not 100Mbit/s. I changed the CPU SYS Clock to 240MHz and the SPI clock used by wiznet driver to 55MHz. I found this post (Can't connect with 100Mbit) where another user found a way to set the 100MBit/s but its not working for me. My minimal code is listed below, but unfortunately it is not working, since the speed is still 10MBit/s. How do I properly set the speed to 100MBit/s ?

int main(){
    /* SYS clock settings of the RP2040 */
    set_sys_clock_khz(PLL_SYS_FREQ_KHZ, true);


    printf("<%s>: System clock in Hz: %d\n",EXAMPLE_NAME, clock_get_hz(clk_sys));

    printf("<%s>: Launching Wiznet driver...\n",EXAMPLE_NAME);

    /* 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?

    /* Approach for setting the PHY to 100MBit/s */
    wiz_PhyConf cnf;
    // Ethernet controller
    setMR2((uint8_t)getMR2() | 0x80);
    cnf.mode = PHY_MODE_MANUAL;
    cnf.speed = PHY_SPEED_100;
    cnf.duplex = PHY_DUPLEX_FULL;
    ctlwizchip(CW_SET_PHYCONF, (wiz_PhyConf*)&cnf);
    printf("<%s>: Wiznet driver launched\n",EXAMPLE_NAME);

    printf("<%s>: Launching network initialization...\n",EXAMPLE_NAME);
    network_initialize(g_net_info); // apply from DHCP
    printf("<%s>: Network initialization done\n",EXAMPLE_NAME);

    /* Initialize UDP socket */
    printf("<%s>: Launching UDP socket initialization\n",EXAMPLE_NAME);
     tcp_socket_retval = socket(0, Sn_MR_UDP, SOCKET_TCP_PORT,0);

    if(tcp_socket_retval !=0){
        printf("<%s>: Failed to create UDP socket\n",EXAMPLE_NAME);
    printf("<%s>:  UDP socket created!\n",EXAMPLE_NAME);

    uint8_t destip[4]={192,168,1,118};
    char buffer_tx[512];

    for(int i=0; i<512; i++){

    printf("<%s>: Entering the main loop now!\n",EXAMPLE_NAME);
    while(1) {


Best regards,

Hello @opcodex64

Please refer to the example code below and check it after adding it.

  1. Change PHY configuration
/* W5x00 configuration header */
#include "wizchip_conf.h"

    /* 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 */
  1. Reset PHY
    /* Reset PHY */

Additionally, you can use ‘wizpy_getphyconf()’ to get PHY configuration, so please refer to it.

Hello austin,

thanks for your reply! I think it worked for me, since I was able to achieve 14MBit/sec using “iperf” in server mode (TCP). Furthermore, I wrote a simple tcp server application in python where I receive a fixed datasize using the python “recv”-function (socket library!). To calculate the transfer speed, one need the data transmission time and for this I have just calculated the difference between the timestamp before and after the “recv”-function in python. However, for a datasize of approx. 100MBytes I achieve a net speed using TCP protocol of 20-22MBit/sec, which is fine for the W5100S, since the limit is 25MBit/sec max. according the datasheet.

I can share the code after “cleaning it up”, if desired.

Best regards,

Hi @opcodex64

If you can share the code, please share it.

I think it will be helpful not only for W5100S-EVB-Pico but also for many people who use W5100S.

Thank you.