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: CCS 7.4.0.00015 Unable to set breakpoints

Part Number: CC2640R2F

Tool/software: Code Composer Studio

Hi,

I've just switched to CCS desktop from CCS Cloud due to the issues I was having there but I'm now getting a very similar problem with the desktop version. Referring to the screenshot below, I am unable to set any of the breakpoints shown on lines 581, 583 and 585. If I click on the breakpoint in the Breakpoints view, its tells me that there is no assembly code associated with that breakpoint. If I search for this point in the Disassembly view, the routine 'SimpleBLEPeripheral_ws_init' is not listed. Also, many other functions are not listed including the main application initialisation routine 'SimpleBLE_Peripheral_init'

Note, however, that this code is getting executed. It correctly toggles DIO_24 as expected.

Any suggestions?

Regards,

AC

  • AC,

    I don't find these symbols either in the linker .map file of the same example project, but a quick look at the source file shows the function itself is "static", which has a limited scope and therefore it is not global.

    However, I am still investigating why the debugger is not correlating the source code with the debugger - it may be a bug or by design.

    (edit) I am able to set a breakpoint on the function, which is called from the SimpleBLEPeripheral_taskFxn (check below). 

    In this case, it may be an issue on macOS. I will report back my findings. 

    Regards,
    Rafael

  • Hi Rafael,

    Many thanks for your responses. Some further information:

    1. I added two more code lines this morning on lines 577 & 578 as below and was able to set a breakpoint on line 578.  Stepping through from that point, however, was problematic: I could step over the code lines at 582, 583 and 584 but not over lines 588 through 591. The curious thing is that you can see those lines in the Disassembly view but there are no source code line numbers associated with them. Then, the assembly code generated from source code lines 593 & 594 can be also be seen in the Disassembky view but the Disassembly view is showing source code line numbers of 638 and 750 which is completely wrong. Hence, I cannot set breakpoints on those line numbers...

    2. In regard to your comment about functions being declared "static," the screenshot below shows the function drop-down in the Disassembly view. The left-hand panel shows a whole bunch of function declarations that occur at the top of the simpleBLE_peripheral.c file - all are static but only a few of them appear in the Disassembly drop down. So it cannot be an issue with static declarations.

    Kind regards,

    ac

  • AC,

    It seems there is something specific to how macOS is decoding these static functions and translating them to the Disassembly view - the breakpoint and the function names on macOS do not show in the Disassembly view - below is a screenshot at around the same place as in my Windows screenshot. That is a bug.

    However, the breakpoint itself is working - that is what I couldn't reproduce from your scenario.

    The breakpoint itself is set to the correct address: 0x5C

    And it halts there when I run it. 

    Therefore I am not entirely sure how your modified code is being treated by CCS. I can't find the same function you mentioned (SimpleBLEPeripheral_ws_init). If that is a custom function you created and you defined it as "static", can you remove the static modifier and rebuild the code? Perhaps with a global symbol you can have additional insights on its normal execution as the function becomes truly global. Also, you can try to disable optimizations for this particular source file - simply right-click on it and set the optimization level to "off". This should help you verify the influence the optimizer is causing to this particular section of the code.  

    I will try to think about additional details that may help, but the article below will also give additional insights about this:

    http://processors.wiki.ti.com/index.php/Debug_versus_Optimization_Tradeoff 

    Hope this helps,

    Rafael

  • AC,

    In my previous work I was using a .out file generated from a Windows host, as the CC2460R2F SDK does not officially support macOS.

    However, today I followed the procedure at the end of this post to be able to build the project directly on the macOS host. In this experiment, I was able to find the same results as with the Windows host - i.e., the source code of static functions are correctly displayed by the Disassembly view.

    In your case, I would strongly suggest you to see if you can either use a different workspace or test the tips I have sent before.

    Hope this helps,

    Rafael

    == Procedure to build the CC2640R2 DSK on macOS ==

    Install all dependencies:
    - Open a terminal
    - Issue the command which python. By default it should return /usr/bin/python
    - Issue the command python --version. It must be 2.7.3 or newer
    - Issue the command sudo pip2 install lxml
    Beware that proxy settings may cause this update to fail.
    This is a necessary requirement to run the python scripts of the package

    Install the SDK and import the project:
    - Follow the directions on the thread below to download and install the SDK and to modify the python scripts
    e2e.ti.com/.../2228206
    - One additional detail missing from the thread above is to set the execute permissions of the lib_search.py
    - From a terminal, go to the directory mentioned in the thread above and issue the following command: chmod a+x lib_search.py

  • Rafael,

    Thank you for your response.

    >> - Issue the command sudo pip2 install lxml <-- I don't recall issuing this command when I installed python etc. So I ran it again and it has fixed the problem.

    With optimisation on, sometimes code get moved around and I cannot set a breakpoint on a code line that the optimiser moves but I can control that by turning the optimisation level down or disabling it entirely.

    Thank you for your assistance.

    Regards,
    AC