Network Component  
MDK Middleware for IPv4 and IPv6 Networking
 
Loading...
Searching...
No Matches
HTTP Upload

The HTTP Upload example implements a web based interface to an SD card attached to a development board.

The user is able to list the contents of the memory card and to upload files to it.

The following picture shows an exemplary connection of the development board and a Computer.

HTTP upload example hardware setup

Project Organization

The HTTP Upload project is available as part of the Network Reference examples.

Application Source Files

Following files implement application-specific logic in the example:

  • HTTP_Upload.c contains the application main thread which initializes the Network Component.
  • HTTP_Server_CGI.c defines the functions for the scripting language for communication with the hardware.
  • ./Web/ directory contains all the HTML and CGI files that will be compiled into the Web.c file. The files in this group determine the actual layout of the web page and the behaviour of the different refs using CGI.
  • Web.c is a compiled file that will be generated by the FCARM File Converter tool from all the web input files.

Software Components Configuration Files

Configuration files for the software components used in the project are located in the ./RTE/ directory and can be modified by users to adjust the operation of related components.

Following configuration files are provided with this example:

When a board layer is added to the project, corresponding configuration files for the board and device components will become available in the local ./Board/ directory.

Board Layer

In order to build the project it shall be extended with a compatible board layer that provides following interfaces as connections:

  • CMSIS_ETH: CMSIS-Driver for Ethernet interface
  • CMSIS_MCI: CMSIS-Driver for Memory Card Interface
  • CMSIS_VIO: CMSIS-Driver for Virtual I/O interface
  • STDOUT: Standard Output redirection

Build the Project

Working with MDK-Middleware Examples explains the workflow for accessing, configuring and building an MDK-Middleware example project for your target hardware.

  1. Open the Network MDK-Middleware reference example.
  2. Make sure the compatible board layer is configured.
  3. Select HTTP_Upload as an active project for the build process.
  4. Build the project and observe that no errors are reported.

Run the Example

Setup

Board-specific hardware setup such as jumpers, Ethernet ports, power supply, etc. is documented in the board layer description (README.md) of your selected target.

  1. Load the executable image to the target development board.
  2. Use an Ethernet cable to connect your development board to the local area network. The PC is assumed to be already in this LAN.
  3. Insert an SD Card to corresponding slot on the development board. Reset the board to restart the program.

Example execution

The HTTP Upload example can be tested on any PC using any browser available.

In the browser URL area type the address to the local host name for the server that is defined in the Net_Config.h file. The default name is my_host, and for this case type http://my_host as the URL. If you have a DCHP server in your network, you will be automatically connected.

To log in to the server use admin for the user name and no password (you can change the defaults in the Net_Config_HTTP_Server.h file). The following (or a similar) page will come up in your browser:

HTTP upload web page

If you get an error message, please verify that all network, IP and other settings are correct.

Use the links File Upload, List Directory and Format SD Card available on the page to perform corresponding actions and observe their correct execution.