W55RP20 WebServer Firmware Update
W55RP20 WebServer Firmware Update
Introduction
This project is an example of implementing and using a web server to perform a firmware update on the W55RP20-EVB-Pico. By following this guide, you will be able to set up a web server on the W55RP20-EVB-Pico, which allows for easy firmware updates over the network.
Test Exmample
Clone Project
git clone --recurse-submodules https://github.com/WIZnet-ioNIC/WIZnet-PICO-WebServer-FWUP-C
Set pico-sdk path
Set the PICO_SDK_PATH in WIZnet-PICO-WebServer-FWUP-C\CMakeLists.txt
Refer to the documentation below for more information.
https://www.raspberrypi.com/documentation/microcontrollers/c_sdk.html
if(NOT DEFINED PICO_SDK_PATH)
set(PICO_SDK_PATH ${CMAKE_SOURCE_DIR}/../pico-sdk)
message(STATUS "PICO_SDK_PATH = ${PICO_SDK_PATH}")
endif()
Set your network infomation
Input your Network information from the file WIZnet-PICO-WebServer-FWUP-C\examples\webserver_fwup\w5x00_webserver_fwup.c.
/* Network */
static wiz_NetInfo g_net_info =
{
.mac = {0x00, 0x08, 0xDC, 0x12, 0x34, 0x56}, // MAC address
.ip = {192, 168, 2, 141}, // IP address
.sn = {255, 255, 255, 0}, // Subnet Mask
.gw = {192, 168, 2, 1}, // Gateway
.dns = {8, 8, 8, 8}, // DNS server
.dhcp = NETINFO_STATIC // DHCP enable/disable
};
Build & Write
WIZnet-PICO-WebServer-FWUP-C
mkdir build
cd build
cmake -G "NMake Makefiles" ..
nmake
Copy and paste the webserver_fwup.uf2 file located in this path WIZnet-PICO-WebServer-FWUP-C\build\examples\webserver_fwup to the W55RP20-EVB-Pico board.
Open WebServer
Connect to the web server by entering the IP address of the W55RP20-EVB-Pico and port number 50000 in your internet browser. The port number is defined in the path WIZnet-PICO-WebServer-FWUP-C\port\http_server\inc\httpServer.h.
#define HTTP_SERVER_PORT 50000
File Upload and Firmware update
Click the Choose file button to select the bin file to update and click the Upgrade button.I have included the blink_app_linker bin as an example. Select the blink_app_linker.bin file from the path WIZnet-PICO-WebServer-FWUP-C\build\examples\blink_app.
You can see that PICO_DEFAULT_LED_PIN toggles every 250ms, and you should see a message like the one below.
Make Application binary
The project is set up so that the Application is located in 1Mbytes of flash memory.
If you want to modify this, modify the file below in the .ld file and replace it with the following,
FLASH(rx) : ORIGIN = 0x10000000 + 1024k, LENGTH = 1024k.
And you need to modify APPLICATION_OFFSET.
#define APPLICATION_OFFSET 0x100000