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++

Accessing Files from netowrk

Altera_Forum
Honored Contributor II
1,189 Views

Hi, 

I am working on a project in which I have to read files from the host PC and write files to the host PC. I want to ask if it is possible.  

I am working in a LAN which is running on linux. I tried something like this but it didnt work. Can anyone tell me if I am missing out something: 

I created a nios 2 project including the ethernet(LAN91c111 interface), connected the stratix development board to the LAN(which has DHCP enabled). I can obtain the IP also. I was extecting that since I have connected the board to my LAN it will be able to read the file "/home/sony/test.txt" but it is unable to do so. I am not very familiar with the "mount" fundamentals. Can anyone help me in this? 

 

Thanx, 

sony
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
458 Views

Hi, 

I tried the example "host_filesystem" given in the examples directosy and it worked perfectly fine as I wanted. 

Even though it worked fine I just wanted to ask isnt there any method by which we can directly access files on the LAN, instead of accessing them from the program directory( as it was in case of the host_filesystem example) 

eg, if I want to access a file named "/home/sony/test.txt" then is it possible by any method that we can open it like FILE *fp = fopen("/home/sony/test.txt", "r")? 

 

Thanx,  

sony
0 Kudos
Altera_Forum
Honored Contributor II
458 Views

You can also use u-boot to download files via TFTP or NFS. To upload you would have to 

add some code to TFTP. 

 

Regards, 

--Scott
0 Kudos
Reply