首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

[求助]编译时提示onchip memory is full

[求助]编译时提示onchip memory is full

提示如下:

make -s all
Compiling hello_world.c...
../hello_world.c:20: warning: return type defaults to `int'
Linking hello_world_0.elf...
/cygdrive/d/altera/kits/nios2_60/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.1/../../../../nios2-elf/bin/ld: region onchip_memory_0 is full (hello_world_0.elf section .text). Region needs to be 35412 bytes larger.
/cygdrive/d/altera/kits/nios2_60/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.1/../../../../nios2-elf/bin/ld: address 0x10a8bc of hello_world_0.elf section .rwdata is not within region onchip_memory_0
/cygdrive/d/altera/kits/nios2_60/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.1/../../../../nios2-elf/bin/ld: section .bss [00100020 -> 00100023] overlaps section .text [00100020 -> 00109a53]
/cygdrive/d/altera/kits/nios2_60/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.1/../../../../nios2-elf/lib/mno-hw-mul/libc.a(sbrkr.o)(.text+0x14): In function `_sbrk_r':
/build/nios2/bin/nios2-gnutools/src/newlib/newlib/libc/reent/sbrkr.c:59: Unable to reach errno (at 0x00100020) from the global pointer (at 0x00112874) because the offset (-75860) is out of the allowed range, -32678 to 32767.

collect2: ld returned 1 exit status
make: *** [hello_world_0.elf] Error 1
Build completed

这是什么原因啊?如何解决呢?谢谢!

“Region needs to be 35412 bytes larger”你所使用的片上ram太小了 ,还需要35412byte,你可以将你的reset地址选择为flash,这样就不会再出现这样的问题了 。
这个版主不太冷 =========================== 我的中电网博客:http://blog.chinaecnet.com/u/20/index.htm
reset地址可以随便放吗,SDRAM,ON_SHIP_RAM,FLASH
reset地址设置不是最重要的,关键在ide中把你的ro区和rw区设置正确,尤其是ro区设置在大容量ram中。
在交流中前进,共同实现nios的应用。

"reset地址可以随便放吗,SDRAM,ON_SHIP_RAM,FLASH"

SOPC中的reset address 指定的是最终全部软件程序代码下载到的地方,并且程序从reset address 启动。
SOPC中的exception address 指定的是系统异常处理代码存放的地方。如果exception address 和reset address 不一样,那么程序从reset address 启动后将把放在reset address 处的系统异常处理代码拷贝到exception address 。
NIOS II软件中的text address指定的是程序运行的地方。如果text address和reset address 不一样,那么程序从reset address 启动后将把放在reset address 处的普通只读程序代码拷贝到text address 。NIOS II软件中的rodata address指定的是只读数据的存放地方。如果rodata address和reset address 不一样,那么程序从reset address 启动后将把放在reset address 处的只读数据拷贝到rodata address 。
NIOS II软件中的rwdata address指定的是可读写数据的存放地方。如果rwdata address和reset address 不一样,那么程序从reset address 启动后将初始化rwdata address 处的可读写数据。

这个版主不太冷 =========================== 我的中电网博客:http://blog.chinaecnet.com/u/20/index.htm
reset地址不重要,那是你需要从ide下直接下载到flash中需要注意这点,如果是自己转换为flash文件,就自己重新指定reset地址就可以了。对于楼主的问题,主要是程序空间不够,和reset地址没有任何关系的。
在交流中前进,共同实现nios的应用。

楼主们的解释让人学到不少..

我也遇到过。。换个sdram作为存放就好了

返回列表