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/DRA750: Stepping through u-boot after relocation

Part Number: DRA750

Tool/software: Code Composer Studio

Hi,

I am trying to debug U-boot through CCS after it relocates from the initial load address. I am following the instructions shown in the below wiki link.

I am able to determine the relocation offset and load symbol with the specified data offset and code offset. However the assembly to source mapping seems to be missing after relocation. I am not able source step after relocation. Can you please look into the issue? Please let me know if you need more information.

I am using CCS 7.3 on a J6 Eco Device. The ARM core used is Cortex A15. I have attached a screenshot showing the issue. The left window shows the code corresponding to the assembly on the right hand. But the mapping does not work. I have aligned the windows manually to show the correspondence.

regards,

Venkat

  • Hi Venkat,
    You are correct, there is some issue with proper correlation between the source file and the debugger. I assume the relocation information is correct and the symbols properly loaded. Regarding the source file in the left, how was that source file opened in the editor? Did you manually open it on your own or did the debugger automatically find it or did the debugger prompt you for the location and allowed you to browse for it? If it is the latter two, then I would expect the correlation to be correct. If it is the former, then it is likely that it is not.

    Thanks
    ki
  • Hi Ki,

    I opened the file manually.

    To verify whether the code/data offset are correct, I added a call to an infinite loop function. The debugger did not find the source file after loading the symbols. I visually verified that the assembly instructions for the infinite loop function were relocated to the expected code/data offset.

    Can you please investigate why the source and assembly correlation is incorrect?

    Thanks and regards,
    Venkat
  • There are several potential reasons why there are issues with correlation.

    The most common one is when you load executable/symbols without a CCS project (which I assume is the case since you are using A15) and the source files used to build the symbols/executable are now in a different location than when it was built. This is common for environments when the build occurred on one machine but debugging is occurring on another machine. The debugger uses the information in the debug symbols to find source files. The symbols have relative and absolute path to the source files based on the location at the time of compilation. If the source files are not in those locations, then the debugger is unable to find it and will not make any source correlation. It does not matter if you manually opened the source file (unprompted) in the editor, the debugger will not make that correlation.

    Please see slides 53-58 of the below presentation on how to do the above and for more details on how the debugger finds source files during a project-less debug session:

    http://software-dl.ti.com/ccs/esd/training/CCSv6-TipsAndTricks.pptx

    This can help you in your investigations

    Thanks

    ki

  • Hi Ki,

    I found the issue in the way I was setting the "offset" while loading the symbols. The below wiki page helped.

    processors.wiki.ti.com/.../Sitara_Linux_Training:_uboot_linux_debug_with_ccsv5

    I was using the patch at

    review.omapzoom.org/

    to determine the offset to use when loading the u-boot symbols. Below is the u-boot console prints from this patch.

    Relocation Offset is: 3f73a000
    Relocating to bff3a000, new gd at bef19eb8, sp at bef071d0

    I made the mistake of entering the "relocation offset" value from above instead of the "relocating to" value. I am able to single step when I use the "Relocating to" value for the code/data offset when loading the u-boot symbols.

    Thanks for your help.

    Regards,
    Venkat
  • Thanks for the update and glad to hear you found the cause of your issue.

    thanks
    ki