Forum Discussion
Altera_Forum
Honored Contributor
20 years agoto test if your enviroment works, you can make some small test
( the ide flash programmer in the ide has some quirks, so we go the simple way by script) make a new directory copy some files into this directory (main path may differ in your installation) copy c:\altera\kits\nios2\nios2_sdk_shell.bat copy c:\altera\kits\nios2\components\altera_nios_dev_board_cyclone_1c20 \system\altera_nios_dev_board_cyclone_1c20.sof copy c:\altera\kits\nios2\examples\factory_recovery niosII_cyclone_1c20\restore_cyclone_1c20.flash it's easier to copy the following command in a script file e.g. restore.sh and call it make a new file restore.sh and copy the following line in it (only one line) # start of script file nios2-flash-programmer --input=restore_cyclone_1c20.flash --sof=altera_nios_dev_board_cyclone_1c20.sof --device=1 --cable="USB-Blaster [USB-0]" --base=0x00800000# end of script file you now have a direcory with: nios2_sdk_shell.bat // the batch file to start the nios sdk shell altera_nios_dev_board_cyclone_1c20.sof // the flash programmer board file, only used by flash programmer restore_cyclone_1c20.flash // the original content of the flash on the board restore.sh // your simple shell script to program the flash file first call nios2_sdk_shell.bat with e.g. doppleclick then start your restore script with "sh restore.sh" you should see the following output: [SOPC Builder]$ sh restore.sh 27.05.2005 23:29:22 - (INFO) nios2-flash-programmer: Launching Quartus Programme r to download: altera_nios_dev_board_cyclone_1c20.sof Pre-Reading 831KBytes of data from U5: |----.----+----.----| ********************* (6.36 sec). Erasing 15 Sectors: |----.----+----.----| ********************* (13.046 sec). Writing 960KBytes : |----.----+----.----| ********************* (46.0 sec). Verifying 960KBytes of data: |----.----+----.----| ********************* (6.75 sec). 27.05.2005 23:30:38 - (INFO) nios2-flash-programmer: Success. Verified 960Kbytes written to U5. 27.05.2005 23:30:38 - (INFO) nios2-flash-programmer: Flash programming complete /cygdrive/c/work/tttt [SOPC Builder]$ if this worked then your usb-balster and download is ok, if not then post the output please. if it worked then we can program e.g. the standard.sof from the standard design: copy c:\altera\kits\nios2\examples\vhdl\niosII_cyclone_1c20\standard\standard.sof we make a new script (e.g) (flash_standard.sh) enter the following lines into the script: # start of script file# first we must convert .sof -> .flash sof2flash --flash=U1 --input=standard.sof --output=standard.flash --offset=0x600000 --verbose --safe# now we can program the .flash nios2-flash-programmer --input=standard.flash --sof=altera_nios_dev_board_cyclone_1c20.sof --device=1 --cable="USB-Blaster [USB-0]" --base=0x00800000 # end of script file call the script: sh flash_standard.sh you should get the following output: ... [SOPC Builder]$ sh flash_standard.sh 27.05.2005 23:58:52 - (FEIN) sof2flash: Starting Info: ******************************************************************* Info: Running Quartus II Convert_programming_file Info: Command: quartus_cpf --no_banner --convert standard.sof standard.rbf Info: Quartus II Convert_programming_file was successful. 0 errors, 0 warnings Info: Processing ended: Fri May 27 23:58:53 2005 Info: Elapsed time: 00:00:01 27.05.2005 23:58:54 - (FEIN) sof2flash: Done 27.05.2005 23:58:55 - (INFO) nios2-flash-programmer: Launching Quartus Programme r to download: altera_nios_dev_board_cyclone_1c20.sof Pre-Reading 434KBytes of data from U1: |----.----+----.----| ********************* (2.89 sec). Erasing 7 Sectors: |----.----+----.----| ********************* (3.985 sec). Writing 448KBytes : |----.----+----.----| ********************* (21.343 sec). Verifying 448KBytes of data: |----.----+----.----| ********************* (3.172 sec). 27.05.2005 23:59:30 - (INFO) nios2-flash-programmer: Success. Verified 448Kbytes written to U1. 27.05.2005 23:59:30 - (INFO) nios2-flash-programmer: Flash programming complete /cygdrive/c/work/tttt [SOPC Builder]$ if this also worked, the issue reset and start debugger again. good luck