Forum Discussion

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

How to configure EPCS with .sof and elf???

I am new to Altera. I made a NIOS II on Cyclone II eval board for a test fixture project.

The FPGA code and C code are both works, now I have to manage to boot them from the EPCS16.

Here is what I did:

1)Generate a .sof with setting the the configuration scheme to AS and configuration devise to EPCS16

2)Load the .sof with JTAG mode use Quartus II(9.1) programmer - the program is running.

3)Start the Eclipse, load the C code - it is running

4)Open the flash programmer, added both .sof and .elf to generate the flash file and load it

All of this are completed, but when I recycle the power-the chip is not booted neither the FPGA nor the C code (It should flash some LED for indication).

I searched on the web, somebody says, the NIOS CPU reset vector has to set to 'epcs controller' I think it make sense, so I went ahead changed it, no it can't go through the generation of flash.

What did I do wrong?????

8 Replies

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

    Your basic procedure sounds okay.

    Are the MSEL pins on the FGPA set correctly for AS configuration? What about other configuration related pins such as nConfig? Have you read the relevant details in the cyclone ii manual (http://www.altera.com/literature/hb/cyc2/cyc2_cii51013.pdf)?

    Are you 100% sure both the FGPA configuration and Nios code fail to load? You mention it should flash an LED, but do you expect the LED to flash independent of Nios booting properly? Things such as the reset vector and BSP settings would have no effect on whether the FGPA itself configures correctly but could effect Nios booting.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks for your response.

    I had the FPGA code and C code flash separate LED, so I know they both not boot.

    The MSEL0 and MSEL1 both 0 for boot from EPCS.

    I have a question, my C code is loaded in external RAM now (when I use JTAG), do I need a bootloader included in NIOS? if yes, how?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    I have a question, my C code is loaded in external RAM now (when I use JTAG), do I need a bootloader included in NIOS? if yes, how?

    --- Quote End ---

    Yes, you need a boot loader. Although, it sounds like you already have one. The EPCS controller in SOPC builder includes a small amount of block RAM which contains the boot loader. This is why you should set your reset vector to point to the EPCS controller.

    Although, as I mentioned before, none of this should have an impact on the FGPA configuration itself loading.

    Unfortunately, I don't have many other ideas for things to try. I have always had good luck with configuring from EPCS so I have not had to do a lot of troubleshooting myself. Perhaps monitoring some of the status signals or checking the communication to the EPCS on a scope would give some clues.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    By default, Quartus II generates COMPRESSED configuration file. You may try to change that to UN-COMPRESSED configuration file.