User Manual
GD32450I-EVAL
42
/
51
users can see the automatic allocated ip address of the board from the HyperTerminal.
5.27.3
Raw_webserver
DEMO Purpose
This demo includes the following functions of GD32 MCU:
Learn to use Lwip stack
Learn to use raw API to handle with a task
Learn how to realize a web server
Learn how to use a web server to control LEDs
Learn how to use a web server to monitor the board V
REFINT
voltage
Learn how to use DHCP to allocate ip address automatically
Learn to handle with received packet in polling mode and in interrupt mode
This demo is based on the GD32450I-EVAL board, it shows how to configure the enet
peripherals to send and receive frames in normal mode and use lwip tcp/ip stack to
realize webserver application.
JP12, JP13, JP17, JP18, JP20, JP22 must be fitted. JP5 jump to Usart.
It is configured in RMII mode, and 25MHz oscillator is used, the system clock is
configured to 200MHz.
This demo realizes webserver application:
Users can visit the eval board through Internet Explorer, the eval board acts as a
webserver, and the url is the local ip address of the eval board. There are two
experiments realized, one is the LEDs control, the other one is the ADC monitoring
V
REFINT
voltage in real-time.
If users need dhcp function, it can be configured from the private defines in main.h. This
function is closed by default. Users can use a router to connect the eval board, and use
the COM port to print the automatic allocated ip address, then connect your mobile
phone to the wifi which the router send. Users can visit the eval board and control it on
your mobile phone.
By default, the packet reception is polled in while(1). If users want to receive packet in
interrupt service, uncomment the macro define USE_ENET_INTERRUPT in main.h.
Note: Users should configure ip address, mask and gw of GD32450I-EVAL board
according to the actual net situation from the private defines in main.h.
DEMO Running Result
Download the program <Raw_webserver> to the EVAL board, using Internet Explorer
software, enter in the ip address of the board, click on the LED control linker, choose the
LED checkboxes users want to light, and “send”, the corresponding LEDs will light. Click
on the ADC monitor linker, the real-time V
REFINT
voltage is showed on the webpage, and
the data refreshes every second automatically.
The web home page shows as below: