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.

CCS/CC2640R2F: Why the CCS shows the variables in the debug are wrong?

Part Number: CC2640R2F

Tool/software: Code Composer Studio

Hi everybody, when i use the ble scanner to send to data whit 0x01 to open the led of the CC2640R2 project zero, but i get the debug variables are wrong , please see the picture shows below,

  • Hi,

    I don't necessarily know the code you are using in deep detail, but one thing that sometimes happens when you are debugging C source code is that the values may be assigned to the variables immediately before they are used. In practice, a single step in the C source code can execute several assembly instructions, while stepping on the Disassembly view will evidence where the values are properly set - this usually happens more often in optimized code.

    You can double-check this by looking at the registers view - this variable is allocated to Register R4.

    Under certain circumstances the compiler may also detect this value never changes across the code - in this case it simply sets the value "1" as the parameter itself immediately before calling the function - something detectable in the disassembly view as well.

    Obviously that assumes the Variables view does not have a specific bug. If you do not see the scenarios mentioned above, then perhaps we would need to get your code and try to reproduce this here.

    Hope this helps,
    Rafael