Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

Altera_ro_zipfs NIOSII for Eclipse

Hi!

I want to use "Read only zip file system" to fead files from Flash memory.

I activated "altera_ro_zipfs" from NIOSII BSP editor with next parameters:

ro_zipfs_base - base address of my Flash memory.

I have some problem to generate ZIP file to load it to Flash memory through Flash Programmer .

I can't find a clear explanation how to create ZIP files in Altera's manual:

"12. Read-Only Zip File System".

I have NIOSII 9.1 for Eclipse.

May somebody help me?

I visited Altera Forum but they use procedures for old NIOSIIs.

Thanks in advance!

7 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    To finish this question.

    Create your hardware project with flash memory using SOPC builder.

    Create NIOSII project for this .sopcinfo hardware project.

    To use "Read only zip file system" to read files from Flash memory.

    I activated "altera_ro_zipfs" from NIOSII BSP editor with next parameters:

    ro_zipfs_base - base address of my Flash memory.

    Then:

    "BSP" --> Build project..

    Then :

    "Flash Programmer" --> New --> your BSP project -->

    ADD all your no compressed files to use (change offset for each file) -->

    Start (programming) --> check "checksum"

    Then:

    "BSP" --> Build Project --> see "flash" folder in BSP directory with your files (.flash)

    Then:

    -- Create ZIP folder with your "no" compressed files.

    -- Copy this ZIP folder to application directory of your project.

    Then:

    -- "Flash Programmer" --> New --> your project BSP -->

    Add the ZIP folder with according offset(you did it in

    Altera_ro_zipfs ) --> Start (programming) --> check "checksum".

    Be carefull !

    The manual "12. read-only zip file system" was written not clearly!

    It doesn't include a lot of new changes.

    The sample on the Altera side is more complicated and doesn't give a freedom to do for each board with flash memory.

    Enjoy!

    Thanks for the help!!!
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Michael,

    Is the base address of the Flash Memory in your project other than 0x0?

    >> "The sample on the Altera side is more complicated and doesn't give a freedom to do for each board with flash memory."

    I am using the sample WebServer Template from NIOS and want to use it with 'NIOS Embedded Evaluation Kit Cyclone-III' (The original example from Altera needs a License for SD-card interface :( ). People in Altera MySupport told me that I can't use RO_ZIPFS with flash memory having a base address other than 0x0. Is it true? Are you using some other base address and are able to access the RO_ZIPFS without any problem?

    Thanks for the help!
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Mahendran_c,

    for me it was just the opposite. I couldn't use a base address of 0x0 for the flash. Actually my flash's address is 0x28000000 and the offset for the rozipfs is 0x50000 so it is copied right after my program code and doesn't owerwrite each other. Be sure to change the offset under the system library settings as well as on flashing window.

    The size of my Flash is 8 MB and I use Nios 9.1 SP2 with the Webserver example from Interniche.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Urmel,

    thanks for the answer. I changed offset under the system library settings and also the flashing window. It seems to work fine now. Thanks again.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Mahendran_c,

    you are welcome.

    I'm glad I could help you.

    It took me some time to figure it out. Either the programm code works or the filesystem. But not both together. Interniche should have updated their obviously outdated information on the Webserver Example.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    To finish this question.

    Create your hardware project with flash memory using SOPC builder.

    Create NIOSII project for this .sopcinfo hardware project.

    To use "Read only zip file system" to read files from Flash memory.

    I activated "altera_ro_zipfs" from NIOSII BSP editor with next parameters:

    ro_zipfs_base - base address of my Flash memory.

    Then:

    "BSP" --> Build project..

    Then :

    "Flash Programmer" --> New --> your BSP project -->

    ADD all your no compressed files to use (change offset for each file) -->

    Start (programming) --> check "checksum"

    Then:

    "BSP" --> Build Project --> see "flash" folder in BSP directory with your files (.flash)

    Then:

    -- Create ZIP folder with your "no" compressed files.

    -- Copy this ZIP folder to application directory of your project.

    Then:

    -- "Flash Programmer" --> New --> your project BSP -->

    Add the ZIP folder with according offset(you did it in

    Altera_ro_zipfs ) --> Start (programming) --> check "checksum".

    Be carefull !

    The manual "12. read-only zip file system" was written not clearly!

    It doesn't include a lot of new changes.

    The sample on the Altera side is more complicated and doesn't give a freedom to do for each board with flash memory.

    Enjoy!

    Thanks for the help!!!

    --- Quote End ---

    Hi Michael72:

    I am using the Cyclone 3 board for performing some image processing tasks. I have my image files in a non-compressed zip folder called imagefiles.zip. I followed these steps trying to flash the image files onto my on-board flash:

    1. I modified the BSP settings using the BSP editor to turn on the altera_ro_zipfs at base address 0x1000 0000 and offset 0x100000.

    2. I then Generate BSP

    3. Build the BSP Project

    4. Build the original project.

    5. Then I use the flash programmer, and setup a New flash file by selecting the BSP settings file for my project.

    6. Flash the imagefiles.zip

    7. Run As NiOS-II program - the original software code. In the code I am accessing the mount point as /mnt/rozipfs/image1.bmp (for example). And I use fopen to open the file. But it fails.

    I am using Eclipse (NiOS-II v12.0). I still do not see any update in the documentation with regards to setting up the mount point on altera_ro_zipfs.

    In your steps above I see that you are using the flash programmer twice - for the files separately and for the zip folder. Why do you do this?

    Any help is appreciated!

    Best regards,

    Nirmala
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Hi Mahendran_c,

    for me it was just the opposite. I couldn't use a base address of 0x0 for the flash. Actually my flash's address is 0x28000000 and the offset for the rozipfs is 0x50000 so it is copied right after my program code and doesn't owerwrite each other. Be sure to change the offset under the system library settings as well as on flashing window.

    The size of my Flash is 8 MB and I use Nios 9.1 SP2 with the Webserver example from Interniche.

    --- Quote End ---

    Hi - how do we setup the base address and the offset correctly? I have a 64 MB flash. Is the offset where the program code ends or the base address?

    Cheers,

    Nirmala