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.

Trouble Debugging locked code



After unlocking secured  code 'Release Code" we can Run the code but not single step.
SINGLE STEP IS NOT AVAILABLE (greyed out)

For comparison we loaded "Debug code" (no security)
We can Run and single step. However,If we program the Same security codes in this version we loose single step control also.
Is this a limitation when security codes are programmed?

  • Richard,

    What device are you using? When you say Single step is not available. Is the option in drop down menu (Target) greyed out or are the disassembly and memory windows greyed out? If possible can you provide a screenshot

  • I used On-Chip Flash Programmer to program with protected code.

    On-Chip Flash Programmer indicates that the device is not locked (unlock is grayed out).

    At this time, the 3 icons for Source-Single Step, Source-Step Over, and Step Out were not grayed out.

    After doing a run and stop, the 3 icons are grayed out.

    When the stop is done, the curser does point into the source file, which indicates that the symbols are loaded OK.

    I tried loading symbols anyway, didn't make any difference.

    I also tried closing the On-Chip Flash Programmer window.

     No Single Step

  • Richard,

    This is an expected behavior when you lock the device. This security feature prevents unauthorized users from examining the memory contents single stepping through the code. Infact with the JTAG connected, when you try to single step through the code in secured memory, Emulation Code Security Logic (ECSL) will break / trip the JTAG connection to the device.

    For more information, Please refer Security section in the device datasheet.

    Code Security Module FAQ for C2000

    Regards,

    Manoj

  • Manoj

     

    I'm a little confused by your response. We loaded locked code but unlocked the code using the keys.  At this point we can run but not single step.  What is the purpose of unlocking the code if not to debug or examine intermediate results. We were expecting that single step operations would be supported after unlocking.  If I understand your response single step is not supported on locked code that has been unlocked with the appropriate keys.

     

    -R

     

  • Richard,

    Yes, you can single step through the code in an unlocked device and will be able to examine the intermediate results.

    Source-Single Step, Source-Step Over, and Step Out icons will be disabled until you enter a function. Lets say when you are in _c_int00 you will see the source-single step, source-step over and step out icons disabled. But as soon as you hit main() function all these icons will be enabled.

    If you want to single step through the code in _c_int00, you can use F11 (Step into), F10 (Step over).

    Hope this clarifies your question.

    Regards,

    Manoj