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.

Hardware breakpoints not working for u-boot source code

Good afternoon,

I'm trying to follow the CCSv6 guide to u-boot JTAG debug found here

http://processors.wiki.ti.com/index.php/Sitara_Linux_Training:_uboot_linux_debug_with_ccsv5

I'm able to load program and symbols, run the code, and step through the code line by line, but I'm unable to set any hardware breakpoints. Oddly, it shows the the hardware breakpoints are set in the board.c file (see image), but the program doesn't stop when encountering these lines. Also, right-clicking and selecting 'Breakpoint Properties', it says "Breakpoint is not attached to an active debug context. Please launch the debug session where this breakpoint is attached."

I'm using the latest version of CCS v6.2.0.0005 with the XDS100v2 JTAG debugger. Please let me know if anyone has found similar problems with the hardware breakpoints.

Best regards,

Chris

  • Hi Chris,
    How are you setting the breakpoints? Double clicking in the editor margin? And how did you open board.c in the editor? Can you also try setting the breakpoints via the disassembly view or breakpoints view at the corresponding addresses?

    Thanks
    ki
  • Hi Ki,

    Thanks for following up. I was right-clicking the editor margin in my board.c file and selecting Hardware Breakpoint. I opened board.c in the editor by adding a C/C++ Makefile project, as discussed in the online tutorial. I was able to set breakpoints in the disassembly view and also by selecting the blue 'Add Breakpoint' button in the Breakpoints View.

    Update - The problem came from CCS not properly referencing the board.c file. I found this by setting a Hardware Breakpoint in board.c by clicking the blue 'Add Breakpoint' button in the Breakpoints View and selecting the function s_init(). Once it hit the breakpoint, CCS indicated to me that it could not find board.c file. I then pointed CCS to the correct directory and I'm now able to step through the source code as expected. CCS must have not properly referenced the board.c in my Project Explorer when I imported as a Makefile project.

    This bug is officially squashed. Now I'm focusing on the DDR memory configuration which I discuss in my other post.

    e2e.ti.com/.../545777

    Thanks again for your support!

    Best regards,
    Chris
  • Chris Lightcap said:
    CCS must have not properly referenced the board.c in my Project Explorer when I imported as a Makefile project.

    That is exactly it. When you set breakpoints from a source file, you need to make sure that the debugger has made a correlation with the source file and the loaded symbols. You can always set debug source search paths ahead of time. Though what you did by browsing to the file when prompted by the debugger is the best technique. Once you set it once that way, the debugger will remember for subsequent debug launches (unless the launch cache is cleared).


    Thanks

    ki