YJ-DZ USB驱动开发板——调试记录

时间:2024-04-14 15:06:21

1. Device and Pin Options没有设置正确:

Error: Can't place multiple pins assigned to pin location Pin_C1 (IOPAD_X0_Y22_N21)
    Info: Pin FLASH_ASDO is assigned to pin location Pin_C1 (IOPAD_X0_Y22_N21)
    Info: Pin ~ALTERA_ASDO_DATA1~ is assigned to pin location Pin_C1 (IOPAD_X0_Y22_N21)
Error: Can't place multiple pins assigned to pin location Pin_D2 (IOPAD_X0_Y21_N14)
    Info: Pin FLASH_NCS is assigned to pin location Pin_D2 (IOPAD_X0_Y21_N14)
    Info: Pin ~ALTERA_FLASH_nCE_nCSO~ is assigned to pin location Pin_D2 (IOPAD_X0_Y21_N14)
Error: Can't place multiple pins assigned to pin location Pin_H1 (IOPAD_X0_Y17_N14)
    Info: Pin FLASH_DCLK is assigned to pin location Pin_H1 (IOPAD_X0_Y17_N14)
    Info: Pin ~ALTERA_DCLK~ is assigned to pin location Pin_H1 (IOPAD_X0_Y17_N14)
Error: Can't place multiple pins assigned to pin location Pin_H2 (IOPAD_X0_Y17_N21)
    Info: Pin FLASH_DATA0 is assigned to pin location Pin_H2 (IOPAD_X0_Y17_N21)
    Info: Pin ~ALTERA_DATA0~ is assigned to pin location Pin_H2 (IOPAD_X0_Y17_N21)
分析:
原因是不能分配给多功能管脚Pin_K22 。 这是由于Pin_K22 是一个多功能管脚,还有一个功能是nCEO,也是默认的功能。如果要用它当普通IO,需要提前设置一下:assignments>device>device and pin options>dual-purpose pins里面把nCEO设置成use as regular i/o就可以了。

解决办法:将DCLK、Data[0]、Data[1]、nCSO改为“Use as regular /IO”!

YJ-DZ USB驱动开发板——调试记录
参考:(原創) 深入探討DE2-70的『Error:Can't place pins assigned to pin location Pin_AD25 (IOC_X95_Y2_N1)』錯誤訊息的原因與解決方式 (SOC) (Quartus II) (DE2-70) (Tcl) - 真 OO无双 - 博客园
http://www.cnblogs.com/oomusou/archive/2011/02/28/de2_70_dual_pin.html

2. Error (10003): Can't open encrypted VHDL or Verilog HDL file
 "E:/software_workspace/quartus/sopc/cpu.v" -- current license file does not contain a valid license for encrypted file
这个问题很简单 ?就是因为**没有**好,打开**软件时要把quartus关掉,否则就会出现以上的为题,重新**一次就好了。

参考:玩quartus时容易出现的错误 - Micheal - ****博客
https://blog.****.net/hanghang121/article/details/20299109?utm_source=copy
 

3. 调试Nios II IDE程序时,窗口提示:

Using cable "USB-Blaster [USB-0]", device 1, instance 0x00
Pausing target processor: not responding.
Resetting and trying again: FAILED
Leaving target processor paused

解决办法:在”Hello from Nios II“例子中,需要修改系统时钟,c0改为2倍频,c1改为2倍频,-90度相位。

在其它Nios II IDE项目中,需要先清空工程,然后重建工程!

 

4. sof和elf合并脚本运行时报错

YJ-DZ USB驱动开发板——调试记录

系统环境:win7 64位

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
 

错误1:"nios2-elf-objcopy.exe: sof_elf.flash: Permission denied",通过切换至超级用户即可解决;

错误2:“./yj.sh: lin5: sof_elf.flash: Permission denied”是由于脚本语句第五行“cp sof.flash sof_elf.flash; cat elf.flash >> sof_elf.flash”造成的,cp语句想生成新的flash文件,被系统拒绝了!第五行可以修改为:“cat elf.flash >> sof.flash”,完整代码如下:

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 ..."; cat  elf.flash >> sof.flash
echo "flash>hex ..."; nios2-elf-objcopy --input-target srec --output-target ihex sof.flash sof.hex
echo "del flash ..."; rm -f *.flash

5. 运行C++工程“YJTestPorject.vcproj”,提示

YJ-DZ USB驱动开发板——调试记录

编译窗口错误提示:

1>------ 已启动生成: 项目: YJTestPorject, 配置: Debug Win32 ------
1>正在链接...
1>LINK : fatal error LNK1104: 无法打开文件“C:\YJTestPorject\YJTestPorject\lib\x86\CyAPI.lib”
1>生成日志保存在“file://c:\YJTestPorject1\YJTestPorject\Debug\BuildLog.htm”
1>YJTestPorject - 1 个错误,0 个警告
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========

解决方法1:将文件夹“速度测试”下的文件夹“YJTestPorject”拷贝至C盘根目录。

解决方法2:(当绝对目录发生改变时)

(1)打开工程“YJTestPorject.vcproj”,在“YJTestPorject”上右击属性->配置属性->链接器->输入->附加依赖项”,

将路径更新,例如:“C:\YJTestPorject\YJTestPorject\lib\x86\CyAPI.lib”改为“C:\YJTestPorject\lib\x86\CyAPI.lib”;

(2)在解决方案视图下,打开头文件中的“YJTestPorjectDlg.h”,将路径更新,例如:“#include "c:\yjtestporject\yjtestporject\inc\cyapi.h"”改为#include "c:\yjtestporject\yjtestporject\inc\cyapi.h"。