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.

How to trace (step through) code in c28x boot ROM?

Expert 1960 points
Other Parts Discussed in Thread: CONTROLSUITE

Hi there,

I often got situation where code stopped somewhere in boot ROM, with error message like "No source available for "ox3ff16a". It'd be great if I can trace into the boot ROM. I've found the source code of boot ROM in the latest ControlSuite, imported & rebuilt the project, loaded the symbols. But it seems that the source code does not match the actual the binary in boot ROM since it often runs in comments lines. Where can I find the exact .out files or symbols files which matches the actual boot ROM? I'm using F28377D controlCard (Rev B) and the latest control Suite (v170). I used the source code in the following folder:

C:\ti\controlSUITE\libs\utilities\boot_rom\F2837x_revb\revb_rom_symbol_libs\c1rom_BootROMSymbols

There are two .lib files in those folder but I'm not sure if I can use them directly, i.e. without rebuilding from the source code project. PLease advise. Thanks!

  • Hi Shef,
    One issue could be that the code you are trying to debug has been optimized to some degree. Optimization can negatively impact source level debug visibility (the higher the optimization, the worse it is).

    As for those libs you mentioned, I'm not sure how they were built. if they were built with full debug symbols, and is related to the code in the boot ROM, you can try loading the symbols from them.

    Hope this helps
    ki
  • Hi Ki,
    II tried to load .lib files from "Run->Add Symbols..." in CCS, it gave me an error message saying that "Add Symbols Failed":

    Add Symbols Failed
    Encountered a problem loading file:
    ".lib" is not a legal file extension.

    Any other suggestions? Since TI provides the source code for boot ROM and also symbols files for each MCU, I'd assume that someone has tested them before release. I'd appreciate it if you or someone else out of there can provide some further info. Thanks!
  • Hi Ki,

    One related question: how do I debug a running target? For example, I have an application code running from flash. During run-time, I'd like connect JTAG debugger to the MCU, load the symbols, and see where it stopped or paused in the code. But I could not get it to work. When I connect the JTAG while MCU is running (as shown in oscope), CCS always stops the code and shows "No source available for 0x3f16a". After I load the symbols (but not the program itself since it's already in the flash), it does not show the actual source where it stopped. I'd have to reset MCU and restar from main() to get it running again. How do I see where it stopped without restarting the code from beginning? Thanks!
  • Shef said:
    II tried to load .lib files from "Run->Add Symbols..." in CCS, it gave me an error message saying that "Add Symbols Failed":


    ahhh... right... yes you need the symbols from the program image (which would also have the symbols from the lib), not the lib itself.

    Shef said:
    ince TI provides the source code for boot ROM and also symbols files for each MCU, I'd assume that someone has tested them before release. I'd appreciate it if you or someone else out of there can provide some further info.

    I'd suggest asking the gurus in the C2000 forums. They would know best about ControlSUITE

  • Shef - I believe you are asking how to connect to a running target for debug, right? Debugging a running target would mean that you don't wish to halt the target (real-time mode debug) but sounds like you are ok with halting the target. If so, one thing to keep in mind is what your startup GEL file is doing. A common "gotcha" is when the startup GEL file will do some target initialization on connect and blow away the initialization already done by the bootloader and put the target in a bad state. (which you fix with a reset). Try removing the startup GEL file if you have one.

  • Shef said:
    For example, I have an application code running from flash. During run-time, I'd like connect JTAG debugger to the MCU, load the symbols, and see where it stopped or paused in the code.

    In addition to Ki's suggestions, please take a look at this quicktip video, it should be helpful.

  • Hi Ki,
    I'm not familiar with GEL file. I created a target configuration file (.ccxml) for my emulator blackhawk 560v2 USB. THis is how I used CCS to debug: I tested it with "Test Connection" button and see it passes tests successfully. Then I "launch selected configuration", connect to target and then load program (or load symbols only for run-time debugging). It work fine within CCS. But if try to debug while the app is running, I'm NOT able to get to the source code.
    After I watched the video posted by AartiG below, I tried to change Debug Configuration by selecting 1) Load symbos only; 2) Enable realtime mode; After that, I got error message "Power failure on Target CPU" when I tried to debug the target, even the power is perfectly fine. I had to restore the "debug config settings" in order to use the emulator again. Any idea why?
  • Hi AartiG,
    Thanks for the link to the video. It's great to have a visual look on the steps. However, as I explained above, I could not get it to work for my F28377D control Card, even with simple flash example. After I selected "Realtime mode", I always get an error message complaining about "Power failuer on Target CPU". Has any one tried this on F28337D MCU? It's a newer C28x processor, so I thought that it shoud work better. DO you have any suggestions on how to troubleshoot this further? Thanks!
  • Shef said:
    After I selected "Realtime mode", I always get an error message complaining about "Power failuer on Target CPU". Has any one tried this on F28337D MCU?

    I just tried it on a F28337D control card and did not get the power failure message.

    I used the example timed_led_blink from ControlSuite, set it to use the CPU1_FLASH build configuration, and loaded it to CPU1. Then I power-cycled the board to allow the program to start running from Flash. Then I followed the steps in the video to modify the settings in the debug configuration and connect to the running code, and did not receive any errors.

  • Hi AartiG,

    Thank you so much for trying it out, which gives me more confidence to continue. However, I tried the same example from the latest controlSuite (v170), but still could not get it work. I set CPU1_FLASH active, build and loaded it into CPU1.  I saw LED3 (GPIO34) flashes rapidly even after power cycle the board. Then I followed the steps in the video carefully to modify the debug settings which involves two changes ( load symbols only & set to real time mode). But when I started the debugger again, it gave me error (see screenshot #1). This is for Blackhawk 560V2 emulator.

    Then I tried to use the on-board XDS100v2 emulator with the same steps. It also gave me error but a different one. It reported error connecting to the target at C28xx_CPU2, even I specifically connect it to CPU1. See screenshot #2.

    I also tried 3rd emulator Spectrum Digital XDS220 ISO, which gave me the same error as XDS100V2 about CPU2. For all 3 emulators, if I unselected real-time mode, everything would work fine, except that it will load and debug from beginning, instead of while it is running.

    What emulator did you use? How did you set emulator when you started a new project? I set it in Project Properties -> General -> Connetion, and select from the list. I also tried to create "Target Configuration" with an user-defined config to product a .ccxml file. It works well for regular debugging but not for run-time target as shown in the video. Please advise what and where I got it wrong. Thanks for your continued support!

  • I used the onboard XDS100v2 emulator. Did you make sure to select only CPU1 when prompted for which CPU to load the code into? The error in your screenshot seems to indicate it is trying to connect to CPU2 as well.

    This is the sequence of steps I followed, please give these a try:

    - Go into menu Run->Debug Configurations and delete the debug configuration for your project. 
    - Set your project to use the target configuration file with the XDS100v2 debug probe
    - Select the project in the Project Explorer view and click the Green bug button
    - Since it is the first time starting up this debug configuration, CCS will prompt you to select the CPU to load the program into
    - De-select CPU2 so the code is loaded only to CPU1

    - Click OK. After code is loaded, run to verify that it is working and LED blinking as expected
    - Halt the code, terminate the debug session, power cycle the board (LED should be blinking after power cycle)
    - Go into Run->Debug Configurations, select the debug configuration for your project and set "load symbols only" and "enable real-time mode"
    - Click Apply and Debug.

  • Oh, I also just noticed that you are using emulation pack version 5.1.641.0 (as noted in the error message). Which version of CCS are you using? If you are using CCSv5 I would suggest updating to the latest CCSv6.1.1, or at a minimum updating your emulation pack. If you wish to just update the emulation pack, you can do so by going to Help->Check for Updates.

    FYI, the version of emulation pack I am using is 6.0.14.5 with CCS 6.1.1. 

  • Hi AartiG,

    Thank you so much for the detailed steps. Yes I got the XDS100v2 working now for deleting the existing debug configuration file and start a new one. However when I follow the same procedure step by step for the Blackhawk XDS560v2 (my main emulator), it still gives me "Power Failure on Target CPU", as shown below. It actually loaded the code into flash and the code runs fine, so I assume that my XDS560v2 emulator is ok. I have latest CCS 6.1.1, and I'll update emulator to the latest to see if it will makes a difference. In the meantime please let me know if you have any other suggestions to troubleshooting XDS560.

  • Hi AartiG,

    Just want to let you know that I updated the emulation package to the latest. Now my 560v2 emulator also works. Thanks so much for your help. I almost gave up until your post. I'll label this thread as answered for now. Hope to see you again later in this forum!

  • Glad to hear things are working well! Good luck!