MicroPython on RP2040 : DHCP With Wiznet5k(Ethernet)

by irinak1 in Circuits > Raspberry Pi

1132 Views, 5 Favorites, 0 Comments

MicroPython on RP2040 : DHCP With Wiznet5k(Ethernet)

KakaoTalk_20220303_135644616.jpg

This is about series of projects that will be focusing on software porting to various application and microcontrollers.

In this first port of the series, I will be focusing on porting MicroPython to Wiznet5K from Raspberry pi (RP2040). I have confirmed that wiznet5k doesn't support #DHCP on docs.micropython website.

Supplies

github_1.JPG

W5100S-EVB-Pico x 1

Update the WIZNET5K Library

The #iolibrary provided by WIZnet was updated a lot and a chip was added, and this part was applied. (added W5105(#w5100s), w5200, w5100 and w5300)

diff --git a/drivers/wiznet5k/ethernet/wizchip_conf.c b/drivers/wiznet5k/ethernet/wizchip_conf.c

Modified DHCP Timeout Handler

As the interrupter method was missing in the code, the Handler function was modified.

Modified CMakeLists.txt and Makefileof Rp2

github_2.JPG

in ports/rp2/CMakeLists.txt

I added SSL library and wiznet5k library. If you want to know the modifications of the Ethernet-related library, check 0001-Added-WIZnet-Chip-library.patch(Github : https://github.com/Wiznet/RP2040-HAT-MicroPython )


Download

github_3.JPG

To start, we’ll need to load a special firmware onto the Pico.Connect one end of a USB micro B cable into your computer. Push and hold the BOOTSEL button on your Pico. While holding the button, plug the other end of the USB cable into the Pico board(the hardware revision version add the reset button(run)). This will cause the Pico to load its bootloader.

DHCP

github_4.JPG

Pull Request

github.JPG

I have sent a pull request to the micropython repository but it is not being applied.

(~Nov 23, 2021)

I don't know why it doesn't work.

So, I made a patch file using diff and apply among git commands and also I used the cmake.

In the case of patch, it is posted in Korean, but there is no problem in seeing the git command or the cmake command used.

https://blog.naver.com/roruca/222659759055

Add Patch File and Complete Project

Micropython rp2040 Wiznet5K(DHCP )

If you just use wiznet5k library on rp2040, please visit to website and download the firmware

Maybe Next project will be upip library porting