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)
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
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
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
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
Pull Request
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.