---
title: "Getting started with W5100S-EVB-Pico2 and Micropython"
url: "https://maker.wiznet.io/viktor/projects/getting-started-with-w5100s-evb-pico2-and-micropython/"
markdown_url: "https://maker.wiznet.io/viktor/projects/getting-started-with-w5100s-evb-pico2-and-micropython/md"
type: "WCC: WIZnet Created Content"
author: "viktor"
author_url: "https://maker.wiznet.io/viktor/"
published: "2024-08-22"
language: "en"
likes: 0
views: 4383
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Getting started with W5100S-EVB-Pico2 and Micropython

> This project aims to provide a simple guide how to use Ethernet with Micropython on newest W5100S-EVB-Pico2 built around RP2350

## Documents and links

- [loopback-test.py](https://maker.wiznet.io/_lib/download.asp?path=project/2281&downfile=main%2Epy) (code)
- [custom firmware for W5100S-EVB-Pico2](https://maker.wiznet.io/_lib/download.asp?path=project/2281&downfile=firmware%2Euf2)

## Article

## Introduction

WIZnet recently unveiled its new evaluation boards built around newest RP2350 chip. W5100S-EVB-Pico2 will soon hit the shelves and I decided to make a simple guide how to use these boards with MicroPython.

IMPORTANT NOTE: WIZnet is now working on adding its boards to MicroPython and CircuitPython websites. The official build will be available soon. This guide aims to test only.

## Step 1.

The [MicroPython for Pico2](https://micropython.org/download/RPI_PICO2/)is now available but it is still a pre-build version.

![](https://maker.wiznet.io/upload/ckeditor5/681883597%5F1724262747%2Epng)

As of this guide creation date, the [pull request](https://github.com/micropython/micropython/pull/15619) was not yet merged.

In order to add networking bundle to Pico 2 firmware, it is necessary to clone the forked repository: <https://github.com/dpgeorge/micropython/tree/rp2-add-rp2350>

I will skip the explanation of how to setup MicroPython on local machine. To add the network bundle to the Pico 2, I just copied lines from W5100S-EVB-Pico config files. The compiled firmware can be found in attachment below.

### Step 2.

Press & hold the BOOTSEL button on the board and connect it to PC. Then copy compiled firmware to the RP2350 Drive.

![](https://maker.wiznet.io/upload/ckeditor5/681883597%5F1724321312%2Epng)

### Step 3.

I used Thonny IDE for coding.

For tests I decided to proceed with basic loopback test from WIZnet repository:

<https://github.com/Wiznet/RP2040-HAT-MicroPython/blob/main/examples/Loopback/W5x00_Loopback.py>

**IMPORTANT: Update the network configuration according to your environment**

![](https://maker.wiznet.io/upload/ckeditor5/681883597%5F1724321510%2Epng)

Also, do not forget to select the operation mode in the Main

![](https://maker.wiznet.io/upload/ckeditor5/681883597%5F1724322489%2Epng)

### Step 4.

After running the code, below results can be seen in the shell

![](https://maker.wiznet.io/upload/ckeditor5/681883597%5F1724322591%2Epng)

The loopback server is now running. Let's try connecting to it.

For TCP client I used Hercules software. Enter the server IP & port and press "Connect" button.

![](https://maker.wiznet.io/upload/ckeditor5/681883597%5F1724323766%2Epng)

In Thonny shell new log can be observed

![](https://maker.wiznet.io/upload/ckeditor5/681883597%5F1724323833%2Epng)

When sending message from client to server, the board will send back the received message

![](https://maker.wiznet.io/upload/ckeditor5/681883597%5F1724324054%2Epng)

Loopback is running properly!

Full code can be found below and in attachment:

```python
from usocket import socket
from machine import Pin,SPI
import network
import time

#W5x00 chip init
def w5x00_init():
    spi=SPI(0,2_000_000, mosi=Pin(19),miso=Pin(16),sck=Pin(18))
    nic = network.WIZNET5K(spi,Pin(17),Pin(20)) #spi,cs,reset pin
    nic.active(True)
    
    #None DHCP
    nic.ifconfig(('192.168.11.20','255.255.255.0','192.168.11.1','8.8.8.8'))
    
    #DHCP
    #nic.ifconfig('dhcp')
    
    print('IP address :', nic.ifconfig())
    while not nic.isconnected():
        time.sleep(1)
        print(nic.regs())
    
def server_loop(): 
    s = socket()
    s.bind(('192.168.11.20', 5000)) #Source IP Address
    s.listen(5)
    
    print("TEST server")
    conn, addr = s.accept()
    print("Connect to:", conn, "address:", addr) 
    print("Loopback server Open!")
    while True:
        data = conn.recv(2048)
        print(data.decode('utf-8'))
        if data != 'NULL':
            conn.send(data)

def client_loop():
    s = socket()
    s.connect(('192.168.11.2', 5000)) #Destination IP Address
    
    print("Loopback client Connect!")
    while True:
        data = s.recv(2048)
        print(data.decode('utf-8'))
        if data != 'NULL' :
            s.send(data)
        
def main():
    w5x00_init()
    
###TCP SERVER###
    server_loop()

###TCP CLIENT###
    #client_loop()

if __name__ == "__main__":
    main()
```

## Conclusion

I hope this guide can help with running MicroPython on EVB-Pico2 boards. The official builds will be soon released. Stay tuned for updates!

---

Source: https://maker.wiznet.io/viktor/projects/getting-started-with-w5100s-evb-pico2-and-micropython/
