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

Nios II ISS

Altera_Forum
Honored Contributor II
2,268 Views

Hi everybody, 

 

Am trying to prototype how I can effectively use the niosII read-only zip filing system.  

 

Am currently using the example that came with the development board and I have followed the instructions on how to create and run the zip file in the IDE. Am currently trying to verify whether the zip file could be read by running the software as an ISS.  

 

When I tried to run the software as an ISS, I get the error "file could not be opened". Does anybody know what I can do so that the file could be read?. 

 

Cheers, 

 

joo21
0 Kudos
22 Replies
Altera_Forum
Honored Contributor II
704 Views

This is a flash based filing system, there is no model for the flash on the ISS. I sugest you try this on a board.

0 Kudos
Altera_Forum
Honored Contributor II
704 Views

Thank you, I will try it right away. Please, do you know what the "Mount-Point" means?. Is the mount-point the installation directory?. 

 

Cheers, 

 

joo21
0 Kudos
Altera_Forum
Honored Contributor II
704 Views

The mount point is how the file appears from the viewpoint of the CPU e.g. /mnt/rozipfs/. It's a general term, dropping it into google 

brings up this, which shoudl help www.comptechdoc.org/os/linux/manual1/mountpoints.html
0 Kudos
Altera_Forum
Honored Contributor II
704 Views

Thanks, I tried running the software as a nios II harwdare with the development board and am still having the same problem "Cannot open file". 

 

From the url link you posted about mount point, it seems that the mount point is the directory where the files will be exported!. 

 

Do you know what else I can do?. 

 

Cheers, 

 

joo21
0 Kudos
Altera_Forum
Honored Contributor II
704 Views

I forget to mention that am using a PC running windows OS. It seems that this mount-point has something to do with linux OS!!! 

 

Cheers, 

 

joo21
0 Kudos
Altera_Forum
Honored Contributor II
704 Views

The mount point is a UNIX paradigm, which is being used for the target software i.e. the code running on the Nios, it's nothing to do with your PC. I suggest you read chapter 12 of the Nios II Software Developers Handbook. 

 

The mountpoint of for example /mnt/rozipfs, means that when you use fopen (on the Nios), the file will be opened as /mnt/rozipfs/my_file
0 Kudos
Altera_Forum
Honored Contributor II
704 Views

fp=fopen ("/mnt/rozipfs/file1.txt", "r"); 

You said your system is Widows OS. 

So you have to modify the path like below: 

fp=fopen ("c:\\myfile\\file1.txt", "r"); 

You can try it. 

GL!
0 Kudos
Altera_Forum
Honored Contributor II
704 Views

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

--- Quote Start ---  

fp=fopen ("/mnt/rozipfs/file1.txt", "r"); 

You said your system is Widows OS. 

So you have to modify the path like below: 

fp=fopen ("c:\\myfile\\file1.txt", "r"); 

You can try it. 

GL![/b] 

--- Quote End ---  

 

 

No you don&#39;t! The problem joo21 was having was not on a PC, where your change would work. It&#39;s on the target i.e. Nios where a UNIX model is used
0 Kudos
Altera_Forum
Honored Contributor II
704 Views

Hi GL, 

 

Thanks for the info. I did as you said but I still get the error "Cannot open file". Does any body knows any way out?. 

 

Since am running the Nios II IDE on windows OS, I think the mount point specified in the IDE project system library should reflect this OS. Obviously, somebody must have implemented this zip filing system on a machine running windows OS instead of linux/unix. 

 

Please, I need help. 

 

Cheers, 

 

joo21
0 Kudos
Altera_Forum
Honored Contributor II
704 Views

Have you programmed the flash with your ZIP file contents? If you haven&#39;t or you don&#39;t know what I&#39;m talking about, then that&#39;s a good place to start. 

 

- slacker
0 Kudos
Altera_Forum
Honored Contributor II
704 Views

Hi Slacker, I tried programing the zip file into flash before running it as a nios II hardware. After programming into flash, when I tried to run it, the IDE appears to hangs and I get the following: 

 

nios2-terminal: connected to hardware target using JTAG UART on cable 

nios2-terminal: "USB-Blaster [USB-0]", device 1, instance 0 

nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate) 

 

Reading file &#39;file1.txt&#39; from ZipFS... 

 

It just gets stuck here, until I terminates it. It does&#39;nt read the content of "file1.txt". What do you think is the problem?. 

 

Kind regards, 

 

joo21
0 Kudos
Altera_Forum
Honored Contributor II
704 Views

joo21, 

 

