Forum Discussion

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

Problems with program_flash utility, or is it?

Greetings,

I downloaded ecos just recently. I have gone through the "getting started" documentation and I have run into problems. Here's my situation (note that I have used the standard example design from the kits/examples/vhdl/1s10ES/standard):

1) I ran the nios2configtool --ptf=std_1s10ES.ptf --cpu=cpu

2) I changed the Startup type to ROMRAM

3) I saved the project as first.ecc, then built the library.

my problem occurs when I try to run the application:

>first_install/program_flash examples/hello

here's the error:

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

/cygdrive/c/qdesigns/nios_designs/std_1s10_ecos/ecos_files

[SOPC Builder]$ first_install/program_flash examples/hello

Generating flash file for device ext_flash...

Programming device ext_flash...

Expected integer value for option &#39;base&#39;

* Value was: &#39;&#39;

* Using default value: -1

Apr 12, 2005 10:24:26 PM - (SEVERE) nios2-flash-programmer: No flash base specif

ied

nios2-flash_programmer is a utility for programming various types of

data into flash memory connected to an Altera FPGA.

usage: nios2-flash-programmer [--silent] [--debug] [--sof=file]

* * [--log=file] [--cable=cable name] [--device=device number] [--verbose]

* * [--help] [--relocate] [--instance=node index] [--input=file] [--quiet]

* * [--erase] [--nothing] [--epcs] [--base=addr]

Options may be specified in any order.

* * --base=<addr>* * * * * * * flash base address

* * --cable=<cable name>* * JTAG cable name

* * --debug* * * * * * * * * * debug mode

* * --device=<device number> JTAG index of FPGA

* * --epcs* * * * * * * * * program an epcs flash

* * --erase* * * * * * * * * * completely erase the flash

* * --help* * * * * * * * * print this message

* * --input=<file>* * * * * input Flash file to program

* * --instance=<node index>* * OCI node index

* * --log=<file>* * * * * * file for logging progress

* * --nothing* * * * * * * * * only download flash programmer design and

* * * * * * * * * * * * * * verify communication

* * --quiet* * * * * * * * * * only print errors

* * --relocate* * * * * * * relocate code following a SOF (EPCS mode

* * * * * * * * * * * * * * only)

* * --silent* * * * * * * * silent mode - same as quiet

* * --sof=<file>* * * * * * location of target flash programmer

* * * * * * * * * * * * * * design SOF.

* * --verbose* * * * * * * * * lots of interesting information

The nios2-flash-programmer utilizes a special target design to program

the flash memory on a board.* This design is seamlessly downloaded to

the target by nios2-flash-programmer when using a Nios Development

Board.* If you wish to program flash on a custom board, you must first

create your own flash programmer target design.* Please refer to the

"Nios II Flash Programmer User Guide" for details of this procedure.

You may use the --erase option either stand-alone, or with an input file

to program.* If used with an input file, the flash will be completely

erased before programming.

The --relocate option is used with EPCS serial configuration devices.

If data has already been programmed into the EPCS device, it will be

relocated at a higher address to make room for the new data being

programmed.

...done[/b]

It appears as though it is trying to find the &#39;base&#39; address of my ext_flash device, and comes back with an error ( &#39;-1&#39; ).

Not too sure why, so I went back to the configtool to see whether I needed to make any changes. When I rebuilt the library, I realize that I may have overlooked an error.

Check this out (refer to error at bottom of quote):

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

<attachment>

Here there appears to be an error because system.h could not be built? which is needed by heapgeninc.tcl

Does anyone know what steps I need to take to resolve?

Thanks,

-Terry

4 Replies

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

    It seems peculiar that you were able to build the "hello" application, given that the it looks like the eCos library failed to build. Could you create a new library and capture the build output from that library? There may be an earlier error there which will help diagnose the problem.

    The only thing you seem to be doing differently from me is that you are using the "vhdl" rather than "verilog" designs. This shouldn&#39;t matter, since the PTF files should be essentially identical in the two cases.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I restarted "from scratch" using the Verilog reference design. It works fine.

    There&#39;s a chance I modified the VHDL design quite some time ago. The VHDL design had "unspecified board" selected, and therefore U5 was not a proper reference. I imagine the whole ecos build tripped on this. I went back to SOPC builder, changed it to Nios-Devkit-1S10ES and re-generated. I opened my library (first.ecc) and had the same problems. Actually, that&#39;s where I cut-and-pasted the above messages from.

    Nevertheless, my problem is fixed.

    Thanks for sanity checking this for me.

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

    One last thing. I can download and communicate with the BB-II, but not the USB-Blaster.

    I use the -c2 flag with nios2-terminal. When I try this with program_flash, it yells at me saying<div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    Too many paramaters

    usage : program_flash name_of_your_elf_file

    ...done[/b]

    --- Quote End ---

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

    The program_flash script assumes that you only have a single cable connected. If you want to use an alternative cable, i.e. use the --cable option, then you will need to edit the program_flash script and add the option to the call to nios2-flash-programmer (if you do this, you&#39;ll obviously need to save the script under a different name to avoid having it overwritten).