Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12435 Discussions

Altera rozipfs in SRAM partition

Altera_Forum
Honored Contributor II
1,009 Views

Hi, 

 

has anyone attempted and succeeded in using rozipfs with memory base and offset located in SRAM? 

 

In my case it doesn't work. 

I have done the following: 

- created partition in SRAM (last MB defined as distinct memory region) 

- copied the 2 zipfs sectors from flash into SRAM at boot time 

- configured BSP to use SRAM base and the known MB offset 

 

In my application afterwards I am using the same fopen(/mnt/zipfs/filename, 'r') call. 

 

Thankful for any hints..
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
95 Views

"The problem" is that the filesystem image needs to be present in the SRAM before the filesystem initializes itself. 

 

Possibly better ways to accomplish it, but I ended up invoking ALTERA_RO_ZIPFS_INIT() myself after the contents had been copied into SRAM. 

 

e.g. 

#include "altera_ro_zipfs.h" # include "system.h" ... ... main() { ... memcpy(); ALTERA_RO_ZIPFS_INIT( ALTERA_RO_ZIPFS, altera_ro_zipfs ); ... fh = fopen(); ... }
Altera_Forum
Honored Contributor II
95 Views

Actually I am copying the contents in the booloader, so before the application is even loaded...  

 

but since it worked in your case, the good news for me is there is no limitation to flash devices, so if I do everything right it should work... :-)
Altera_Forum
Honored Contributor II
95 Views

I got it working, my copy routine had a too small data type for the address counter and overflowed.  

Thanks!
Reply