现在的位置: 首页 > 综合 > 正文

RealView MDK的指定位置

2013年01月30日 ⁄ 综合 ⁄ 共 1395字 ⁄ 字号 评论关闭
u8 a[10] __attribute__ ((at(0x2000002c)));
RealView MDK中如何指定子程序入口地址
http://blog.csdn.net/zyboy2000/article/details/4348121
在RealView MDK里面的help有

Variable attributes

4.5. Variable attributes

The __attribute__ keyword enables you to specify special attributes of variables or structure fields, functions, and types. The keyword format is either:

__attribute__ ((attribute1, attribute2, ...))
__attribute__ ((__attribute1__, __attribute2__, ...))

For example:

void * Function_Attributes_malloc_0(int b) __attribute__ ((malloc));
static int b __attribute__ ((__unused__));

Table 4.3 summarizes the available variable attributes.

Table 4.5. Variable attributes supported by the compiler and their equivalents

Variable
attribute
non-attribute equivalent
__attribute__((alias)) -
__attribute__((at(address))) -
__attribute__((aligned)) -
__attribute__((deprecated)) -
__attribute__((packed)) -
__attribute__((section(“name”))) -
__attribute__((transparent_union)) -
__attribute__((unused)) -
__attribute__((used)) -
__attribute__((weak)) __weak
__attribute__((visibility("visibility_type")))  
__attribute__((zeroinit)) -


Copyright
© 2007, 2008 ARM Limited. All rights reserved.
ARM DUI 0376B
Non-Confidential Unrestricted
Access

当然了,指定的位置是否安全,就要靠自己验证了,现在用到这个是因为IAP功能的读出。
作为IAP的参数存储可以实现,但是不知道擦写次数怎么样,如果只是使用,还是用24c01这类的存储EEPROM来做。
别给自己找麻烦

抱歉!评论已关闭.