请问,如果我想把一组变量(如int a;int c;int b;)在内存中的位置指到一个区域,应该怎么做?有哪位朋友知道,谢谢!!!
#include "absacc.h"
char aaaa __at(0x00012340);
谢谢你的答复,单个变量的指定我了解,请问有没有可以指定一组的方法。
2.可以指定section __attribute__ ((section(_name)))
然后在scatter file指定
我是想定义多个变量,如:
int a;
int b;
float c;
第二种方法能给个例子吗?十分感谢。
.c:
volatile int a1 __section("section1") =1221;
volatile int b1 __section("section1") =12;
volatile float c1 __section("section1") =1.2f;
.sct:
RW_IRAM1 0x10000000 UNINIT 0x00001000 { ; RW data
.ANY (+RW +ZI)
}
EW_IRAM2 0x10001000 0x00001000 { ; load address = execution address
*(section1)
}
map:文件输出
a1 0x10001000 Data 4 main.o(section1)
b1 0x10001004 Data 4 main.o(section1)
c1 0x10001008 Data 4 main.o(section1)
(没用stm的工程,地址不一样...)
十分感谢您的答复,谢谢。