Forum Discussion

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

flash programmer

Hi,

I’m a student. I’m building a system with Quartus II 8.0,containing of two Nios II processors, which share the same CFI Flash.

In SOPC Building, set the reset vector and exception as follows:

Cpu1 reset vector -> cfi-flash offset -> 0x00

Cpu1 exception vector -> sdram offset -> 0x20

Cpu2 reset vector -> cfi-flash offset -> 0x200000

Cpu2 exception vector -> sdram offset -> 0x200020

The system can run successfully in Nios II 8.0 ide following the steps:

Run à Nios II multiprocessor collectior.

After that, I want to download the .sof and .ptf into CFI flash with the tools of Flash programmer, but can’t success.

show me:

# Programming flash with the FPGA configuration

"$SOPC_KIT_NIOS2/bin/nios2-flash-programmer" --epcs --base=0x01801800 "example.flash"

There are two or more Nios II processors available which match the values

specified. Please use the configuration dialog to pick one, or specify the--device and/or --instance parameters on the command line.

# Creating .flash file for the project

"$SOPC_KIT_NIOS2/bin/elf2flash" --base=0x01400000 --end=0x17fffff --reset=0x1400000 --input="cpu3.elf" --output="cfi_flash.flash" --boot="C:/altera/80/ip/nios2_ip/altera_nios2/boot_loader_cfi.srec"

# Programming flash with the project

"$SOPC_KIT_NIOS2/bin/nios2-flash-programmer" --base=0x01400000 "cfi_flash.flash"

There are two or more Nios II processors available which match the values

specified. Please use the configuration dialog to pick one, or specify the--device and/or --instance parameters on the command line.

After that, I read the documents “Nios II flash programmer user guide”and“Creating Multiprocessor Nios II Systems tutorial” finding that:

“If you choose to allow multiple Nios II processors to boot from the same CFI flash memory device, to ensure safe access to the CFI flash memory, you must remove the CFI flash memory driver initialization from the alt_main() function for all but one processor”

could you tell me how to modify the alt_main() function in multiprocessros’ system, or could you send me an example just like that?

1 Reply

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

    Actually, the portion you read has nothing to do with nios2-flash-programmer, but rather the code that will be running from each processor.

    Here's the key statement from your flash programmer dialog, that you missed:

    --- Quote Start ---

    Please use the configuration dialog to pick one, or specify the--device and/or --instance parameters on the command line.

    --- Quote End ---

    There should be someplace in the GUI that allows you to select a processor for flash programming. Alternately, you can modify the generated flash programming shell script (generated in the Debug/Release subdirectory of your project) to include an "--instance" option on the command line that calls "nios2-flash-programmer" and then run everything from a Nios II Command Shell rather than the provided GUI.

    Cheers, and Good luck!

    --slacker