TI中文支持网
TI专业的中文技术问题搜集分享网站

#CC2640R2F IAR icf 文件配置对HEX的影响

完全按照C:\ti421\simplelink_cc2640r2_sdk_1_40_00_45\docs\ble5stack\ble_user_guide的ble5stack-users-guide.html文件指示

但是部分ICF 文件的配置不太理解,不知道配的对不对;

最后影响 IAR  image_tool 报错 。

YiKai Chen:

icf是linker script,一般而言你並不需要修改,有什麼特別原因你要去動他?

yekun kun:

回复 YiKai Chen:

做OAD off_chip 指导是这么写的:
Modifications for IAR (cc26xx_app_and_stack.icf)
Allocation of Flash for Metadata Vector and App Start

We want the FLASH region to defines where the linker should place application and stack code and data.

Replace:

1
2
// Code and RO Data
place in FLASH_ALL { readonly };
With:

1
2
// Code and RO Data
place in FLASH { readonly };
Next redefine FLASH such that it goes from a undefined symbol OAD_FLASH_START to FLASH_END which is defined to the end of page 30. OAD_FLASH_START will represent where application/stack code may begin, after the header

1
define region FLASH = mem:[from OAD_FLASH_START to FLASH_END];
Then define the symbols that accounts for the OAD metadata:

1
2
3
4
// OAD specific
define symbol OAD_HDR_SIZE= 16; // Size of metadata vector
define symbol OAD_HDR_START= FLASH_START;
define symbol OAD_HDR_END= OAD_HDR_START + OAD_HDR_SIZE – 1;
Lastly define OAD_FLASH_START, accounting for the metadata vector as well as the interrupt table:

1
define symbol OAD_FLASH_START = INT_VEC_START + INT_VEC_SIZE;
Note

To fully define OAD_FLASH_START, the interrupt vector table needs to be accounted for. See the next step.

Alignment of Interrupt Vector Table see Using a custom reset vector address for your application

The Interrupt Vector Table needs to be placed in order for the application to function correctly. Normally, the table would start at the beginning of flash; however, due to the metadata vector, the table needs to be moved.

First define symbols to account for the table:

1
2
3
define symbol INT_VEC_SIZE= 64;
define symbol INT_VEC_START= OAD_HDR_START + OAD_HDR_SIZE;
define symbol INT_VEC_END= INT_VEC_START + INT_VEC_SIZE – 1;
Note

Symbols OAD_HDR_START and OAD_HDR_SIZE are defined in the previous step.

Next define the region based off the symbols defined:

1
define region INT_VEC= mem:[from INT_VEC_START to INT_VEC_END];
Lastly, for memory placement, the following needs to be added so the .intvec section gets placed correctly:

1
2
3
// Interrupt Vector Table
place at start of INT_VEC{ readonly section .intvec };
keep{ readonly section .intvec };
Preservation of Page 31 (BIM + CCFGs)

Although the project shouldn’t be building the ccfg_app_ble.c file, thus there shouldn’t be anything to link, removal of the following lines is recommended:

1
2
3
// CCFG
place at end of FLASH_LAST_PAGE { readonly section .ccfg };
keep { section .ccfg };
BIM should be building and linking the CCFGs.

The previous steps ensure that page 31 isn’t used by linker.

Page Alignment of OAD Image

The OAD image for a library OAD build with SNV will always be 31 pages. No page alignment is necessary. OAD Image Tool also will pad with 0xFF to the next page when producing an output binary.
大概是什么作用?都不知道自己改的对不对,别的地方都一摸一样了,最后生成的HEX不能被OAD_image_tool 转化,报错;
感觉可能icf 没改对

YiKai Chen:

回复 yekun kun:

你這個問題已經開了2個重複的貼文 ,建議你在之前的貼文跟進就好
e2echina.ti.com/…/192126
e2echina.ti.com/…/192123

Kevin Qiu1:

回复 yekun kun:

之前已经回复你了,在其他程序中加入OAD建议参考这里步骤:dev.ti.com/…/nodeimage_tool 编译器会自动调用

赞(0)
未经允许不得转载:TI中文支持网 » #CC2640R2F IAR icf 文件配置对HEX的影响
分享到: 更多 (0)