Wiznet makers

mason

Published May 27, 2024 © 3-Clause BSD License(BSD-3-Clause)

82 UCC

15 WCC

28 VAR

0 Contests

0 Followers

0 Following

WebServer Firmware Update

WebServer Firmware Update

COMPONENTS Hardware components

WIZnet - W5500-EVB-Pico

x 1


PROJECT DESCRIPTION

Introduction

This project is an example of implementing and using a web server to perform a firmware update on the W5500-EVB-Pico. The W5500-EVB-Pico is an Ethernet development board based on the WIZnet W5500 Ethernet chip and the Raspberry Pi RP2040 microcontroller. By following this guide, you will be able to set up a web server on the W5500-EVB-Pico, which allows for easy firmware updates over the network.

 

Test Exmample

Clone Project

git clone --recurse-submodules https://github.com/wiznetmaker/RP2040-HAT-WebServer_FWUP-C.git
 

Set pico-sdk path

Set the PICO_SDK_PATH in RP2040-HAT-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 RP2040-HAT-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

RP2040-HAT-WebServer_FWUP-C

mkdir build
cd build
cmake -G "NMake Makefiles" ..
nmake

Copy and paste the w5x00_webserver_fwup.uf2 file located in this path RP2040-HAT-WebServer_FWUP-C\build\examples\webserver_fwup to the W5500-EVB-Pico board.


Open WebServer
Connect to the web server by entering the IP address of the W5500-EVB-Pico and port number 50000 in your internet browser. The port number is defined in the path RP2040-HAT-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 RP2040-HAT-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

 

 

Documents
  • https://github.com/wiznetmaker/RP2040-HAT-WebServer_FWUP-C.git

Comments Write