今天尝试了一下NIOSII,处女作就折戟沉江,求各位帮助
准备进军SOPC,今天按书上介绍的流程根据自己的原理图用NIOSII写了一个小程序,结果无法MAKE,太打击了……编译报告如下:
make -s all includes
Compiling hello_world.c...
Linking hello_world_0.elf...
/cygdrive/e/altera/90/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/bin/ld: region onchip_memory2_0 is full (hello_world_0.elf section .rwdata). Region needs to be 996 bytes larger.
/cygdrive/e/altera/90/nios2eds/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.6/../../../../nios2-elf/bin/ld: section .bss overlaps section .exceptions
/cygdrive/e/FPGA/hello_world_0_syslib/Debug/libhello_world_0_syslib.a(alt_close.o)(.text+0x128): In function `alt_get_errno':
/cygdrive/e/altera/90/nios2eds/components/altera_hal/HAL/inc/sys/alt_errno.h:81: Unable to reach errno (at 0x00002024) from the global pointer (at 0x0000c38c) because the offset (-41832) is out of the allowed range, -32678 to 32767.
collect2: ld returned 1 exit status
make: *** Error 1
Build completed in 5.859 seconds
似乎我的源程序没什么错误吧,根据提示好像是说我的片上内存区域设置过小?但我在SOPC BUILDER里设置的是8192Bytes啊,为什么还会这样报错呢?FPGA是EP2C8Q208C8N,谢谢各位指点
http://cache.amobbs.com/bbs_upload782111/files_20/ourdev_495755.JPG
内存分配设置 (原文件名:memory.JPG) 估计你想用printf打印东西,用了这个函数在这个存储大小下小了 源程序如下,没有使用printf函数
#include "system.h"
#include "alt_types.h"
#include "altera_avalon_pio_regs.h"
int main()
{
alt_u8 led = 0x2;
volatile int i;
while(1)
{
for(i=0;i<200000;i++);
led=0x1;
IOWR_ALTERA_AVALON_PIO_DATA(PIO_1_BASE,led);
for(i=0;i<200000;i++);
led=0x2;
IOWR_ALTERA_AVALON_PIO_DATA(PIO_1_BASE,led);
}
return 0;
} Nios II嵌入处理器,,太复杂了。。太深奥了。。太繁琐了。。不到万不得已,俺是不打算使用的。也没学过。
Nios II 有标准的CPU嵌入库吗???——例如:PIC 单片机的库??ATMAIL 单片机的库???51 单片机的库??
ALTERA 的 Nios II 最小,需要多大“门数”的FPGA 或者 CPLD 芯片呢???(8万等效门,够吗??) LS 的应该接受XILINX Microblaze及其开发环境的洗礼。 你为什么用HELLO_WORD模板 不用HELLO_LED模板?
我用的是NIOS II 9.0SP2,找不到HELLO_LED模板 你是不是也是这样?
看提示貌似是说RAM不够 会不会是 自动分配变量地址出现问题?
我也是新手 用的是EP2C5Q208C8N 大家共同学习下 呵呵
这样做吧
http://cache.amobbs.com/bbs_upload782111/files_21/ourdev_496460.jpg
http://cache.amobbs.com/bbs_upload782111/files_21/ourdev_496459.jpg 注意一下,main要用alt_main替代
那个例子里面有。
但printf很占地方,片上的空间不够~ 我也出过这样的错误,是内部ROM不够! 你可以将将代码优化一下!选-os
页:
[1]