Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Use FTP with eCos

Altera_Forum
Honored Contributor II
1,646 Views

Hi all, 

 

for an assignment I need to create an FTP-server on the NIOS II Dev Kit from Altera. The basic webserver example works fine, but they want me to upload files into the flash memory and preferably into the ro_zipfs.zip-file. I don't know where to start. I read that eCos is usefull for a ftp-server. If I want to upload files from a browser e.g. Internet Explorer, what should I use best.... C/C++, CGI... I don't know could anyone help me out?! 

 

Cheers, 

 

Danny
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
360 Views

 

--- Quote Start ---  

originally posted by dannyjacobs@Oct 7 2005, 01:41 PM 

for an assignment i need to create an ftp-server on the nios ii dev kit from altera. 

the basic webserver example works fine, but they want me to upload files into the flash memory and preferably into the ro_zipfs.zip-file. i don't know where to start. 

--- Quote End ---  

 

I don't remember seeing an FTP server in eCos. And if "ro_zipfs.zip-file" you mean the included Nios2 HAL "Read-only ZIP File System"... it's called read-only for a reason; you're not going to be able to upload things to it without rebuilding the project and reprogramming it each time. You're going to need something like JFFS2 (which I think is included). 

 

My instinct tells me you might want to try ucLinux instead. I know it has FTP and JFFS2 support, and it will let you use the CFI card as a nonvolatile IDE drive, too. The downside is it's going to take more of your flash up wth OS. Also, ucLinux might be easier for you since it's actually supported by the IDE, unlike eCos where you're writing your own makefiles. 

 

 

--- Quote Start ---  

originally posted by dannyjacobs@Oct 7 2005, 01:41 PM 

i read that ecos is usefull for a ftp-server. if i want to upload files from a browser e.g. internet explorer, what should i use best.... c/c++, cgi... 

--- Quote End ---  

 

The simple web server in eCos does not support POST-method forms, just GET-method, so file upload via http is out. I've been using TFTP for file upload. 

 

Also, the simple eCos web server treats everything like a CGI; each web page is a callback function of the form: int MyWebPage(FILE* client, const char* url, const char* formdata, void* userdata), where you write the web page to the FILE* "client". 

 

eCos doesn't have a filesystem by default, and for most purposes (including TFTP and HTTP) doesn't need one, however, this might seem alien to you if you're just starting out.
0 Kudos
Altera_Forum
Honored Contributor II
360 Views

The choice of OS is always a tricky point and as Mike rightly points out uCLinux has more features, but has a much bigger footprint. 

 

 

--- Quote Start ---  

originally posted by mike desimone@Oct 10 2005, 09:57 AM 

i don't remember seeing an ftp server in ecos.  and if "ro_zipfs.zip-file" you mean the included nios2 hal "read-only zip file system"... it's called read-only for a reason; you're not going to be able to upload things to it without rebuilding the project and reprogramming it each time.  you're going to need something like jffs2 (which i think is included). 

 

my instinct tells me you might want to try uclinux instead.  i know it has ftp and jffs2 support, and it will let you use the cfi card as a nonvolatile ide drive, too.  the downside is it's going to take more of your flash up wth os.  also, uclinux might be easier for you since it's actually supported by the ide, unlike ecos where you're writing your own makefiles. 

--- Quote End ---  

 

 

eCos contains a TFTP Server which may meet your needs.  

As for filing systems eCos has support for JFFS2, FAT which can be used on the Compact Flash Card and two other simple filesystems.
0 Kudos
Altera_Forum
Honored Contributor II
360 Views

Thanks for your help. I am trying eCos now. All it needs to do is to upload and download. I am trying to find out if the connection is fast enough for what we want to do with it. But your replies really helped me out.

0 Kudos
Altera_Forum
Honored Contributor II
360 Views

 

--- Quote Start ---  

originally posted by mike desimone+oct 10 2005, 09:57 am--><div class='quotetop'>quote (mike desimone @ oct 10 2005, 09:57 am)</div> 

