Network Component  
MDK Middleware for IPv4 and IPv6 Networking
 
Loading...
Searching...
No Matches
FTP Server

This examples implements an FTP server on a device that allows you to manage files from a computer connected to the same network.

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

FTP server hardware setup

Project Organization

The FTP Server project is available as part of the Network Reference examples.

Application Source Files

Following files implement application-specific logic in the example:

  • FTP_Server.c contains the application main thread which initializes the Network Component.

You can add the following optional files, which are not included in the project by default:

  • FTP_Server_Multiuser.c is used for specifying multiple users and access rights for these users.
  • FTP_Server_Access.c enables the server to accept or block connection requests from certain remote clients.
  • FTP_Server_Event.c contains a routine that notifies the user application about certain events happening on the FTP server (such as file/directory manipulation events).

Software Components Configuration Files

Configuration files for the software components used in the project are available 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 CMSIS-Driver 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 FTP_Server 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 a member of this LAN.
  3. If your hardware supports it, insert a SD card into the SD card slot. This will be the data storage that you will have access to. Hardware that does not have a SD card interface will most probably use a RAM disk for FTP demonstration.

Example execution

You can use either a Command Line utility or a GUI FTP client program to connect to the FTP server from your host PC.

In the Command console of your PC type ftp my_host (or the respective hostname specified in the Net_Config.h file). If you have a DCHP server in your network, it will automatically connect to the FTP server.

You will be asked for a username and password combination. Use admin for the user name and no password (you can change the defaults in the Net_Config_FTP_Server.h file). After a successful log in, you should see something like this:

FTP server command line interface