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.

SimpleBLEPeripheral issue: The stack pointer for stack 'CSTACK' (currently 0x20001B50) is outside the stack range (0x20003FE0 to 0x200043E0)

Other Parts Discussed in Thread: CC2650, CC2640, BLE-STACK

I downloaded the BLE demos and using IAR 7.40 compiler to run these demos and none of these work in the SmartRF06 EB for the CC2650. I haven't made any changes other than increasing the stack size for main() App. All of the demos fail to execute with the same error. I notice that if I comment the line in main() that calls to initialize ICall_createRemoteTasks(); then the application does not crash with this error.

Any help would be appreciated.

  • Hello Raul,

    All of us projects are built and tested to run on IAR EWARM 7.40. Can you please post more information about the error you are seeing? By how much are you increasing the stack size for main? Are you using the latest version of the BLE stack? please see section 9.1 of the software developer's guide
  • I downloaded the BLE stack yesterday it is version 2.1:
    BLE-STACK-2-1:
    BLE-STACK V2.1 (Support for CC2640/CC2650)

    I increased the stack size from 1024 all the way to 2048 but the error still the same. Here is the complete Debug Log of one run:
    Tue Sep 15, 2015 10:48:24: Loaded macro file: C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.2\arm\config\debugger\TexasInstruments\CC26xx.dmac
    Tue Sep 15, 2015 10:48:26: Connecting to TI XDS100 (Probe no: 06EB1221290B)
    Tue Sep 15, 2015 10:48:28: TI XDS ARM, device revision: 0x00000001, big endian: false, cache: false, board revision: 0x00000000, driver revision: 0x0B020200
    Tue Sep 15, 2015 10:48:29: Initial reset was performed
    Tue Sep 15, 2015 10:48:29: Watchdog disabled
    Tue Sep 15, 2015 10:48:29: 28660 bytes with download suppressed
    Tue Sep 15, 2015 10:48:29: Loaded debugee: C:\ti\simplelink\ble_cc26xx_2_01_00_44423\Projects\ble\SimpleBLEPeripheral\CC26xx\IAR\Application\CC2640\FlashROM\Exe\SimpleBLEPeripheralAppFlashROM.out
    Tue Sep 15, 2015 10:48:30: Target reset
    Tue Sep 15, 2015 10:48:32: 0 bytes downloaded (0.00 Kbytes/sec)
    Tue Sep 15, 2015 10:48:32: Loaded extra image: C:\ti\simplelink\ble_cc26xx_2_01_00_44423\Projects\ble\SimpleBLEPeripheral\CC26xx\IAR\Application\CC2640\..\..\Stack\CC2640\FlashROM\Exe\SimpleBLEPeripheralStackFlashROM.out, image ID 2
    Tue Sep 15, 2015 10:48:49: The stack pointer for stack 'CSTACK' (currently 0x20001B50) is outside the stack range (0x20003FE0 to 0x200043E0)

    This last stack message appears after I click the "Break" button in the IAR debugger. I'm able to set breakpoints, look at memory and use all the debugger capabilities and while debugging this issue I notice that if I comment out the function ICall_createRemoteTasks in main() then the application does not shows this error.

    Thanks
    Raul
  • Can you attempt to build with stack size settings unchanged? Is the boundary tool running properly?
  • Hi Sean,
    I'm currently building it unchanged. What is the boundary tool?
    Thanks
    Raul
  • The Boundary tool manages the application stack boundary and is run with each compile. More info at section 3.10.2 of the software developer's guide
  • Hi Sean,
    I read through all the sections and follow steps to recompile all and I can see the Boundary tool running at the end and looks fine to me:
    Processing Project Config Files
    [ Compiler Config Settings ]
    Compiler Flash Config Page = 0x0000F000 (61440)
    Compiler Flash Config Boundary Page Matches Expected Boundary
    [ Linker Config Settings ]
    Linker Flash Config Page = 0x0000F000 (61440)
    Linker Flash Config Boundary Page Matches Expected Boundary
    Linker Ram Config Page = 0x200043E4 (536888292)
    Linker Ram Config Boundary Page Matches Expected Boundary
    Processing Project Config Files -> Successful
    ///////////////////////////////////////////////////////////////////////
    Boundary Operation Complete
    ///////////////////////////////////////////////////////////////////////

    I'm out of ideas, I'll appreciate any more help you can provide.

    Thanks
    Raul
  • This is very strange, I'll do my best to help. The last resort would be freshly reinstalling both IAR and the BLE stack. Things like SimpleBLEPeripheral should compile and debug without change.

    Before we get to that, lets try to characterize your build environment:
    What debugger is selected under the SimpleBLEPeripheral project options?
    Have you built, and loaded the stack project onto the board before loading the app project?
    Does the stack project compile without warning?


    If any of these don't turn up any issues, I may need to take a look at you linker files (.icf)
  • Thanks Sean,

    What debugger is selected under the SimpleBLEPeripheral project options?

    The debugger selected is "TI XDS"

    Have you built, and loaded the stack project onto the board before loading the app project?

    Yes, I just repeated the sequence to load by compiling the stack project, then the App and then load the stack and after load the App.

    Does the stack project compile without warning?

    Yes, no errors or warnings.

    You can find the linker files here: 

    Thanks

    Raul

  • To ensure that your debugger is working properly, attempt to flash one of the provided .hex files to your device using SmartRF Flash Programmer 2. The hex files can be found under BLE_STACK_INSTALL/Accessories/HexFiles
  • Hi Sean,

    .../Accessories/HexFiles/CC2640_SmartRF-7ID_SimpleBLEPeripheral.hex and it works just fine, I can see in the LCD that is Advertising and I was even able to find it from my Android phone.
    What else should I try to make this work?
    Thanks
    Raul
  • Hi Sean,

    I just did a reinstall of the ble software and now works. I did try this before but I used the default directory for the install. In this new install I specified a different directory.
    Thank you for all your time and help.
    Regards
    Raul
  • You're welcome. Apologies that it had to come to a re-install. Did you notice anything different about the two paths that you used. Maybe there is an issue somewhere. We did your non working path have a space in it by any chance?
  • The default path (The one I used in the first and second installs) is ble_cc26xx_2_01_00_44423 with no spaces, for the last install (third) I used ble_cc26xx. I think something went wrong with the first 2 installs and even when I re-installed there must be something in the path that is corrupted or not setup properly.

    Thanks,
    Raul