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.

xds110 debugger repeat invocation issue with code composer studio

Other Parts Discussed in Thread: CC2650, SYSBIOS

Running code composer studio with xds-110 debugger with jtag interface to custom board with cc2650.

Implemented SimpleBLEPeripheral

Modified code task code called from main.c with the following

Task_construct(&taskStructSaluMainTask, taskSaluMainTask, &params, NULL);

The following code runs in a while loop
while(1){
initialize some variables
while(!done){
 some code here
if (sensorValue > x)
{
beatCounter++;
done=true;
}
  
other code here
}

         if (beatCounter>10){

          printf("beats %d",beatCounter);

        }

}

I

The debugger stops on the ++ operation 3 times without updating it. Im watching it in the step by step debugger. I step over it and its value does not change 2 times, then canges the third time.

There is another area of my code where I reference beatCounter

if (beatCounter>10)

{

  print ("some value")l

  beatCounter = 10;

}

When I put a break point on the conditional, it takes 3 continues for the debugger to report a new value.

It seems like there are three threads running at the same time. But I did not start any threads? 

I noticed though that the initial task creation ran three times. Even though main is only called once.

What gives?

  • Hi,

    Unfortunately I am not very familiar with the BLE stack software details or how it works, but from your description of the apparent bizarre behavior of the code (and without the code itself) I suspect that optimization is turned on. If so, check the page below for some additional details and considerations:

    processors.wiki.ti.com/.../Debug_versus_Optimization_Tradeoff

    Regarding the thread creation, perhaps they are created statically by the .cfg file and not by the API Task_construct? That stems from my knowledge about SYSBIOS (nowadays called TI-RTOS) which can have both types of tasks. In this case, I would double-check the .cfg file of the project and see if there are tasks defined.

    I will try to think about other scenarios that could be causing the behaviour you are seeing and will report back on this thread. In the meantime, perhaps you could also try to post this in the device forum, as the experts there would have a better understanding of the project itself.

    Hope this helps,
    Rafael