u8 a[10] __attribute__ ((at(0x2000002c)));
RealView MDK中如何指定子程序入口地址
http://blog.csdn.net/zyboy2000/article/details/4348121
在RealView MDK里面的help有
Variable attributes
RealView Compilation Tools for µVision Compiler Reference Guide Version 4.0 Home > Compiler-specific Features > 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
attributenon-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))
-
当然了,指定的位置是否安全,就要靠自己验证了,现在用到这个是因为IAP功能的读出。作为IAP的参数存储可以实现,但是不知道擦写次数怎么样,如果只是使用,还是用24c01这类的存储EEPROM来做。别给自己找麻烦