Forum Discussion

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

nios ii flash programming error

Hi:

When I program *.elf to flash ,there something wrong with it.

The infomation like

# !/bin/sh# # This file was automatically generated by the Nios II IDE Flash Programmer.# # It will be overwritten when the flash programmer options change.#

cd E:/altera/80/workplace/RA8835/hello_world_1/Debug# Creating .flash file for the project

"$SOPC_KIT_NIOS2/bin/elf2flash" --base=0x00200000 --end=0x3fffff --reset=0x20000

0 --input="hello_world_1.elf" --output="cfi_flash.flash" --boot="E:/altera/80/ip

/nios2_ip/altera_nios2/boot_loader_cfi.srec"# Programming flash with the project

"$SOPC_KIT_NIOS2/bin/nios2-flash-programmer" --base=0x00200000 --sidp=0x000010b0

--id=148608136 --timestamp=1252545047 --instance=0 "cfi_flash.flash"

Using cable "USB-Blaster [USB-0]", device 1, instance 0x00

Resetting and pausing target processor: OK

Reading System ID at address 0x000010B0: verified

: Checksumming existing contents

00000000 : Reading existing contents

00004000 : Reading existing contents

Checksummed/read 7kB in 0.2s

00000000 ( 0%): Erasing

00004000 (66%): Erasing

Erased 24kB in 0.4s (60.0kB/s)

00000000 ( 0%): Programming

00004000 (66%): Programming

Programmed 18KB +6KB in 0.3s (80.0KB/s)

Verify failed at offset 0

Verify failed at offset 4000

Leaving target processor paused

//end

Who can help me resave it?Please!

Thanks

20 Replies

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

    I program sof to EPCS4 first ,and then program *.elf to flash by NIOS_IDE_flash_programmer.

    Something wrong with me?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    First ,in a new project,I build a sopc_builder system,and add CPU,tristate_bridge,cfi_flash,sram and some PIOs.

    In nios_processor setting ,reset vector set as cfi_flash, offset set as 0x0

    ,then run Auto_assign_Base_address and Auto_assign_IRQs in System_view,

    last I generate the nios_system.

    After generate OK and assign Pins OK! I compile quartus_project!

    Then open the nios_ide,build software_project,set system_library_propetities,

    compile system.When does this OK,I program quartus_project first and then program elf to flash by NIOS_TOOL_FLASH_PROGRAMMER.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Have you tried to run your program without using the flash?

    Just normally after programming hardware, launch Run as-> Nios II hardware.

    Does it work?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi! I have the same problem!!

    # !/bin/sh# # This file was automatically generated by the Nios II IDE Flash Programmer.# # It will be overwritten when the flash programmer options change.#

    cd G:/nios_ii_sw/led_blink_8bit/software/led_blink_8bit/Debug# Creating .flash file for the project

    "$SOPC_KIT_NIOS2/bin/elf2flash" --base=0x02400000 --end=0x27fffff --reset=0x2400

    000 --input="led_blink_8bit.elf" --output="cfi_flash.flash" --boot="D:/altera/90

    /ip/altera/nios2_ip/altera_nios2/boot_loader_cfi.srec"# Programming flash with the project

    "$SOPC_KIT_NIOS2/bin/nios2-flash-programmer" --base=0x02400000 --cable='USB-Blas

    ter [USB-0]' --sidp=0x02801010 --id=2017564571 --timestamp=1277911500 --instance

    =0 "cfi_flash.flash"

    Using cable "USB-Blaster [USB-0]", device 1, instance 0x00

    Resetting and pausing target processor: OK

    Reading System ID at address 0x02801010: verified

    : Checksumming existing contents

    00004000 : Verifying existing contents

    00006000 : Verifying existing contents

    00008000 : Verifying existing contents

    00000000 : Reading existing contents

    Checksummed/read 46kB in 4.9s

    00000000 ( 0%): Erasing

    Erased 16kB in 0.5s (32.0kB/s)

    00000000 ( 0%): Programming

    00004000 (25%): Programming

    00006000 (25%): Programming

    00008000 (25%): Programming

    Programmed 62KB in 0.9s (68.8KB/s)

    Verify failed at offset 4000

    Verify failed at offset 6000

    Verify failed at offset 8000

    Leaving target processor paused

    ////////////////////////////////////////

    Have you solved this problem?

    My flash is set the 8bit databus connect to FPGA(EP2C5),when 16bit databus is no this problem.

    further more this problem usually appear when I compile the code and first download the .elf; when I download the same .elf to the flash in the secondtime ,it works.

    This is very strange!!
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The secondtime download ,it works:

    # !/bin/sh# # This file was automatically generated by the Nios II IDE Flash Programmer.# # It will be overwritten when the flash programmer options change.#

    cd G:/nios_ii_sw/led_blink_8bit/software/led_blink_8bit/Debug# Creating .flash file for the project

    "$SOPC_KIT_NIOS2/bin/elf2flash" --base=0x02400000 --end=0x27fffff --reset=0x2400

    000 --input="led_blink_8bit.elf" --output="cfi_flash.flash" --boot="D:/altera/90

    /ip/altera/nios2_ip/altera_nios2/boot_loader_cfi.srec"# Programming flash with the project

    "$SOPC_KIT_NIOS2/bin/nios2-flash-programmer" --base=0x02400000 --cable='USB-Blas

    ter [USB-0]' --sidp=0x02801010 --id=2017564571 --timestamp=1277911500 --instance

    =0 "cfi_flash.flash"

    Using cable "USB-Blaster [USB-0]", device 1, instance 0x00

    Resetting and pausing target processor: OK

    Reading System ID at address 0x02801010: verified

    : Checksumming existing contents

    00000000 : Verifying existing contents

    Checksummed/read 16kB in 2.1s

    Erase not required

    00000000 ( 0%): Programming

    00004000 ( 0%): Programming

    00006000 (12%): Programming

    00008000 (25%): Programming

    Programmed 62KB in 2.5s (24.8KB/s)

    Device contents checksummed OK

    Leaving target processor paused
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    @shiy

    I also have the same problem ....Can you please me tell me how you solved the problem....