Overview
This example shows how to build HTTP server using Mongoose library and run it on NXP MIMXRT1020 development board with AzureRTOS. The source code for this tutorial is located at https://github.com/mongoose-examples/nxp-mimxrt1020-azurertos
Project structure
In general, the most of the example is regular MCUXpresso IDE project. Mongoose related files are
source/web_server.c
source/web_server.h
source/mongoose.c
source/mongoose.h
Board network (e.g. IP address) configuration can be found in
source/web_server.h
General description
First of all, set IP address, network mask and gateway suitable for your network in source/web_server.h
file. Default address is 192.168.0.10
.
Build the sample and run it on development board (see build and run options in Building sample section).
After initialization application starts mongoose events loop and blinks LED. Once LED started to blink - web server is ready. Open your web browser and navigate to board IP address, you should see "Hello, world" page (see below).
Build options
There are (at least) two options to build the sample:
- Make command
- Using MCUXpresso IDE software
Option 1 - make
Building with make
is pretty straightforward for whose, who familiar with this command.
- Open terminal
- Navigate to project folder
- Make sure to have docker installed on your system
- Run
make build
command - Firmware file is
firmware.axf
(orfirmware.bin
if you prefer binary format), use any suitable utility to program the board - Done! See LEDs status to understand application status and once it starts to blink оpen your web browser and navigate to board IP address, you should see "Hello, world" page.
Option 2 - MCUXpresso IDE
MCUXpresso IDE is a standard software, provided by NXP Semiconductors. To build this sample with MCUXpresso IDE you need to do the following steps:
- Start MCUXpresso IDE
- Choose
File -> Open Projects from file system
- Choose directory where example is located, make sure
MIMXRT1020-azure
project is checked, and then pressFinish
- Check if you have required SDK installed, if not
- 1 Press
Install New Plugin SDKs
- 2 In board list choose
evkmimxrt1020
and pressInstall
- 3 Once wizard is complete, you should see installed SDK
- Select
Debug as -> MCUXpresso IDE LinkServer (inc. CMSIS-DAP) probes
NOTE: you may prefer to debug using other interfaces, but this sample is configured to print output information in semi-host mode. - During the process you will be asked what board to use, choose correct one
- After successful building and flashing program will pause in the beginning of
main
function - Go to
Terminal
tab and open terminal settings. - Configure terminal as shown on picture below
- Resume program
- Done! LED should start to blink and you should see Mongoose output in terminal windows
- Open your web browser and navigate to board IP address, you should see "Hello, world" page.