使用Nios II 10.0sp1 Command Shell [gcc3]合并sof和elf文件——调试记录

开发环境:

电脑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文件即可!

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

snaking616

你的鼓励是我最大的动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值