lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] TFTP init


From: nrichard
Subject: Re: [lwip-users] TFTP init
Date: Wed, 18 Jan 2017 14:11:36 -0700 (MST)

Stephen Cowell wrote
> Some confusion... your board, your design, is an FTP server?  You are 
> pushing files from a PC client to an embedded server.
> I'm assuming no OS... raw, in other words.

FTP, TFTP, HTTP, doesn't matter to me.  I just want to transfer a file from
my PC, an image file, to my board over the network. I only plan on
transferring 1 image file, maybe a config file too, but just the image file
is fine.  No OS is running and preferably no file system either.


Stephen Cowell wrote
> Do you have the SAM4E-EK?  or the Explained? kit?  Or are you already on 
> custom hardware?   Always easiest to start with a kit.

I'm using a SAM4E Xplained Pro (Evaluation Kit).


Stephen Cowell wrote
> Looking at fatfs's conf_access.h file, I see this entry:
> 
> <>
> 
> /*! \name Activation of Logical Unit Numbers
>   */
> //! @{
> #ifdef VIRTUAL_MEMORY_ENABLE
> #define LUN_0                ENABLE   //!< Enable On-Chip Virtual Memory.
> #else
> #define LUN_0                DISABLE  //!< Disable On-Chip Virtual Memory.
> #endif
> </>
> .. so it looks like FatFS will do virtual memory.  I don't expect that 
> you'll be able to get on-chip flash working easily... this seems more 
> designed for RAM.  How big are the files you're moving? You say 
> 'image'... these are bitmaps, or iso's?  Using on-chip flash is 
> complicated.  Use RAM if at all possible.  Open the fatfs docs (you'll 
> have to tell AtmelStudio to use a browser, this is silly of course) and 
> find the f_mount() function... follow what it does. They have a user
> forum,
> 
> http://elm-chan.org/fsw/ff/bd/

Correct, the example project from Atmel is using virtual memory on RAM,
which was causing my original problem (I ran out of memory).  I'd eventually
want my image file to be on the flash.  The image file is an iso file. ex:
image_file.bin and once finished will probably be less than 500KB.  I will
boot to the file upon reset (thus why it needs to be in flash).  I'll check
out the docs / forums.


Stephen Cowell wrote
> I created an example project for LWIP using the 
> THIRDPARTY_RAW_BASIC_HTTP example, then I created other example projects 
> for SD Card, then diffed the projects and added the pieces into my first 
> project.  Now I have an SD card that is an FTP server with NTP-based 
> clock.  It was not easy... use every cheat you can find.  If you have to 
> add a USB stick or an SD card to get it going, do so.
> __
> Steve

That's what I started to do.  I used the same exact example to get my other
network protocols up and running, and the same example project to port over
the FatFs.  I'll check out the documentation again to see if there's
something missing.

To me right now it seems like if I want to use FatFs (which I don't), I need
to figure out what my problem is with memory; as in I run out of it and the
FTP server does not turn on.  I don't think it's a leak, rather it's LWIP or
FatFs taking up the majority.  That doesn't seem right to me.

If I want to use an FTP server without FatFs or the provided LWIP TFTP
server, either one is the goal, I have to figure out how to modify them. 
Modify them so that I FTP the image.bin over and then load it into flash
somehow.



--
View this message in context: 
http://lwip.100.n7.nabble.com/TFTP-init-tp28231p28436.html
Sent from the lwip-users mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]