关于IAV FOR AVR xdata内存不够的问题
单片机:ATmega64编程软件:IAV for AVR
出现的问题:
Building configuration: Lcd & Key control board V1 - Debug
Updating build tree...
Linking
Error: Segment NEAR_I (size: 0x115c align: 0) is too long for segment definition. At least 0x19c more bytes needed. The problem occurred while processing the
segment placement command "-Z(DATA)NEAR_I,NEAR_Z=_..X_SRAM_BASE-_..X_SRAM_END,_..X_EXT_SRAM_BASE:+_..X_EXT_SRAM_SIZE", where at the
moment of placement the available memory ranges were "DATA:140-10ff,DATA:10ff--1"
Reserved ranges relevant to this placement:
DATA:100-11f CSTACK
DATA:120-13f RSTACK
DATA:140-10ff NEAR_I
Total number of errors: 1
Total number of warnings: 0
我各个c文件单独编译都没问题
分析:我这个程序是LCD菜单程序,所以用的取模数组比较多,占了很大的内存,看到网上有说修改下图“修改软件参数1”,我就进行了修改,可是改来该去还是有错误,之后又看到说字模数组定义加const,加上去之后发现还是没有消除错误,请大神们帮个忙分析一下,如何修改才能使字模数组存到flash中啊
需要修饰:char __flash 把const uchar 改成uchar __flash看一下. sohappyoh 发表于 2014-8-30 15:48
需要修饰:char __flash
我定义成__flash里面, 读时候是不是和普通读一样? 一往无前 发表于 2014-8-30 17:26
我定义成__flash里面, 读时候是不是和普通读一样?
大神,之前没有往flash写过,不知道如何操作,能贴下代码我看看 一往无前 发表于 2014-8-30 17:49
大神,之前没有往flash写过,不知道如何操作,能贴下代码我看看
在函数里要是作为形参接收 __flash 的值的时候,应该这么写:
__flash unsigned char a={0,0,0,0,0};
void fun(__flash unsigned char *s)
{
unsigned char t;
//t=s;
} 一往无前 发表于 2014-8-30 17:49
大神,之前没有往flash写过,不知道如何操作,能贴下代码我看看
函数体的形参也要加__flash 我以前也研究了老半天。
http://www.amobbs.com/thread-5592656-1-1.html,这是我用AVR做的,你可以看下我写的程序,
好几处用到了 __flash yiyamala 发表于 2014-8-30 18:08
函数体的形参也要加__flash 我以前也研究了老半天。
http://www.amobbs.com/thread-5592656-1-1.html,这 ...
十分感谢{:handshake:} 一往无前 发表于 2014-9-1 09:05
十分感谢
{:victory:} 函数的形参也得加__flash 冷雨夜 发表于 2014-9-1 11:12
函数的形参也得加__flash
已经解决 谢谢!
页:
[1]