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/CC2640: Can't adjust stack size in simple_peripheral project

Part Number: CC2640

Tool/software: TI C/C++ Compiler

I try to adjust the stack size from 1K to 2K in my modified simple_peripheral_2650lp  project linker settings the project settings but it seems to have no effect. 

The stack size in the map is unaffected. Is this overridden somewhere?


MEMORY CONFIGURATION

         name            origin    length      used     unused   attr    fill
----------------------  --------  ---------  --------  --------  ----  --------
  FLASH                 00000000   0000f000  0000dca4  0000135c  R  X
  FLASH_LAST_PAGE       0001f000   00001000  00000058  00000fa8  R  X
  SRAM                  20000000   00004348  00003871  00000ad7  RW X

20003f48    20003f48    00000400   00000000    rw- .stack

  • Hi Mark,

    Are you making changes in the cc26xx_app.cmd file, found in the TOOLS folder of the simple_peripheral_cc2640r2lp_app? You can see in the comments at the top of this file that it says:

    /* The following command line options are set as part of the CCS project.    */
    /* If you are building using the command line, or for some reason want to    */
    /* define them here, you can uncomment and modify these lines as needed.     */
    /* If you are using CCS for building, it is probably better to make any such */
    /* modifications in your CCS project and leave this file alone.              */
    /*                                                                           */
    /* --heap_size=0                                                             */
    /* --stack_size=256                                                          */
    /* --library=rtsv7M3_T_le_eabi.lib                                           */
    

    Is that where you made your change to the linker? I think as it suggests, it is better not to change the linker file at all but rather to change the CCS project settings. Stack size is configured in project > properties > Build > ARM Linker > Basic Options, you'll see a spot for "Set C system stack size". 

    Regards,

    Katie

  • In addition, please see Sec 3.11.3 "System Stack" in the BLE SW Developer's Guide SWRU393 for adjusting the system stack via the Program.stack parameter:

    Best wishes