Forum Discussion

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

Downloading ELF Process failed in Quartus II 10.1sp1

hi

I build one simple nios project in quartus II 10.1sp1 software, compile my software is ok, i have downloaded the sof file into FPGA via jtag. when i prepare to download the ELF file via nios II IDE run --> debug as --> NIOS II hardware, i meet error always. could somebody help me? thanks a lot.

the error log as follows:

Downloading ELF Process failed

eclipse.buildId=M20090917-0800

java.version=1.6.0_14

java.vendor=Sun Microsystems Inc.

BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=zh_CN

Framework arguments: -product org.eclipse.epp.package.cpp.product -perspective com.altera.sbtgui.ui.cPerspective

Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.cpp.product -perspective com.altera.sbtgui.ui.cPerspective

Error

Sat Jun 04 11:35:47 CST 2011

Failed Executing: [nios2-download, '--cable=USB-Blaster on localhost [USB-0]', --device=1, --instance=0, --sidp=0xa018, --id=0x1, --timestamp=1307150667, /cygdrive/e/study/debug_nios/software/debug/debug.elf] return code: 4, 'other error'

4 Replies

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

    HI also have this problem, can anyone help or did you find a solution?

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

    Which board are you using and what's the cpu frequency? Can you get the system ID from the board using nios II?

    Maybe the frequency is too high, or sdram/sram is not configured properly.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    If you are using external EPCS Flash, try creating a batch file using notepad with the lines between the start and end comments. Do not include the start and end comments. Then using notepad create a Run_Nios_bashrc file with no extension using the lines between the start and end comments. Do not include the start and end comments.

    Put all files in a temporary folder:

    YOUR_BATCH_FILE.BAT

    YOUR_ELF_FILENAME.ELF,

    YOUR_SOF_FILENAME.SOF,

    YOUR_FLASH_FILENAME.FLASH

    file epcs_flash_controller_0.flash

    Run_Nios_bashrc

    You may have to change the base address in the Run_Nios_bashrc per your app

    You probably will also have to create the system variable:

    Step1: Go to Control Panel

    Step2: Go to System

    Step3: Go to the Advanced System Properties

    Step4: Go to the Advanced Tab

    Step5: Go to Environment Variables

    Step6: Press the "New" button

    Step7: Enter the Variable Name and Value below:

    Variable Name: SOPC_KIT_NIOS2

    Variable Value: C:\Altera\10.1sp1\nios2eds (your path may be different)

    Lastly, Double click the batch file.

    ******************batch file start*****************

    @echo off

    @ set SOPC_BUILDER_PATH=%SOPC_KIT_NIOS2%+%SOPC_BUILDER_PATH%

    @ %QUARTUS_ROOTDIR%\bin\quartus_pgm -m jtag -c USB-Blaster[USB-0] -o "p;YOUR_SOF_FILENAME.sof"

    pause

    @ %QUARTUS_ROOTDIR%\bin\cygwin\bin\bash.exe --rcfile Run_Nios_bashrc

    pause

    @echo on

    ******************batch file end*****************

    ******************Run_Nios_bashrc file start*******

    . $QUARTUS_ROOTDIR/sopc_builder/bin/nios_bash

    alias nb=nios2-build

    alias nios-build=nios2-build

    alias nr=nios2-run

    alias nios-run=nios2-run

    alias nd=nios2-debug

    alias nios-debug=nios2-debug

    alias nc=nios2-console

    alias nios-console=nios2-console

    nios2-flash-programmer --epcs --base=0x00609800 -c USB-Blaster [USB-0] --instance=0 YOUR_FLASH_FILENAME.flash

    nios2-flash-programmer --epcs --base=0x00609800 -c USB-Blaster [USB-0] --instance=0 epcs_flash_controller_0.flash

    # nios2-download YOUR_ELF_FILENAME.elf -c USB-Blaster[USB-0] -g -r

    nios2-terminal -c USB-Blaster[USB-0]

    exit

    ******************Run_Nios_bashrc file end*******
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    If you just want to download the ELF to the FPGA, try creating a batch file using notepad with the lines between the start and end comments. Do not include the start and end comments. Then using notepad create a elf_downloader file with no extension using the lines between the start and end comments. Do not include the start and end comments.

    Put all files in a temporary folder:

    YOUR_BATCH_FILE.BAT

    YOUR_ELF_FILENAME.ELF,

    YOUR_SOF_FILENAME.SOF,

    elf_downloader

    You probably will also have to create the system variable:

    Step1: Go to Control Panel

    Step2: Go to System

    Step3: Go to the Advanced System Properties

    Step4: Go to the Advanced Tab

    Step5: Go to Environment Variables

    Step6: Press the "New" button

    Step7: Enter the Variable Name and Value below:

    Variable Name: SOPC_KIT_NIOS2

    Variable Value: C:\Altera\10.1sp1\nios2eds (your path may be different)

    Lastly, Double click the batch file.

    ******************batch file start*****************

    @echo off

    @ set SOPC_BUILDER_PATH=%SOPC_KIT_NIOS2%+%SOPC_BUILDER_PATH%

    @ %QUARTUS_ROOTDIR%\bin\quartus_pgm -m jtag -c USB-Blaster[USB-0] -o "p;YOUR_SOF_FILENAME.sof"

    pause

    @ %QUARTUS_ROOTDIR%\bin\cygwin\bin\bash.exe --rcfile elf_downloader

    pause

    @echo on

    ******************batch file end*****************

    ******************elf_downloader file start*******

    . $QUARTUS_ROOTDIR/sopc_builder/bin/nios_bash

    alias nb=nios2-build

    alias nios-build=nios2-build

    alias nr=nios2-run

    alias nios-run=nios2-run

    alias nd=nios2-debug

    alias nios-debug=nios2-debug

    alias nc=nios2-console

    alias nios-console=nios2-console

    nios2-download -c USB-Blaster [USB-0] YOUR_ELF_FILENAME.elf -g

    nios2-terminal -c USB-Blaster [USB-0]

    exit

    ******************elf_downloader file end*******