MKD下地址绝对定位

[复制链接]
3919|3
 楼主| supercatinzoo 发表于 2011-4-6 15:37 | 显示全部楼层 |阅读模式
kd, TE, ST, TI, ADDR
先给例子:
const int x4 __attribute__((at(0x00010000)));
int x1 __attribute__((at(0x20003000)));
//
其中0x00010000、0x20003000分别为NUC140的Flash、Ram地址



MDK帮助文档:

__attribute__((at(address)))Example


const int x1 __attribute__((at(0x10000))) = 10; /* RO */int x2 __attribute__((at(0x12000))) = 10;       /* RW */int x3 __attribute__((at(0x14000))) = 0;        /* RW, not ZI */int x4 __attribute__((at(0x16000)));            /* ZI */
 楼主| supercatinzoo 发表于 2011-4-6 15:38 | 显示全部楼层
实验证明过的,有问题发邮件:zhangsongchen@gmail.com
yuangt 发表于 2013-12-2 08:57 | 显示全部楼层
想问一下LZ,你上述所说的是把一个变量定义到一个绝对地址当中,那怎样把一个函数定义到结对地址当中呢?
airwill 发表于 2013-12-5 13:09 | 显示全部楼层
函数定义绝对地址, 就要用连接命令了.
看一下连接器参考手册
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3

主题

27

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部