开发环境:
电脑win7_64;Quartus II 10.0;Nios II 10.0;FPGA:EP4CE10。
1.Nios软件存在的bug及解决思路:
Nios II Flash Programmer 下载后无法从EPCS自举,具体现象如下:
Using cable "USB-Blaster [USB-0]", device 1, instance 0x00
Pausing target processor: not responding.
Resetting and trying again: FAILED
Leaving target processor paused
2.解决思路:
使用Nios II 10.0sp1 Command Shell [gcc3]软件,将sof和elf文件合并后转换为jic文件,需要用到的脚本代码如下,代码可以直接复制到空记事本中,文件另存为yj.sh。
sof="EP4.sof"
elf="YJ_NiosTest.elf"
echo "sof>flash ..."; sof2flash --epcs --input=$sof --output=sof.flash --quiet
echo "elf>flash ..."; elf2flash --epcs --after=sof.flash --input=$elf --output=elf.flash
echo "cat flash ..."; cp sof.flash sof_elf.flash; cat elf.flash >> sof_elf.flash
echo "flash>hex ..."; nios2-elf-objcopy --input-target srec --output-target ihex sof_elf.flash sof_elf.hex
echo "del flash ..."; rm -f *.flash
3.遇到的问题
提示部分程序无权限,具体现象如下:
网上常见的解决方法:
解决办法:因为在win7下的权限问题.具体解决方法参考下面的方法:
Under your Quartus II folder, go to bin->cygwin->bin folder, select the following files in the list below and then right-click and choose Properties. Under the Compatibility tab, check “Run this program in compatibility mode for:” and choose “Windows XP (Service Pack 2)”. Check “Run this program as an administrator”, as well.
Here is the list of files that you can select to change their compatibility mode under the Quartus II->bin->cygwin->bin folder:
1. Make.exe
2. Sh.exe
3. Echo.exe
4. Cygstart.exe
5. MakeInfo.exe
6. Perl.exe
7.Collect2.exe(undernios2edsbinnios2-gnutoolsH-i686-pc-cygwinlibexecgccnios2-elf3.4.6)
8. Nios2-elf-g++.exe (under nios2edsbinnios2-gnutools H-i686-pc-cygwinbin)
在英文网上查到的,这几个不同的exe文件在不同的bin文件夹之间,依次右击改掉属性,把允许管理员使用权限前面打上勾即可.
上面的解决方法基本是无效的,怎么修改程序的权限也没具体交代!
4. 解决办法
将当前用户切换至管理员Administrator,在该用户模式下使用Nios II 10.0sp1 Command Shell [gcc3]软件,脚本运行效果如下
sof_elf.hex文件已成功生成,现在只需要使用Quartus II软件将其转换成jic文件即可!