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.

RTOS/CC2640R2F: Enable cache as ram is not working

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640, CC2650

Tool/software: TI-RTOS

Hi All,

We are  using BLE Stack 3.1.1 with CC2640R2 SDK 1.50.00.58 in my project.

I enabled the cache as ram as per the guide

after linking, the the *.o files added into the GPRAM section variables are place in the GPRAM section perfectly which we can see in map file.

But when we run the program, the program  crashing when we access the variable from the GPRAM Section.

kindly help me on this.

we are in short of RAM. we already utilized AUX RAM successfully.

Thanks in Advance.

Thangaraj.P

  • Thangaraj,

    I see that you are using a very old SDK. I recommend considering moving to a newer SDK as well as read through this post on certification regarding older SDKs:

    https://e2e.ti.com/support/wireless-connectivity/bluetooth/f/538/t/803568

    It might be in your best interest to consider porting to the new SDK. 

    That said, can you describe your problem more definitively? When the program crashes, do you receive any sort of exceptions? If so, what are they?

    I've assigned this post to someone internally to follow up, but please provide responses to the above. 

  • Hi Evan,

    Apologies for wrong info .

    we are using the 2_20_00_49 of the SimpleLink CC2640R2 SDK.

  • Hi Thangaraj,

    Do you use an example project with the CacheAsRAM build configuration or did you configure yourself? It sounds like your problem could be that the cache is not configured correctly - can you go though the list again and double-check?

  • Hi Marie,

    we build our own .

    we did the following changes

    1. ccfg_app_ble.c

    #ifdef CACHE_AS_RAM
      #define SET_CCFG_SIZE_AND_DIS_FLAGS_DIS_GPRAM  0x0 /* Enable GPRAM */
    #endif //CACHE_AS_RAM

    2. main.c

            #ifdef CACHE_AS_RAM
            // retain cache during standby
            Power_setConstraint(PowerCC26XX_SB_VIMS_CACHE_RETAIN);
            Power_setConstraint(PowerCC26XX_NEED_FLASH_IN_IDLE);
            #else
            // Enable iCache pre-fetching
            VIMSConfigure(VIMS_BASE, TRUE, TRUE);
            // Enable cache
            VIMSModeSet(VIMS_BASE, VIMS_MODE_ENABLED);
            #endif //CACHE_AS_RAM

    3. enabled build macro and linker macro

        -D AUX_RAM \
        -D BSP_TARGET_BOARD=3 \
        -D CACHE_AS_RAM

    IAR_LDFLAGS_COMMON = \
        --config_def CC2650=2  \
        --config_def AUX_AS_RAM=1 \
        --config_def CACHE_AS_RAM=1 \
        $(IAR_LD_LIB_FILES) \
        --config $(BCDS_CONFIG_PATH)/stack/cc26xx_app.icf  \
        --keep __vector_table  \
        --entry __iar_program_start --vfe --text_out locale --diag_suppress=Lp023

    4. Same change did BIM

    5. Updated the icf file to stored *.o file in the region. Uploaded the icf for reference

    6. map file also attached for reference.

    Please check and let me what i did wrong.

    Thanks.icfandmapfile.zip


     

  • Hi Tharangaraj,

    Regarding BIM project vs. app project: You should apply all of the required modifications to the app project as described in the guide. Then the CCFG modification should be done in the BIM. If you wish to place stack image BSS in the cache then you can also modify that linker file too, however, then you must be careful to **only** download applications with Cache As RAM enabled.

  • Hi Marie,

    Yes. we did the change in BIM CCFG file and we dont want to the bss of stack to cache.

    i downloaded the same application which we enabled cache As RAM.

    Is there anything wrong in my above steps followed.

    kindly support.

  • Hi Marie,

    Any Updates from your side?

  • Hi Thangaraj,

    Have you tried putting a different object in the GPRAM to check whether AccelDataCollector.o is incompatible?

  • Yes. I tried with different object file.

    same issue is there

  • Hi,

    I just tested and I am able to enable cache as ram using the same steps as you (tested with the newest SimpleLink CC2640R2 3.20 SDK). 

    - Can you double-check that you are using the cache as ram override in ble_user_config.c? (0x00018063)

    - Can you try with .bss just to make sure it works?

  • ok..I will check and let you know.

    Thanks

  • Hi Thangaraj,

    Did you figure it out?

    I will close this thread due to inactivity.