SEARCH
TOOLBOX
LANGUAGES
modified on 15 July 2010 at 17:52 ••• 123,701 views

Eagle enet tftpd Example

From Manuals

Revision as of 17:52, 15 July 2010 by Support (Talk | contribs)
Jump to: navigation, search

Ethernet TFTPD Server (enet_tftpd)

Compatibility Eagle 50E, 100

Contents

TFTP Overview

Origins

TFTP (Trivial File Transfer Protocol) is a very simple file transfer protocol commonly implemented on top of UDP (User Datagram Protocol) using port number 69. Its purpose is to move files between machines on different networks and is designed to be small and easily implemented. It's only features the reading and writing of files and does not offer any other advanced features or security. TFTP currently supports two different modes, "netascii" (ASCII) and "octet" (binary) with a third "mail" mode being made obsolete in 1992 by RFC1350.

Common uses for TFTP

Data downloads

Data collected and stored on the Eagle can be easily accessed and downloaded remotely via TFTP.

Script uploads

New and updated scripts which control your embedded application can be uploaded remotely from a network machine.

Firmware updates

The latest firmware updates can be pushed to the Eagle remotely via TFTP.

enet_tftpd example

microSD filesystem

This application uses the FatFs FAT file system for embedded systems. This allows the data on the microSD to be read with other FAT compatible systems (including Windows, Linux, Mac OSX). The FatFs file system limits file sizes to 4GB, volume size to 2TB, cluster size to 64KB, and sector size to 4KB. The FAT sub-type is also required to be either FAT12, FAT16, or FAT32. A virtually unlimited number of new files can be uploaded via TFTP, dependent on memory space. Uploading an existing file will overwrite the old file.

Internal filesystem

This application has limited support for data storage on its internal flash memory. Storage capacity is severely limited as 256KB of memory must be shared with the both the bootloader and application. Data can either be stored at compile time or uploaded at run time.

Files stored at compile time are included as lmi-fsdata.h and are a part of object code. Use the makefs.bat utility to translate the files in \eagle\enet_tftpd\fs\ to a single header file. These files are read only.

Uploading of data to internal memory at run time is limited to a single file. Additionally, this file must fit within an allocated space determined at compile time. enet_tftpd uses a default of 16KB which can be made larger or smaller depending on the size of your application. Note: Uploading any new data to the internal file system will erase old data!

Compile options

Firmware update mode

Firmware update mode is set by defining BL_UPDATE as a compiler pre-processor option. With this option, any file uploaded to the board will be flashed to memory address 0x00 and board will be reset. This data can not be downloaded later by a GET request as no file system information is recorded.

TFTP port

The TFTP port can be specified by defining TFTP_PORT as a compiler pre-processor option. For example, to set the port as 6969, use TFTP_PORT=6969. If no port is specified, enet_tftpd will use the default port, 69.

TFTP clients

Command line TFTP

Windows

A TFTP command line client is included with Windows 2000, XP, Vista, and 7 licenses. You will need to make sure this utility is installed by checking the installed components in the Control Panel.

To learn about the TFTP client usage, enter tftp at a command prompt. To download a file from the board in ASCII mode, enter tftp hostname GET filename. Alternatively, to upload an ASCII file to the board, enter tftp hostname PUT filename. To specify a binary mode transfer, specify the -i option before the hostname, i.e. tftp -i hostname GET filename.

Windows Command Line

Linux

A TFTP command line client is included in most Linux distributions. If not, it can easily be installed by entering sudo apt-get install tftp at the terminal.

To learn about the TFTP client usage, enter man tftp at the terminal. To begin a new session, enter tftp hostname. To download or upload a file, enter GET filename or PUT filename respectively. Entering the tftp command each time in Linux is unnecessary. To switch to binary mode, enter mode binary (ASCII mode is default). To end the TFTP session, enter quit.

Linux Command Line

GUI TFTP

TFTP Limitations

Security

No password

No firewall

File size

Internal filesystem writing

Summary