在线时间113 小时
UID1763371
注册时间2015-6-15
NXP金币0
TA的每日心情 | 开心 2019-12-2 17:41 |
---|
签到天数: 2 天 连续签到: 1 天 [LV.1]初来乍到
金牌会员
 
- 积分
- 1135
- 最后登录
- 2019-12-2
|
我用的CW10.6.4,用PE生成代码,在main.c里定义变量
__attribute__ ((section(".cfmconfig"))) char flash_config[1] = {0x11};
ld文件
MEMORY {
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x000000C0
m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x0001FBF0
m_data (RW) : ORIGIN = 0x1FFFF000, LENGTH = 0x00004000
m_cfmprotrom (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
}
/* Define output sections */
SECTIONS
{
/* The startup code goes first into INTERNAL_FLASH */
.interrupts :
{
__vector_table = .;
. = ALIGN(4);
KEEP(*(.vectortable)) /* Startup code */
. = ALIGN(4);
} > m_interrupts
.cfmprotect :
{
. = ALIGN(4);
KEEP(*(.cfmconfig)) /* Flash Configuration Field (FCF) */
. = ALIGN(4);
} > m_cfmprotrom
编译后,报错
section `.cfmprotect' will not fit in region `m_cfmprotrom'
region `m_cfmprotrom' overflowed by 4 bytes
不知道有大牛遇到过这样问题没,求指点!!
最佳答案
楼主你好。
如果是PE生成的代码, 0x400开始的16个字节是flash configuration field区域,那么在CPU_Init.c中已经定义过了。
所以如果你再定义肯定会失败的。
[attach]417842[/attach]
[attach]417843[/attach]
...
|
|