Forum Discussion

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

Flash programmer fails on custom board design

Hi

I have a custom board design. My problem is that the flashprogrammer fails when trying to download to the flash, it fails with this message(Send (64) failed. Unable to synchronize with target.). If I run the memtest program(via RAM) on the flash it passes all the tests. Anyone who has any ideas on this?

The flash is working in BYTE mode(4MByte).

Best Regards

Michael E

8 Replies

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

    Do you have a full NiosII license?

    Some time ago I experienced the same problem with the time limited version because the opencore thing locks the programmer. I had the choice between writing a programmer myself, or bying the full license.

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

    Hi and thx for your answer

    Yes I have the full license. Have tryed beginning from the start once again. But it still has this error.

    The memtest program can just fine write/read to the flash(can see it has reset the 0x2000 adr). So the .sof file must be ok.

    The flash programmer also begins just fine and it looks like the USB blaster is loading the code(it's LED lights up). Then at the end it says it can syncronice with target.

    Is it because I need the startup code in the CPLD that will load the .sof image into the SRAM of the cyclone??? The cyclone cannot boot up on it's own right???

    Sorry but I am quit new at this HW design. Usually I just write SW http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/ohmy.gif )

    Best regards

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

    Hi

    An update. This is what the flash programmer says when I run it in terminal mode.

    Looks like nada is getting written.

    Tryed measuring the /CS on the Flash. I see a couple of /CS on my scope right at the beginning, but then nothing happens(waiting for timeout an err from the flash programmer)

    Any ideas anyone???

    $ nios2-flash-programmer --base=0x0 --input=MX_ATA_REV2.flash --s
    of=MX_ATA_REV2.sof --verbose --debug
    May 30, 2005 2:13:37 PM - (FINE) nios2-flash-programmer: nios2-flash-programmer
    starting
    May 30, 2005 2:13:37 PM - (INFO) nios2-flash-programmer: args = --base=0x0 --inp
    ut=MX_ATA_REV2.flash --sof=MX_ATA_REV2.sof --verbose --debug
    May 30, 2005 2:13:37 PM - (INFO) nios2-flash-programmer: Attempting to read inpu
    t-data from MX_ATA_REV2.flash
    May 30, 2005 2:13:38 PM - (INFO) nios2-flash-programmer: Launching Quartus Progr
    ammer to download:
         MX_ATA_REV2.sof
    May 30, 2005 2:13:39 PM - (FINE) nios2-flash-programmer: Quartus Pgm launched
    Info: *******************************************************************
    Info: Running Quartus II Programmer
    Info: Command: quartus_pgm --no_banner --mode=jtag --operation=p;MX_ATA_REV2.sof
    Info: Using programming cable "USB-Blaster "
    Info: Started Programmer operation at Mon May 30 14:13:42 2005
    Info: Configuring device index 1
    Info: Device 1 contains JTAG ID code 0x020830DD
    Info: Configuration succeeded -- 1 device(s) configured
    Info: Successfully performed operation(s)
    Info: Ended Programmer operation at Mon May 30 14:13:43 2005
    Info: Quartus II Programmer was successful. 0 errors, 0 warnings
        Info: Processing ended: Mon May 30 14:13:43 2005
        Info: Elapsed time: 00:00:04
    May 30, 2005 2:13:43 PM - (FINE) nios2-flash-programmer: SOF programming done. e
    xit code = 0x0000
    Send (64) failed.
    Unable to synchronize with target.
    May 30, 2005 2:14:35 PM - (SEVERE) nios2-flash-programmer: Error opening target
    hardware
    May 30, 2005 2:14:35 PM - (SEVERE) nios2-flash-programmer:
      In order to program flash, you must first create a purpose-built
      flash-programming design (i.e. FPGA configuration) and associate it with
      your particular board.  The Nios development kit is delivered with purpose-bui
    lt
      flash-programming designs pre-built for several development boards.  If you wi
    sh
      to program flash on your own board, you must first create a flash-programming
      design.
      The process of creating a flash-programming design for your board is mostly
      automated.  From a bash-shell, execute this script:
            mk_target_board --help
      The help-message includes references to other documentation on programming
      flash and targeting Nios systems to custom board designs.
     - exiting.
    /cygdrive/c/altera/kits/nios2/examples/mx_ata_rev2/system/software/memtest_ECT_R
    EV2/Debug
    $

    Regards

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

    Hello,

    Apparently, the programmer is able to upload the small design that will be used to transfer data from JTAG to flash (the one genereated by mk_target_board, let&#39;s call it the Programming Design), but when it starts, it cannot communicate with the application. So I think the problem comes from the Programming Design&#39;s .sof . I see two possible causes :

    - There might be a problem if your programming design runs under 50MHz, I had the problem before. To avoid this, add a PLL to increase your Nios speed.

    - The problem comes from your programming design pinout, but it seems to be a severe problem (not just a problem communicating with the flash, I think the Nios simply doesn&#39;t start). Maybe from the reset or the clock signals. Check your pin assign maybe.

    Hope this helps,

    Regards

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

    Just to be shure, you could also test the programming command manually:

    quartus_pgm --no_banner --mode=jtag --operation=p;MX_ATA_REV2.sof

    When the .sof file is time limited, quartus_pgm will not exit, and lead to, as far as I can remember, a error message like this. There might be other reasons for quartus_pgm not to exit, as well.

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

    Thx for your answers Pod & Havard

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    Just to be shure, you could also test the programming command manually:

    quartus_pgm --no_banner --mode=jtag --operation=p;MX_ATA_REV2.sof[/b]

    --- Quote End ---

    Ok tried the quartus_pgm. Have tried other ways to type it in also, but with same result.

    $ quartus_pgm --mode=JTAG --operation=p;MX_ATA_REV2.sof
    Error: Programming option string "p" is illegal. Refer to --help for legal progr
    amming option formats.
    Usage:
    ------
    quartus_pgm  | -v]
    quartus_pgm -c <cable name> filname.cdf  --- If you want to use cdf file
    quartus_pgm -c <cable name> -m <programming mode> -o <value>  ---
     If you want to use individual programming file(s)
    quartus_pgm -l --- to display the list of available hardware
    quartus_pgm -c <cable name> -a --- to display the list of devices connected to t
    he cable
    bash: MX_ATA_REV2.sof: command not found
    /cygdrive/c/altera/kits/nios2/examples/mx_ata_rev2/system/software/memtest_ECT_R
    EV2/Debug
    $

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    - There might be a problem if your programming design runs under 50MHz, I had the problem before. To avoid this, add a PLL to increase your Nios speed.[/b]

    --- Quote End ---

    The system runs at 100MHz

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    - The problem comes from your programming design pinout, but it seems to be a severe problem (not just a problem communicating with the flash, I think the Nios simply doesn&#39;t start). Maybe from the reset or the clock signals. Check your pin assign maybe.[/b]

    --- Quote End ---

    Will try and check them. Will report back on this.

    And thx again for using your time & energy on helping me out.

    Best regards

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

    I had the same problem!

    It only worked when I increased the clock frequency (originally was 50 MHz) to 75 MHz (using a PLL).

    Good luck!

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

    --- Quote Start ---

    originally posted by celso@Jun 1 2005, 07:44 AM

    i had the same problem!

    it only worked when i increased the clock frequency (originally was 50 mhz) to 75 mhz (using a pll).

    good luck!

    celso

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=7387)

    --- quote end ---

    --- Quote End ---

    I had the same problem too! But I can&#39;t fix it until now, can you describe the detailed process of making target_board.

    Can I turn off all of items in flash programmer, only turn on program flash memory with a file to program some other binary file into flash.?

    In my_target_board&#39;s sof. I am not sure the reset_n pin is right, and I don&#39;t how to use it in programming the flash. press it before I press the button program flash in flash programmer?