Forum Discussion

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

bin2flash problems

Hello,

I'm trying to upload a linux kernel image to the Microtronix Stratix development board. The "Nios II Linux Quickstart Guide" says to right click on the build/vmlinux.bin file and select 'upload'. When I do this, I get the following error:

------------------------------------------------

Microtronix Linux Extensions

Version 1.1, Built Wed Jul 7 12:46pm EST 2004

------------------------------------------------

Expected integer value for option 'location'

Value was: 'null'

Using default value: -1

The bin2flash utility converts any binary data file to a FLASH file that

can be used by the flash programmer.

usage: bin2flash [--help] [--debug] [--silent] [--flash=designator]

[--input=file] [--quiet] [--epcs] [--base=addr] [--log=file]

[--location=addr] [--output=file] [--verbose]

Options may be specified in any order.

--base=<addr> flash base address

--debug debug mode

--epcs epcs flash mode

--flash=<designator> flash device reference designator

--help print this message

--input=<file> input Binary file to process

--location=<addr> design location within the flash

--log=<file> file for logging progress

--output=<file> output flash file

--quiet only print errors

--silent silent mode - same as quiet

--verbose lots of interesting information

I&#39;ve been able to sucessfully run bin2flash from the Nios II SDK shell command line where I can specify a value for the --location parameter.

Does anybody know how to specify the location parameter through the Nios II IDE?

Thanks,

Terry

2 Replies

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

    Hi, there is a bug that leaves out an attribute in one of the tags in the <project>.stf file when you apply changes in the project property page.

    To remedy this, you can open up the <project>.stf file in an editor and add

    offset=&#39;0x0&#39;

    to the location_on_target tag.

    So your tag should look like this:

    <location_on_target offset=&#39;0x0&#39;>

    Save these changes and you should be able to upload the kernel image without a problem.

    (note: the same problem will occur when applying changes in a filesystem project&#39;s property page; for a filesystem project, the offset should be 0x200000)

    This bug will be corrected in the next release of the Nios II Linux Distribution.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Randy,

    Thanks for the reply. I tried your suggestion but when I try to do the upload now I get a pop-up window that says:

    "Could not read project STF file."

    The stf file now contains:

    <?xml version=&#39;1.0&#39; encoding=&#39;UTF-8&#39;?>

    <stf>

    <project name=&#39;kernel_project&#39; ptf=&#39;D:\work\NiosII_Mtx_Stratix\LDK2.ptf&#39; cpu=&#39;cpu&#39;>

    </project>

    <location_on_target offset=&#39;0x0&#39;>

    flash_kernel

    </location_on_target>

    <execution_location>

    sdram

    </execution_location>

    </stf>

    Does this look correct?

    I was able to work around this problem by using the bin2flash and nios2-flash-programmer command line utilities; so really this is more of a bug report than an urgent problem.

    Maybe there should be a bug-report forum or something like that added to this site.

    Thanks for the help.

    Terry