Forum Discussion

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

EPCS update by NIOS

Dear all,

I have a question about how to update the EPCS content by the NIOS :

- updating the FPGA configuration data is no problem. I can generate a ".rpd" file

and store this file into the EPCS flash. When I do this, I can indeed update the FPGA config data.

- The ".rpd" file also contains 4 bytes telling us the length of the FPGA config. data. So, we know exactly where to store our NIOS config data (immediatly after the FPGA data)

- The problem now is that I don't know how to make the binary file of the NIOS configuration data. I now use the command: nios2-elf-objcopy -O binary input_file.elf output_file.bin which gives me a binary file. This is the file I also used in the past for parallel flash devices.

But, I think that this file isn't arranged for storing it into an EPCS flash. For the FPGA config data we have a "raw binary data" file (.rpd) which is different from the .rbf file. (for parallel flash devices)

So, my question is if anybody know how to create a NIOS binary file for the EPCS flash? Not an S-record file.

Kind regards

Karel

3 Replies

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

    The issue you're going to run into, regardless of how you do this is that you'll always have to program the SOF and the software at one time. This is because the software follows directly after the hardware.....not on a sector boundary.

    In any case, you should be able to use the following steps:

    1. sof2flash your SOF file.

    2. elf2flash your ELF file.

    3. Use the nios2-flash-programmer to program the two files, hardware then software.

    Alternately, you could use the Quartus Programmer, but I don't exactly remember the flow. Something like this:

    1. Add your SOF to your JIC file.

    2. Convert your software to hex. (I think objcopy will do.)

    3. Store the hex file at the correct offset.

    - This will be the tricky part. You've got to place it right after the hardware image.

    Best of luck,

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

    --- Quote Start ---

    originally posted by slacker@Mar 29 2007, 10:33 AM

    the issue you're going to run into, regardless of how you do this is that you'll always have to program the sof and the software at one time. this is because the software follows directly after the hardware.....not on a sector boundary.

    this is no problem. we can update the fpga and the nios always together.

    in any case, you should be able to use the following steps:

    1. sof2flash your sof file.

    2. elf2flash your elf file.

    3. use the nios2-flash-programmer to program the two files, hardware then software.

    this works fine. but i would like to do the update by means of rs232 ... not by a byteblaster !!!

    alternately, you could use the quartus programmer, but i don't exactly remember the flow. something like this:

    1. add your sof to your jic file.

    2. convert your software to hex. (i think objcopy will do.)

    3. store the hex file at the correct offset.

    - this will be the tricky part. you've got to place it right after the hardware image.

    best of luck,

    - slacker

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=22618)

    --- quote end ---

    --- Quote End ---

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

    Hey Slacker,

    You said the following:

    The issue you&#39;re going to run into, regardless of how you do this is that you&#39;ll always have to program the SOF and the software at one time. This is because the software follows directly after the hardware.....not on a sector boundary.

    I was wondering that this is realy necessary when you change the bootloader.c file? New the bootlader calculates the position of the NIOS data (searching for 0x56 en then the calcalating the FPGA data length). Can we change the bootloader that way that he doesn&#39;t calculate this position but always starts from a fixed sector boundary ...

    During EPCS programming we doen&#39;t use "sof2flash --after=FPGA.flash --EPCS --nios.elf --nios.flash " but for example "sof2flash --base = 0xAAAAAA ....."

    So, I would like to keep the NIOS software data at a fixed address in the EPCS flash.

    Kind regards

    Karel