Other Parts Discussed in Thread: BLE-STACK, , CC2640, CC2640R2F
Hi,
Running out of RAM and using SDK 2.2.0 on CC2650EM_7ID.
IDE = IAR
Already used AUX_RAM.
My project is built over sensortag project.
Did the following as described in guides - "Using the cache as RAM."
Guides refer to cc2640R2 SDK platform (BLE-Stack 3.00.01 BLE-Stack 5), but i am using cc2650R1 on BLE-STACK 2-2-0.
Tried following errors reported by other community members but mostly they refer to R2F sdk platform.
I am stuck.
This is what I did:
1.
In the ccfg file, (called app_ble_ccfg.c
or ccfg.c
), include the following before #include <startup_files/ccfg.c>
:
#ifdef CACHE_AS_RAM #define SET_CCFG_SIZE_AND_DIS_FLAGS_DIS_GPRAM 0x0 /* Enable GPRAM */ #endif //CACHE_AS_RAM #include <startup_files/ccfg.c>
2.
In main()
, add the following code:
Listing 28. Retain cache in sleep.
#ifdef CACHE_AS_RAM // retain cache during standby Power_setConstraint(PowerCC26XX_SB_VIMS_CACHE_RETAIN); Power_setConstraint(PowerCC26XX_NEED_FLASH_IN_IDLE); #endif
And
In main these already exist:
/* Power Driver */
#include <ti/drivers/Power.h> #include <ti/drivers/power/PowerCC26XX.h>
Didnt do the following. I am using R1 chip.
/* Header files required to enable instruction fetch cache */ #include <ti/devices/cc26x0r2/inc/hw_memmap.h> #include <ti/devices/cc26x0r2/driverlib/vims.h>
3. Added CACHE_AS_RAM to Compiler.
4.Added CACHE_AS_RAM=1 to Linker
5. Added to cc26xx_app_oad.icf All GPRAM stuff. and placed somestuff there like this
if ( isdefinedsymbol(CACHE_AS_RAM) )
{
// GPRAM
define block GPDATA { section .bss object file1.o, section .bss object file2.o, section .bss object file3.o};
place in GPRAM { block GPDATA };
}
6.I added the 0x00018063
to the radio overrides. although not sure I need to?.
Problem
Program compiles, links, generates .hex files. Map file and memory locations look OK.
I download and run via debugger, program crashes, doesnt reach main().
Seems to be crashing because of some initialization code?.
I believe it is crashing on __iar_data_init3.
Questions
1. Is there anything else I missed, some startup code that enables VIM in BLE-Stack 2-2-0?.
Do I need to diasble VIM in System_Init?. Found some code there that was enabling VIM (I tried that didnt help.)
// setup system
System_Setup();
// Set cache mode
// Disable cache
VIMSModeSet( VIMS_BASE, VIMS_MODE_DISABLED );
// Wait for disabling to be complete
while ( VIMSModeGet( VIMS_BASE ) != VIMS_MODE_DISABLED );
// enable iCache prefetching
//VIMSConfigure(VIMS_BASE, TRUE, TRUE);
// Re-enable cache
//VIMSModeSet( VIMS_BASE, VIMS_MODE_ENABLED );
Seems to be crashing because of some initialization code?.
2. Could it be related to RF.c
Do i need to add the0x00018063
to the radio overrides. I did it, but do I realy need it.
I am using the radio, but didnt understand the instruction in the guide on projects not based on blestack.
Mine is based on blestack 2.2.0. So do I need to do it or not?.
Appreciate you assistance
Tamir