Showing results for 
Search instead for 
Did you mean: 
Honored Contributor I

Read-Only Zip File System zipfs on nios ii



I'm using Quartus II 12.1 to develop software for nios II processor 

I fallowed this wiki page ( to enable the zipfs on nios II but i can't access the zip files using nios ii and my pointer always return NULL 

I'm using EPCS as my flash memoy to store the zip file, i double check the base address and the offset and also program the epcs for several times (I was successfull in programming the EPCS) 

I don't know that may cause this problem 

below is the sample code that i used to access the zip file 


--- Quote Start ---  

FILE* fp = NULL; 



* Open and print contents of ZipFS file 1. 


printf("Reading file 'file1.txt' from ZipFS...\n"); 



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

if (fp == NULL) 

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

exit (1); 

--- Quote End ---  



Please give me some suggestion
0 Kudos
3 Replies
Honored Contributor I

IIRC the zipfs requires the data to be directly mapped in the CPU's address space, so you can only use it with a parallel flash. I think that if you search on this forum you'll find a thread about someone that tried to port it to use the EPCS controller's read and write functions, but I don't remember whether it worked correctly or not.

Honored Contributor I

Thank you so much, zipfs now work on parallel flash 

I have another question, can i access the zipfs in the nios run mode or it's only accessible in debug mode? 

In the debug mode i can print the content of my text file (which is in the zipfs) on the screen but in the run mode nothing is printed on the screen
Honored Contributor I

The rozipfs can be used in both debug and run modes. I suggest that you write more debug information from your code to see what is wrong (especially if any error is returned when you are trying to open the file). 

There is another filesystem module available on Nios that is called the host filesystem. This modules allows the application running on the Nios to directly read/write files on the host PC. This module only works in debug mode.