Forum Discussion

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

sof2flash

Hi All,

I am using Ubuntu 11.1 to use Quartus, the web version, and I have been putting stuff together for a while.

However now it's time to put a design onto my dev board (the Embedded Dev board).

As with all things I need to pipeclean the flow so I have decided to use the my first fpga as a good and known design to start with.

I've successfully generated the SOF and now attempting to generate the flash file as per the instructions provided by the web server on the dev board (which I think is superb).

When command sof2flash is entered with the appropriate settings I get a response being (from memory)

Line 2 Bad Substitution.

This is from one of the sh scripts that gets called up, think sj_jar ???

One of the first few anyway.

So it's probably a short somewhere between the ears but does anyone know of any classic pipe cleaning flow issues that it would be good to know about and thus avoid ?

Thank you for any help :)

Best Regards

Andre'

16 Replies

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

    Great thread. I just ran into this today as well. However, I still can't get sof2flash to work.

    I'm on Ubuntu 11.04 Natty 64-bit with Quartus 11.0 SP1 installed.

    fast@fourier:qout $ sof2flash --input=proto0.sof --output=proto0.flash --offset=0x00AC0000 --pfl --optionbit=0x00018000 --programmingmode=PS

    Wed Nov 30 @ 10:19 AM (svn:rev 5186:mod )

    fast(2051)@fourier:qout $

    No love whatsoever. I don't get an output file, and I get no errors or warnings. Just silent failure. :( Unfortunately, I'm no scripting pro.

    I relinked sh to bash instead of dash, but still get the same failure. Does anyone have this working on 64-bit Ubuntu? Am I missing a step?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I tracked down the problem to $SOMEDIR/11.0/nios2eds/bin/pl_jar.pl

    For some reason the variable nios2sh_JRE is set to "/linux/jre/bin/java"

    I just added the line:

    $nios2sh_JRE = "$SOMEDIR/11.0/quartus/linux/jre/bin/java";

    right before the exit system line and it ran.

    I also edited:

    $SOMEDIR/11.0/nios2eds/bin/sof2flash

    $SOMEDIR/11.0/nios2eds/bin/sh_jar.sh

    to reference /bin/bash instead of /bin/sh
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    There is a bug from quartus:

    pl_jar.pl uses sh_launch.pm which is using QUARTUS_ROOTDIR as rootdir path. But all other tools are using QUARTUS_ROOTDIR_OVERRIDE

    So you need to add the folowing lines to .bashrc and everything works:

    export QUARTUS_ROOTDIR=~/altera/11.1sp1/quartus

    export QUARTUS_ROOTDIR_OVERRIDE=$QUARTUS_ROOTDIR

    I'll add the description for this fix to:

    http://www.alterawiki.com/wiki/quartus_for_debian_wheezy