--- quote start ---  

<!--quotebegin-dannyjacobs@Oct 7 2005, 01:41 PM 

for an assignment i need to create an ftp-server on the nios ii dev kit from altera. 

the basic webserver example works fine, but they want me to upload files into the flash memory and preferably into the ro_zipfs.zip-file. i don&#39;t know where to start. 

--- Quote End ---  

 

I don&#39;t remember seeing an FTP server in eCos. And if "ro_zipfs.zip-file" you mean the included Nios2 HAL "Read-only ZIP File System"... it&#39;s called read-only for a reason; you&#39;re not going to be able to upload things to it without rebuilding the project and reprogramming it each time. You&#39;re going to need something like JFFS2 (which I think is included). 

 

My instinct tells me you might want to try ucLinux instead. I know it has FTP and JFFS2 support, and it will let you use the CFI card as a nonvolatile IDE drive, too. The downside is it&#39;s going to take more of your flash up wth OS. Also, ucLinux might be easier for you since it&#39;s actually supported by the IDE, unlike eCos where you&#39;re writing your own makefiles. 

 

 

--- Quote Start ---  

originally posted by dannyjacobs@Oct 7 2005, 01:41 PM 

i read that ecos is usefull for a ftp-server. if i want to upload files from a browser e.g. internet explorer, what should i use best.... c/c++, cgi... 

--- Quote End ---  

 

The simple web server in eCos does not support POST-method forms, just GET-method, so file upload via http is out. I&#39;ve been using TFTP for file upload. 

 

Also, the simple eCos web server treats everything like a CGI; each web page is a callback function of the form: int MyWebPage(FILE* client, const char* url, const char* formdata, void* userdata), where you write the web page to the FILE* "client". 

 

eCos doesn&#39;t have a filesystem by default, and for most purposes (including TFTP and HTTP) doesn&#39;t need one, however, this might seem alien to you if you&#39;re just starting out. 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=10265)</div> 

[/b] 

--- Quote End ---  

 

 

hi, im dannyjacobs&#39; coworker, i have a few questions stemming from your post 

 

does uClinux have a built in TCP/IP stack like micro/os which comes with the nios dev kit? the LWip stack we are using now has dismal performance, even with the cpu clocked at 125 mhz we can get a max of 9mbit, while stacks like the nichestack are supposed to be able of 60 mbits and up 

 

also, you said that the nios IDE supports uClinux, so we should be able to DL uClinux and keep working in the nios IDE from altera?
0 Kudos
Altera_Forum
Honored Contributor II
360 Views

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

hi, im dannyjacobs&#39; coworker, i have a few questions stemming from your post 

 

does uClinux have a built in TCP/IP stack like micro/os which comes with the nios dev kit? the LWip stack we are using now has dismal performance, even with the cpu clocked at 125 mhz we can get a max of 9mbit, while stacks like the nichestack are supposed to be able of 60 mbits and up 

 

also, you said that the nios IDE supports uClinux, so we should be able to DL uClinux and keep working in the nios IDE from altera? 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=10296) 

--- Quote End ---  

[/b] 

--- Quote End ---  

 

 

Yes uClinux contains a stack.  

 

Whilst the performance you&#39;re getting with lwip is not the same as the quoted interniche numbers, you&#39;re not comparing apples with apples. The interniche stack has hardware acceleration. The lwip stack does have some performance faults, it can use copies for example, but most of the bottleneck is the lan91c111 MAC fitted to the board.
0 Kudos
Altera_Forum
Honored Contributor II
360 Views

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

What is this "nichestack", and what OS (if any) does it run on?  I haven&#39;t done much shopping for TCP/IP stacks and such.[/b] 

--- Quote End ---  

 

 

See 

 

http://www.altera.com/end-markets/refdesig...el-network.html (http://www.altera.com/end-markets/refdesigns/sys-sol/computing/ref-accel-network.html)
0 Kudos
Reply