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/LAUNCHXL-CC1350: Register view: displayed incorrect PC value (-0x4)

Part Number: LAUNCHXL-CC1350
Other Parts Discussed in Thread: CC1350,

Tool/software: Code Composer Studio

I have:

1. LAUNCHXL-CC1350 (SoC CC1350)

2. CCS 7

I have got a simple example, which demonstrate displaying incorrect PC value.

1. Step 1 - stop right before executing "mov r6, pc". Displayed PC value is "0x292".

2. Step 2 - right after executing "mov r6, pc" value in R6 is "0x296" instead of "0x292"

I have an idea why it is happening: ARM use "pipeline" for execution. This is why PC store not current command, but 2 commands ahead.

But problem is that CCS display incorrect PC value. On "step 1" displayed value should be "0x296" instead of "0x292".

  • Hello Dmitry


    The behavior you see in CCS is expected. In Debug state, the PC reported in the Register window is the "debug view" and points to the address of the instruction that will be executed on exit from Debug state.

    Hope this helps.

    Thanks

    Ashwini Athalye

  • Thanks for answer.

    Yes, I thought that the reason is about debugging.

    It is a bit confusing if you do not know that there is such behavior. For example if there are some global variables in code.

    Man should keep that in mind if he watch disassembly code.

    Example: here is "ldr r0, [pc, #0x10]" code, but in "Memory Browser" will be wrong memory position.

    Thanks again :)