Forum Discussion

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

Issue FACTORY command

I'm using a Cyclone III LS 150 (780 pin), and programmed it using Active Serial. Now, I am altering the program stored in the Serial Device by programming through the JTAG port nad using the FPGA as the serial loader. However, I cannot reprogram the FPGA and Serial Device. Altera says I need to issue a FACTORY command via JTAG to solve this.

Can anyone give me instructions on how to do this via Quartus and the USB Blaster? Or is it even possible?

Thanks in advance

18 Replies

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

    --- Quote Start ---

    Use 'quartus_stp -s' from the command line, source the attached Tcl script, and then use jtag_open, and then read_idcode or read_usercode. If you have the IR value for FACTORY, you can create a new Tcl procedure to issue that command.

    Cheers,

    Dave

    --- Quote End ---

    I'm sorry for asking the stupid questions, but exactly how do I "source the attahched Tcl script?"

    I have saved it locally and have added the jtag_open() command from this thread as well. But I don't know how to actually call the function from within quartus_stp.

    I'm an FPGA guy, but have not yet learned Tcl scripting. My apologies!

    thanks,

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

    --- Quote Start ---

    I'm sorry for asking the stupid questions, but exactly how do I "source the attahched Tcl script?"

    --- Quote End ---

    The word 'source' didn't provide the clue? :)

    1) Start a NIOS II IDE shell

    2) Start quartus_stp via

    bash-3.1$ quartus_stp -s

    3) Source the script myscript.tcl

    tcl> source myscript.tcl

    where myscript.tcl is a file in the same directory as where you started quartus_stp.

    If the script is somewhere else, you can source it with a path

    tcl> source c:/path_to_my_scripts/myscript.tcl

    or if you've got a Windows format, 'cause you copied-and-pasted from Windows Explorer, use

    tcl> source {c:\path_to_my_scripts\myscript.tcl}

    and the {} braces pass the path as a list to Tcl, and it fixes up the path separators.

    --- Quote Start ---

    I'm an FPGA guy, but have not yet learned Tcl scripting. My apologies!

    --- Quote End ---

    The book by Brent Welch is a pretty good reference for Tcl programming.

    Ask questions when you get stuck.

    Cheers,

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

    Dave-

    I'm red-faced with embarrassment! :oops: Thank you for that instruction. I have passed a link to this thread on to my coworker who is working this issue directly and will have him try it.

    We are in Windows, but the procedure I'm sure is remarkably similar. :)

    I had just tried "quartus -s <filename.tcl>" and seemed to get errors. I will ask him to try it the way you suggested and report back.

    cheers,

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

    --- Quote Start ---

    We are in Windows, but the procedure I'm sure is remarkably similar. :)

    --- Quote End ---

    That was the procedure for Windows.

    Under Linux, you start a bash shell, and then source nios2_command_shell.sh from within the nios2eds folder in your Altera installation. Under windows, starting the NIOS II IDE from the start menu runs a batch file that does the same setup.

    Once you're in a bash shell, the procedure is identical.

    Cheers,

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

    Hi Dave. Question: is it necessary to start a NIOS IDE shell first? Can we just run quartus_stp -s from the Windows/DOS command prompt and go from there?

    We're trying it currently without anything to do with NIOS, and it's not working yet. We're currently verifying the nCONFIG is in fact asserted low and held low during the instruction and then released to float high once the instruction is sent.

    thanks,

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

    --- Quote Start ---

    Question: is it necessary to start a NIOS IDE shell first? Can we just run quartus_stp -s from the Windows/DOS command prompt and go from there?

    --- Quote End ---

    The NIOS IDE shell is pretty much identical to a Windows/DOS command prompt. Did you try and bring one up?

    quartus_stp should work for both, however, the paths to the Altera tools might not be setup correctly. The advantage of using the Altera bash shell is that the paths are all correct.

    I have several versions of Quartus installed, and Cygwin, and I find it much less trouble if I just use the shell from the specific Altera installation.

    --- Quote Start ---

    We're trying it currently without anything to do with NIOS

    --- Quote End ---

    The NIOS II IDE Shell is just what its called on the Windows Start Menu. It doesn't have to involve a NIOS processor in your design.

    Cheers,

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

    Well, we got it working (somehow) using the scripts from this page. I think we had a glitch trying to maintain nConfig low at first or something like that. But net result, we just ran "quartus_stp -s" from the command prompt in the same folder path as the tcl script file sourced, and went from there..

    thank you!

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

    --- Quote Start ---

    Well, we got it working (somehow) using the scripts from this page. I think we had a glitch trying to maintain nConfig low at first or something like that. But net result, we just ran "quartus_stp -s" from the command prompt in the same folder path as the tcl script file sourced, and went from there.

    --- Quote End ---

    Great, glad to hear its working.

    Cheers,

    Dave