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.

SIMPLELINK-CC2640R2-SDK: offchip OAD program will not fit into available memory

Part Number: SIMPLELINK-CC2640R2-SDK
Other Parts Discussed in Thread: CC2640R2F, BLE-STACK

Hello,

I'm working on multirole project on stack simplelink_cc2640r2_sdk_1_40_00_45, XDC tools 3.50.4.43 and cc2640r2f custom made sensortag devices.

I'm trying to do offchip oad using ble5_bim_oad_offchip_cc2640r2lp_app and multi-role project but during linking I'm getting the following error:

"C:/ti/simplelink_cc2640r2_sdk_1_40_00_45/source/ti/ble5stack/common/cc26xx/ccs/cc26xx_app_oad.cmd",

line 266: error #10099-D: program will not fit into available memory. placement with alignment fails for section ".const" size 0x1010 .

Available memory ranges:

FLASH size: 0x1dff0 unused: 0x11b8 max hole: 0xfb4

error #10010: errors encountered during linking; "ble5_multi_role_cc2640r2lp_app.out" not built

Has anyone faced this issue?

Can anybody help me with this issue?

Please advise. Thanks.

  • Hello,

    It is entirely possible that you do not have enough flash memory available for BLE5 Multi Role on CC2640R2F.
    What is the build size of your application before adding OAD?

    In general the requirements for offchip OAD are 1 pg of flash and the additional code consumed by the OAD profile.
  • Hey Sean,

    The hex file before adding OAD is 239 KB

    The picture of memory allocation is as shown below:

    Can you please tell how to free up memory?

    Thanks.

  • Hello,

    The hexfile isn't a true measure of the size of the binary image created by the compiler, it includes other header information such as addresses, lengths, and checksums. You can read more about one common format (Intel Hex) here:

    A better measure is instead to inspect the map file For example, I built the stock ble5_multi_role application and it gave me this:

    MEMORY CONFIGURATION

            name            origin    length      used     unused   attr    fill

    ----------------------  --------  ---------  --------  --------  ----  --------

     FLASH                 00000000   0001f000  0001cea8  00002158  R  X

     FLASH_LAST_PAGE       0001f000   00001000  00000058  00000fa8  R  X

     SRAM                  20000000   00004400  000028a4  00001b5c  RW X

    Based on the table above from the stock multi_role app it appears you should have enough memory to add off-chip OAD.  (~12k)

    So I started to look into the procedure myself, and I found an issue with the linker file. (cc26xx_app_oad.cmd).

    /* Address ceiling for an OAD of a full App + Stack image.  This calculation assumes a 1 page SNV
     * Sector in the second to last Flash page that the application wishes to retain across OAD. */
    #define FLASH_OAD_IMG_MAX_END      (FLASH_SIZE - (2 * PAGE_SIZE))

    The above calculation is wrong as it will try to reserve space for the NV when in fact it must be placed, if you wish to trim if before sending OTA you can do so with the oad_image_tool included in the SDK, but it should always be included as part of the linked image. I will report this issue to our R&D team. I have also updated 

    The line above should be changed to:

    /* Address ceiling for an OAD of a full App + Stack image.  This calculation assumes a 1 page SNV
     * Sector in the second to last Flash page that the application wishes to retain across OAD. */
    #define FLASH_OAD_IMG_MAX_END      (FLASH_SIZE - PAGE_SIZE)

    With the above modifications, I was able to make the application link using the OAD linker file and the CFG arg change, it produced the following map file:

    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    IMAGE_HEADER 00000000 00000010 00000000 00000010 R X
    FLASH 00000010 0001eff0 0001cf2c 000020c4 R X
    SRAM 20000000 00004400 000028a4 00001b5c RW X

    From this point you should be setup to continue following the guide, please keep in mind that after adding in the OAD code and profile you I noticed that there was only around 0xA5E free bytes of flash left. This is very little flash to perform any application level changes, please be weary of this. There are ways to trim the stack configuration (i.e. SNV) detailed in the BLE-Stack user's guide, but be aware that it is very likely that you will run out of flash in this configuration.

  • Hey Sean,

    Actually my memory configuration without OAD profiles is more then your multirole appliction memory location

    MEMORY CONFIGURATION

    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    FLASH 00000000 0001f000 00018a5e 000065a2 R X
    FLASH_LAST_PAGE 0001f000 00001000 00000058 00000fa8 R X
    SRAM 20000000 00004400 000028a7 00001b59 RW X

    The flash memory location in my application is more freed then yours but SRAM of mine is just 3 memory locations more then yours.

    But still after the changes you told to make in cc26xx_app_oad.cmd

    /* Address ceiling for an OAD of a full App + Stack image. This calculation assumes a 1 page SNV
    * Sector in the second to last Flash page that the application wishes to retain across OAD. */
    #define FLASH_OAD_IMG_MAX_END (FLASH_SIZE - PAGE_SIZE)

    I'm still getting the same error.

    "C:/ti/simplelink_cc2640r2_sdk_1_40_00_45/source/ti/ble5stack/common/cc26xx/ccs/cc26xx_app_oad.cmd",
    line 266: error #10099-D: program will not fit into available memory. placement with alignment fails for section ".const" size 0x1010 .
    Available memory ranges:
    FLASH size: 0x1eff0 unused: 0x11cc max hole: 0xfb4

    I have already trimmed the stack configuration (SNV) by making OSAL_SNV=1(from 2) but still it's not working.

    Anything else can I do?

    Please suggest, thanks.
  • Hello Sean,

    The above memory configuration which I have shared is on stack simplelink_cc2640r2_sdk_1_50_00_58 with BLE 4.2 and the program fits in the memory allocated without any issue.

    But when I try it on stack simplelink_cc2640r2_sdk_1_40_00_45 with BLE 5 without the OAD profiles it doesn't fit in the allowed memory allocation.

    But if I make OSAL_SNV=1 then it fits in BLE5 multirole and here's the memory configuration of this project:

    MEMORY CONFIGURATION

    name                          origin length used unused attr fill
    --------                          -------------- -------- --------- -------- -------- ---- --------
    FLASH                        00000000 0001f000 0001ec54 000003ac R X
    FLASH_LAST_PAGE 0001f000 00001000 00000058 00000fa8 R X
    SRAM                         20000000 00004400 00002cf1 0000170f RW X

    Does BLE5 multirole uses more memory then BLE4.2 multirole or it is because of the newer stack is optimised?

    Please advice, thanks.

  • Hey once again,

    Can I make OSAL_SNV=0 and comment

    /* Include GAP Bond Manager */
    /* -DGAP_BOND_MGR */

    this in build_config.opt and continue with OAD?

    Please advice, thanks.