Forum Discussion

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

Configuring NIOS processor through AS interface

Hi all,

I have been searching all day on a solution to my problem, or to find out if I totally screwed up my first design.

I designed my own board with a Cyclone II processor and an EPCS4 configuration device. I have a 10-pin header on the board set up for Active Serial configuration and I have successfully downloaded my FPGA design which includes a NIOS processor.

My problem is that I have been unable to figure out how to run or download my NIOS program from the Nios II Eclipse IDE. I created a simple hello world application using my SOPC configuration file, and it successfully compiled into a .elf binary.

Do I have to have a JTAG interface to download a NIOS program? The flash programmer wants a JTAG interface and the Quartus programmer only allows me to program .pof files. Is there some way to combine the Nios .elf into my Quartus .pof and program through the AS interface?

15 Replies

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

    You can write a microprogram which :

    - verify that there is a "good" program in flash memory.

    - if not good program, execute instructions from UART which fills FLASH with a "good" program. And execute it.

    - if good program (with a flag, signature...), simply execute it.

    Good thread !
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks all for the help. I'm going to have to wait until next week to work on this some more but I'll be thinking about it in the meantime.

    The biggest problem with generating small code is that I need to be able to output to a HD44780 LCD controller. Everything else is for the most part basic IO reading.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Been working on this again all day today. I created a 16k onchip RAM and set the non-default initialization file to nios.hex. I set the Nios cpu reset location to this onchip ram.

    In the NIOS EDS I compiled a very simple program that uses IOWR_ALTERA_AVALON_PIO_DATA() to write to an output PIO that I also have set up in SOPC builder. After compiling the program I run the mem_init_install target to create nios.hex.

    Then I rebuild the project in Quartus and according to the Fitter RAM Summary the nios.hex file is being included.

    Then I program my Cyclone II in active serial mode using the Quartus Programmer.

    None of my PIO output pins will change value like they are supposed to from the NIOS program. Is there an extra step that I am not doing? I haven't been able to find any documentation on this method whatsoever except for a few vague forum posts that don't mention anything that I haven't already done.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Haven't updated this for a while and I'm not sure if anyone is still following..

    My NIOS is working perfect! I am able to read and write characters through a uart and process them as commands or display them on a LCD.

    My code compiles to a 4408 byte file, leaving 17kB still free. I am pretty confident I will be able to fit the rest of my design in the onchip memory.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hello,

    I am missing the step that brought your system into work finally? Can you please add a few statements? Was it only software error or did you also have a systematic or handling error?

    Regards, Günter