Forum Discussion

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

using extra space in serial rom

Hello, I would like some suggestions on whether the following is possible:

I have a custom board with an EPC28 Cyclone II FPGA and a EPCS4 config rom. There is a single 10-pin connector to the config rom set up to do AS programming. The JTAG input pins of the Cyclone are hardwired to ground on the board, and the JTAG out is left floating, so it is not easy to wire up another socket to enable JTAG transfers. I would rather not do a re-design of the board.

My question is whether there is a way to use an EPCS16 (16MB rom) instead of the EPCS4 (4MB) and use the extra 12MB to store data that the FPGA can access in normal operation?

I can see how to get the FPGA to read the rom, but I don't see a way (with Quartus) to write the data (e.g. as part of the .pof file) to the rom. I guess I could download a config for a circuit that would load the data somehow, but then wouldn't the data be overwritten (since the config rom needs to be erased before writing the config) when I downloaded the config for the main circuit? Or is there a way to limit what gets erased during the config process?

Also, - this is an FAQ but I haven't tried it - can I replace the EPCS4 with a Numonyx M25P16 and program it using Quartus as I would an EPCS4 (or EPCS16)? They are a lot cheaper...

Thanks!

6 Replies

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

    Are you using a Nios2 CPU? In that case you can use the nios tools to add a binary file to the flash and can use the SOPC EPCS controller to access it.

    If you don't use any CPU there must be a way of telling Quartus to flash specific data to a part of the flash but I don't know how. Never looked for that...
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    If you know, how to read the serial flash, you should be also able to write it from the FPGA.

    If you generate the programming files data through the quartus convert programming files tool, you can add hex data at absolute addresses. I didn't yet use the feature, but it should be capable of e.g. initializing user data to your flash. The Quartus Programmer doesn't provide an option for partial erase up to now. It has been discussed at the forum to set a sector protection from the user FPGA controller. It has been observed, that neither protection status is checked nor erase verified by the programmer.

    Regarding the compatibility question, I noticed, that an Altera EPCS4 identified itself as Numonyx M25P04 by manufacturer and device code.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks for the suggestions. I will try the Quartus Convert Programming Files tool.

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

    You can try to use the ASMI (altasmi_parallel) megafunction instantiation to access the general purpose memory portion of the serial configuration device, EPCS through Cyclone III device. You can store the configuration data in .rpd format into the EPCS. The altasmi_parallel megafunction provides access to the memory of an EPCS device through parallel data input and output ports. The .rpd file is a binary file for EPCS devices containing a binary bitstream of configuration data for FPGAs that support Active Serial configuration.

    You cannot write/store the other data starting address 0 because by default it is the memory location for storing configuration data. You need to make sure the data you intend to store does not overlap with the configuration data. Check the end address for configuration data in the map file, then you can store data into other memory location.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I used the convert programming files tool to add the data files (in .hex format) to the .pof file and then I used the asmi_parallel block to read the data in user mode. Works just fine.

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

    Hi,

    I notice that there is a way to store additional data in "general purpose memory" section of EPCS device, from the FPGA, with ALT_ASMI megafunction.

    I looked at http://www.altera.com/literature/ug/ug_altasmi_parallel.pdf but on which address does "general purpose memory" section begin (or on which address does "configuration" section end) ?

    Does FPGA need to read at a particular address to find out the end address of "configuration" section in EPCS ?

    Have anyone made such thing ?

    My goal is to store for example min and max values of an analog input and to extract them by examining the EPCS.

    All ideas are welcome, thanks.