工程编译后提示这3个警告,仿真和下载程序到目标板都可以正常运行,我想问问我忽略这三个警告会有什么意想不到的后果,或者是什么毛病?
这是这个工程的CMD文件
Shine:
请问这两个段里是不是有很大的数组?由于c55x的compiler编译器的局限性, 每个page有64k大小的限制。
yandenghong:
回复 Shine:
是的,.samdata 有220K的数组(单个数组samdata [11][5120]),.samdata_cal有110K数组(单个数组samdata_cal[11][2560])
yandenghong:
回复 yandenghong:
都是32位的 int类型
Shine:
回复 yandenghong:
大数组要拆分成几个小数组,c55x compiler不允许跨页。请参考下面的FAQ。
processors.wiki.ti.com/…/C5000_DSP_FAQ
yandenghong:
回复 Shine:
我看了你发的链接了,但还是不太明白,如果我不拆分成几个小数组会怎样?因为我的数组是要连着用的,拆开很麻烦。另外,我的CMD定义内存的时候可是合并了很大一片内存分配给这两个数组使用的,这样也不行吗?
Shine:
回复 yandenghong:
这个是c55x编译器的局限性,没法改变的。要求数组不能超过64k或者不能跨页(每页64k)。看看下面的FAQ中的例子,可以帮助您理解。
In C55x, why does a long pointer fail when incremented over a 64k boundary?
Problem:
When a long pointer is incremented and crosses over a 64k boundary (ie, an address which is a multiple of 0x0001_0000) why isn't the upper 7 bits of the address modified? It appears the address just wraps around the same 64k block of memory.Solution:
Even when the large memory, which supports 23-bit pointers, is used the
compiler does not calculate the offset from the base address correctly
when crossing a 64k page boundary.For example, if you have a pointer which starts at 0x2f000 and increment
the pointer to pass address 0x2ffff, instead of becoming 0x30000 the address
will wrap around and become 0x20000. The same is true for arrays, which
should not span a 64k page boundary.A workaround is to manually check for a boundary change and keep
track of what the next page should be.#pragma DATA_SECTION(gMp3, "ERAM")
int gMp3[200000];
int*p;
unsigned long intnextPage;
unsigned longi;
nextPage = (((unsigned long int)gMp3 & 0x7F0000) >> 16) + 1;
for ( i = 0; i < 200000; i++){*p++ = 0x0000;/* IMPORTANT: need this to manage page boundries manually. */if (((unsigned long int)p & 0xFFFF) == 0){p = (int *)(nextPage++ << 16);}
}
yandenghong:
回复 Shine:
好的谢谢,努力学习理解中;
另外还有个问题:不知道是不是因为越界的原因,调试时经常报这个错误:
C55xx: Trouble Reading Memory Block at 0x20c on Page 1 of Length 0x2: (Error -1146 @ 0x20C) Data scanned out of device is corrupt and not valid. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 7.0.188.0)这个错误是发生在load程序后,点击单步运行时发生的