Using TFTP

Discussion to talk about software related topics only.
Post Reply
SeeCwriter
Posts: 617
Joined: Mon May 12, 2008 10:55 am

Using TFTP

Post by SeeCwriter »

I would like to add TFTP as a server to my NANO project. But the functions in tftp.cpp appear to be designed only for client use. Is there a server option available for the v2.9.5/6/7 version of the tools?
User avatar
pbreed
Posts: 1086
Joined: Thu Apr 24, 2008 3:58 pm

Re: Using TFTP

Post by pbreed »

Server sourcing files or receiving files?
Where are the files the server is getting/sending coming from?
Programmatically generated/consumed?
To/From SDRAM?
Device Flash.
Device Flash file system
external SD Fat file system?

TFTP is a really simple protocol would not be hard to do, please be specific about the details...of what transactions you want this server to perform?
SeeCwriter
Posts: 617
Joined: Mon May 12, 2008 10:55 am

Re: Using TFTP

Post by SeeCwriter »

We only need to source/send a file. The file is installed at the factory during the manufacturing process via a different method and stored in EEPROM.
We receive a TCP command to prepare for file transfer, which causes the file to be copied to a buffer in sram. File size is around 128k.

It seems like a simple task could be created that just listened on UDP port 69, and when a WREQ command arrived, it would ack the command and call a modified version of function SendTFTP to send the file.

This is a rather convoluted process to send a file, but we need to be backward compatible with legacy processes.
User avatar
pbreed
Posts: 1086
Joined: Thu Apr 24, 2008 3:58 pm

Re: Using TFTP

Post by pbreed »

I'll try and get this working this week...
User avatar
pbreed
Posts: 1086
Joined: Thu Apr 24, 2008 3:58 pm

Re: Using TFTP

Post by pbreed »

Would this work for you:

TFTP_Server MyServer(port_num);

//Now add files to the server....
TFTP_Server_File(MyServer,"Filename.dat", pFileData, file_len);
TFTP_Server_File(MyServer,"Filename2.dat", pFileData2, file_len2);
*
*
*
etc for as many files as you want to serve.
SeeCwriter
Posts: 617
Joined: Mon May 12, 2008 10:55 am

Re: Using TFTP

Post by SeeCwriter »

Yes. We only have one file to send.
User avatar
pbreed
Posts: 1086
Joined: Thu Apr 24, 2008 3:58 pm

Re: Using TFTP

Post by pbreed »

Done, submit a support request to get the code.
Post Reply