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.

Compiler/CC2640R2F: How to config BLE4.2 Stack library in ROM

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640

Tool/software: TI C/C++ Compiler

Hello,

I modified the project:: C:\ti\simplelink_cc2640r2_sdk_1_40_00_45\examples\rtos\CC2640R2_LAUNCHXL\blestack\simple_peripheral_oad_onchip

I add two tasks with some functions, it seems that my total code exceed 36k. it report error: 

Error[Lp015]: section placement failure: overcommitted content in [0x0000132c-0x0000afff]

In CC2640R2F datasheet, http://www.ti.com/lit/ds/symlink/cc2640r2f.pdf ,Page5,  we can put  blestack in ROM, then we can use more than 80k flash.

How to config the project?

Best wishes,

Charles.

  • Hello Charles,

    The BLE stack components are in ROM for this sample application. The issue here is you have exceeded the available flash memory for on chip OAD. You need to either reduce your application size or use off chip OAD.

    Best wishes
  • Hi JXS,

    Thank you for your info.

    But which configuration leads to stack in ROM?

    After download code in flash, I found that stack is flash. here is the layout:

    cc2640r2lp_bim_onchip :         0x0001 f000 - 0x0001 ffff

    cc2640r2lp_persisten_app:     0x0001 5000 - 0x0001 efff

    SNV                                                0x0001 4000 - 0x0001 4ff

    cc2640r2lp_stack                        0x0000 b000 - 0x0001 3fff

    cc2640r2lp_app                           0x0000 0000 - 0x0000 affff

    Only after  I download cc2640r2lp_stack to flash area 0x0000 b000 - 0x0001 3fff, the cc2640r2lp_persisten_app or  cc2640r2lp_app  can work.

    I don't think my added code make the issue, because my code can work well in CC2640. I just port the code form CC2640 to CC2640R2F.

    Best wishes,

    Charles

  • Hi Charles,

    By default the BLE protocol stack uses ROM for its builds, but some components are also built in flash.

    The OAD stacks are using a slightly larger build configuration than you may need.

    if you don't need service changed indications (plan to discover services every time) you can gain 8kB of flash memory (two pages) by removing the L2CAP CoC feature from the stack build configuration.

    To do this you will need to perform the following steps:

    1. in the build_config.opt file of the stack project, comment out the line: -DV41_FEATURES=L2CAP_COC_CFG

    2. In the application files (simple_peripheral_oad_onchip.c, oad_persistent_app.c) comment out references to GAPBondMgr_ServiceChangeInd( );

    3. Clean and rebuild persistent app, stack in that order.

  • Hello Sean,

    You method is great!
    Thank you very much!
  • Hi Charles,

    Thanks for confirming that the procedure worked. I will be updating the following wiki page with this and other hints for flash optimization using SDK 1.40. processors.wiki.ti.com/.../CC2640_OAD_User's_Guide