You really need to be more specific. It just gets stuck here is not a lot to go on. 

 

Can you tell us exactly where in the code it get&#39;s stuck i.e. function name and where in the function it gets stuck
0 Kudos
Altera_Forum
Honored Contributor II
704 Views

Thanks for the info. Here is a copy of part of the zip file example code: 

 

 

int main(void) 

FILE* fp = NULL; 

 

/* 

* Open and print contents of ZipFS file 1. 

*/ 

printf("Reading file &#39;file1.txt&#39; from ZipFS...\n"); 

 

fp = fopen("/mnt/rozipfs/file1.txt", "r"); 

 

if (fp == NULL) 

printf ("Cannot open file.\n"); 

exit (1); 

 

print_file_contents(fp); 

 

fclose (fp); 

 

return 0; 

 

It got stucked at the " printf("Reading file &#39;file1.txt&#39; from ZipFS...\n");" function and it does&#39;nt advances beyound this point. 

 

Cheers, 

joo21
0 Kudos
Altera_Forum
Honored Contributor II
704 Views

joo21, 

 

Use your debugger and pause the processor, now which function are you stuck in?
0 Kudos
Altera_Forum
Honored Contributor II
704 Views

Hmmm, am having problems with the debugger. I just checked properly now, and I think the problem am having is because am using "open-core evaluation license for the nios II processor". We do not have a full license!. 

 

Do you think this is the problem?. 

 

Cheers, 

 

Jude
0 Kudos
Altera_Forum
Honored Contributor II
704 Views

Hi, am having problem with the debugger now. I just checked properly now, and I think the problem am having is to do with my license. We are currently using "open-core evaluation license". We don&#39;t have the full license at the moment. 

 

Do you think this is the cause of the problem?. 

 

Cheers, 

 

joo21
0 Kudos
Altera_Forum
Honored Contributor II
704 Views

Has anyone ran the zip file system on a PC running on windows OS?. 

 

Please reply ASAP.  

 

Cheers, 

 

joo21
0 Kudos
Altera_Forum
Honored Contributor II
704 Views

Yes it&#39;s actually the platform it was developped on, though the example is platform independant.

0 Kudos
Altera_Forum
Honored Contributor II
704 Views

Thanks. I have being having problems running the zip file system example on my system. The content of the zip file could&#39;nt be open. I have followed all the procedure in the manual on how to use the altera zip file system. What do you think I should do?. Could you please let me know how you ran it on your system?. How did you specified your mount point?. Did you use absoluite paths?. 

 

Please reply ASAP. 

 

Cheers, 

 

joo21
0 Kudos
Altera_Forum
Honored Contributor II
637 Views

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

--- Quote Start ---  

rugbybloke, 

 

joo21 has sent you this email from http://www.niosforum.com/forum/index.php (http://www.niosforum.com/forum/index.php). 

 

 

Thanks rubbybloke. I have being having problems running the zip file system example on my system. The content of the zip file could&#39;nt be open. I have followed all the procedure in the manual on how to use the altera zip file system. What do you think I should do?. Could you please let me know how you ran it on your system?. How did you specified your mount point?. Did you use absoluite paths?. 

 

Please reply ASAP. 

 

Cheers, 

 

joo21[/b] 

--- Quote End ---  

 

 

joo21, 

 

As I have explained before in a private message, I will not enter into a private discussion with you about your problem. The benefit of forums is that if you post a question and someone else solves it then other people get to benefit from the solution, plus many people can see the question and hopefully answer it. 

 

You seem to be getting all confused about completely unrelated things, such as the operating system of your PC and mount points. 

 

To get a simple file system example follow the instructions below, which I have just tried with Release 5.0 on a 1c20 board. 

 

1. In the Nios II IDE select File->New Project 

2. Select C/C++ Application 

3. Select Zip Filing System 

4. Select a PTF for your system, in my case this was "D:\altera\kits\nios2\examples\verilog\niosII_cyclone_1c20\standard\std_1c20.ptf

5. Press Finish 

6. Right click on your project and select Build 

7. Select Tools->Flash Programmer 

8. Press New 

9. Press the Program Flash Button 

10. Press Yes 

11. Right click on your application project and select Debug As Hardware 

12. Depending upon whether you have the correct hardware you may get a Quartus Programming window to program the hardware into the board 

13. Press the Go Arrow and you&#39;ll get 

 

 

Reading file &#39;file1.txt&#39; from ZipFS... 

Hello from ZipFS File 1! 

 

Reading file &#39;file2.txt&#39; from ZipFS... 

Hello from ZipFS File 2!
0 Kudos
Reply