This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

#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 报错 。

  • icf是linker script,一般而言你並不需要修改,有什麼特別原因你要去動他?
  • 做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 没改对
  • 你這個問題已經開了2個重複的貼文 ,建議你在之前的貼文跟進就好
    e2echina.ti.com/.../192126
    e2echina.ti.com/.../192123
  • 之前已经回复你了,在其他程序中加入OAD建议参考这里步骤:dev.ti.com/.../node
    image_tool 编译器会自动调用
  • 你好,你可以在SDK-1.40---》BLE5STACK->off-chip例程 添加$ TOOLS_BLE_DIR $ \ oad \ oad_image_tool.exe $ PROJ_DIR $ \ FlashROM_OAD_Offchip \ Exe \ $ TARGET_BNAME $ .hex -t offchip -i app --imgVer 0 -ob $ PROJ_DIR $ \ FlashROM_OAD_Offchip \ Exe \ $ TARGET_BNAME $ .bin -m 0 --r 0x0000试试是否成功。谢谢

    下文是文档原文:

    以下步骤详细说明如何生成包含应用程序,堆栈和芯片外BIM的芯片外OAD生产映像。

    警告

    以下步骤假定您已经遵循IAR 的即用型演示(仅适用于片外应用的OAD)的步骤1-2 。

    将以下代码添加到应用项目的后期构建步骤中。

    $ TOOLS_BLE_DIR $ \ oad \ oad_image_tool.exe $ PROJ_DIR $ \ FlashROM_OAD_Offchip \ Exe \ $ TARGET_BNAME $ .hex -t offchip -i app --imgVer 0 -ob $ PROJ_DIR $ \ FlashROM_OAD_Offchip \ Exe \ $ TARGET_BNAME $ .bin -m 0 --r 0x0000