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.

Sensortag works only in debug mode

Hi,

With the BLE stack v2.1, this is what I observe:

1. Import and compile SensorTagStack as well as SensorTag projects from a fresh installation of the BLE stack v2.1;

2. Load SensorTagStack using CCS. Then "Stop" the debug session;

3. Load SensorTag application using CCS. Observe that the device is working properly using SensorTag app on iOS;

4. Stop the debug session;

5. Pull out the USB cable of debugger then plug it in again after a few seconds;

6. The red LED is switched ON and no BLE activity is observed!

This is happening every time I try flashing the SensorTag. I tried enabling the FEATURE_LCD so that I could observe where exactly is this issue coming in, but that in itself is causing other issues like stopping BLE activity! I am following up on that in a separate thread.

Can somebody recommend how should I go about debugging this?

  • Hello Anup,

    Although I recommend programming the Application first, followed by the Stack, I'm not able to replicate your failure. Do you have a battery inserted when you are re-attaching USB?

    You may want to try start by doing a full erase in SmartRF Flash Programmer v2 1.6.3, followed by building/flashing the BIM_ExtFlash project (under Projects/util), then the ST App & Stack projects.

    Note that FEATURE_LCD is only for the LCD DevPack, it should not be used otherwise.

    Best wishes
  • Hi JXS,

    The BIM_ExtFlash did the trick! Where can I find documentation on the need for this project?

    I think I created the problem by using Flash Programmer to first erase the whole flash, and then write my Stack and App only. This BIM part was of course never written!

    You asked me to burn the app first and then the stack. Why is that? Shouldn't the stack be compiled first so that the boundary tool can adjust the space allocation on the FLASH? Also, we burn the stack just once, right? Unless we change it.

    And, I am trying to get the LCD devpack working by using FEATURE_LCD. Although, it is filling up the Flash to 98% of capacity!! Any pointers to reduce the flash usage would be great!
  • Anup,

    Anup Rajput said:
    The BIM_ExtFlash did the trick! Where can I find documentation on the need for this project?

    It is described as part of the OAD guide included with the stack.

    What happens in your case is that the customer configuration structure placed at end of flash is only enabled in the BIM project since the BIM image is also put as this area. In the customer configuration structure there is a field (FLASH_IMAGE_VALID) which is checked by Boot ROM. If this checks fails the device goes into boot loader mode instead of executing the flash image.

    However when you use the debugger CCS/IAR will move the CPU program counter to the start vector so it appears to work.

    Anup Rajput said:
    Why is that? Shouldn't the stack be compiled first so that the boundary tool can adjust the space allocation on the FLASH? Also, we burn the stack just once, right?

    You are correct, the stack should be compiled first to let the boundary tool adjust the flash/RAM boundaries.