编译NIOS2出现如下错误提示:make:***[**.mk] Error 1 或者 make: *** [**.elf] Error 1
2014-01-06 14:20
656 查看
我的系统是WIN7,QuartusII和NIOS2的版本都是10.0,按照特权同学的《特权和你一起学NIOS2--第三章 流程实践案例——手把手第一个工程》操作,前面都很顺利,后来在Eclipse里建好了软件工程之后,编译(Build Project),出现如下错误提示:make:***[**.mk] Error 1 或者 make: *** [**.elf] Error 1。
看了很多论坛,很多网友都提了自己的解决思路,归纳起来,大概有几种解决办法:
(1)、Regenerate the BSP to update the Makefile, and then build again. To regenerate from Eclipse: 1. Right-click the BSP project. 2. In the Nios II Menu, click Generate BSP.
(2)、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 (under nios2eds\bin\nios2-gnutools\ H-i686-pc-cygwin\libexec\gcc\nios2-elf\3.4.6)
8. Nios2-elf-g++.exe (under nios2eds\bin\nios2-gnutools\ H-i686-pc-cygwin\bin)
方法就是将上面8个.exe文件改成XP兼容模式。
(3)、两个问题,第一,clean project; 第二,由于我用的onchip memory,修改system library,需要去掉suppt c++。
(4)、Your on-chip memory is too small. It looks like you'll need 64K. Make your on-chip memory bigger, or try to shrink the size of your code (use smallc library, etc.)
解决办法(1)和(2)我反复试验了,没有用。(3)和(4)只是提出了一个思路,没有指出具体的操作步骤,但是,仔细分析,你会发现他们其实说的是一个意思,就是FPGA的片上memory太小,存储空间不够。再反过头来看特权同学的pdf教程,有这么一段描述:
七、设置软件编译属性
由于正常的工程模板软件C代码量比较大,而我们所分配的可用片内存储器(onchip_mem)容量也不大(12KBytes),因此需要在软件编译属性里做一些简单的设置,以裁剪代码量,否则编译将无法通过。
代码裁剪不是无依据的随便设置,在官方的edh_ed_handbook.pdf.Section II.3.Debugging Nios II Designs.Reducing Code Size一节有所描述。因此,根据文档中推荐的消减代码需要做如下设置。
看完这个,不禁豁然开朗。设置步骤如下:设置Eclipse里面的菜单NiosII / BSP Editor ,选择当前BSP工程(如图1所示)后确定,出现如图2所示的对话框,按照上面的表格设置相关参数,保存并点击右下角的“Generate”,完成后退出即可。
图1
注意上图:要check两个enable box
图2
上面的设置顺利完成之后,再Build Project,就OK啦。成功之后,Console栏会出现很多message,其中有两行是:
Info: (first2_swprj.elf) 5152 Bytes program size (code + initialized data).
Info: 6896 Bytes free for stack + heap.
这就是memory的使用情况。
看了很多论坛,很多网友都提了自己的解决思路,归纳起来,大概有几种解决办法:
(1)、Regenerate the BSP to update the Makefile, and then build again. To regenerate from Eclipse: 1. Right-click the BSP project. 2. In the Nios II Menu, click Generate BSP.
(2)、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 (under nios2eds\bin\nios2-gnutools\ H-i686-pc-cygwin\libexec\gcc\nios2-elf\3.4.6)
8. Nios2-elf-g++.exe (under nios2eds\bin\nios2-gnutools\ H-i686-pc-cygwin\bin)
方法就是将上面8个.exe文件改成XP兼容模式。
(3)、两个问题,第一,clean project; 第二,由于我用的onchip memory,修改system library,需要去掉suppt c++。
(4)、Your on-chip memory is too small. It looks like you'll need 64K. Make your on-chip memory bigger, or try to shrink the size of your code (use smallc library, etc.)
解决办法(1)和(2)我反复试验了,没有用。(3)和(4)只是提出了一个思路,没有指出具体的操作步骤,但是,仔细分析,你会发现他们其实说的是一个意思,就是FPGA的片上memory太小,存储空间不够。再反过头来看特权同学的pdf教程,有这么一段描述:
七、设置软件编译属性
由于正常的工程模板软件C代码量比较大,而我们所分配的可用片内存储器(onchip_mem)容量也不大(12KBytes),因此需要在软件编译属性里做一些简单的设置,以裁剪代码量,否则编译将无法通过。
代码裁剪不是无依据的随便设置,在官方的edh_ed_handbook.pdf.Section II.3.Debugging Nios II Designs.Reducing Code Size一节有所描述。因此,根据文档中推荐的消减代码需要做如下设置。
看完这个,不禁豁然开朗。设置步骤如下:设置Eclipse里面的菜单NiosII / BSP Editor ,选择当前BSP工程(如图1所示)后确定,出现如图2所示的对话框,按照上面的表格设置相关参数,保存并点击右下角的“Generate”,完成后退出即可。
图1
注意上图:要check两个enable box
图2
上面的设置顺利完成之后,再Build Project,就OK啦。成功之后,Console栏会出现很多message,其中有两行是:
Info: (first2_swprj.elf) 5152 Bytes program size (code + initialized data).
Info: 6896 Bytes free for stack + heap.
这就是memory的使用情况。
相关文章推荐
- WIN7下编译NIOS2出现如下错误提示:make:***[**.mk] Error 1 或者 make: *** [**.elf] Error 1
- 编译caffe出现错误:make: *** [.build_release/src/caffe/common.o] Error 1
- 编译caffe出现错误:make: *** [.build_release/src/caffe/common.o] Error 1
- caffe在make过程中出现[.build_release/tools/extract_features.bin] Error 1或者与libreadline.so.6相关错误解决方法
- 编译u-boot的时候出现的错误ERROR: Source object lib_generic/libgeneric.a(crc16.o) has EABI version 0, but target u-boot has EABI version 4 记住make distclean
- 编译php 出现 make: *** [ext/mysqli/mysqli.lo] Error 1 错误的解决办法
- linux 2.6.30 内核编译 提示 ‘make[1]: *** [arch/x86/vdso/vdso.so.dbg] Error 1’ 错误
- 在windows直接运行Qt编译出来的可执行程序出现了如下提示错误: this application has requested the runtime to terminate it an unu
- 编译内核出现错误提示:line 0:syntax error near unexpected token '('
- 在windows直接运行Qt编译出来的可执行程序出现了如下提示错误: this application has requested the runtime to terminate it an unu
- 编译Linux内核时出现错误gcc: error: elf_i386: No such file or directory
- Gcc 4.6 编译 Linux kernel时出现错误error: elf_i386: No such file or directory
- 用ccs编译文件后出现如下错误: error: symbol _USER10_ISR is defined multiple times: D:\CCStudio_v3.1\MyProjects\BL
- IAR for 8051 编译出现Error[e72]错误提示,解决办法
- 编译Linux内核时出现错误gcc: error: elf_i386: No such file or directory
- Openwrt:编译固件提示[mktplinkfw] error: images are too big 错误
- 编译PHP make 时出现错误 make: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1
- cvs 出现如下错误提示:error fetching file revisions
- IDEA在代码上无错误提示,但是编译时出现error:非法字符
- 【CentOS6.5】安装之DNS配置错误,yum install 软件报错:ERROR 6或者56错误提示”could not retrieve mirrorlist http://mirrorlist.centos.org ***”