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:

  1. Make command
  2. Using MCUXpresso IDE software

Option 1 - make

Building with make is pretty straightforward for whose, who familiar with this command.

  1. Open terminal
  2. Navigate to project folder
  3. Make sure to have docker installed on your system
  4. Run make build command
  5. Firmware file is firmware.axf (or firmware.bin if you prefer binary format), use any suitable utility to program the board
  6. 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:

  1. Start MCUXpresso IDE
  2. Choose File -> Open Projects from file system
  3. Choose directory where example is located, make sure MIMXRT1020-azure project is checked, and then press Finish
  4. Check if you have required SDK installed, if not
  5. 1 Press Install New Plugin SDKs
  6. 2 In board list choose evkmimxrt1020 and press Install
  7. 3 Once wizard is complete, you should see installed SDK
  8. 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.
  9. During the process you will be asked what board to use, choose correct one
  10. After successful building and flashing program will pause in the beginning of main function
  11. Go to Terminal tab and open terminal settings.
  12. Configure terminal as shown on picture below
  13. Resume program
  14. Done! LED should start to blink and you should see Mongoose output in terminal windows
  15. Open your web browser and navigate to board IP address, you should see "Hello, world" page.