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.

C5515 Debugging from Flash



Hi,

I'm using the C5515 which executes code out of external flash when deployed in the field.

I would like to be able to debug the project while it is executing from flash.

I would need to be able to look at the values of variables, pause, run, and step the microcontroller (I'm thinking breakpoints are out of the question). 

I have looked around but there doesn't seem to be much information on that subject with the C5515.

Is debugging with the C5515 when it is executing out of flash even feasible with CCS v6.1 via JTAG?

I'm guessing even if it is even feasible, it will take some work to get it operational.

Right now if I need to debug code I have load the code module in question into RAM and execute just a subset of the overall project.

I'm getting to the point where I will need the entire project present when debugging and it is too big to fit into RAM.

Thanks!

  • Hello Benjamin

    You can connect to the device with JTAG after it has started executing the application.

    In this case, you will need to remove the GEL file from the target configuration to prevent it from altering the state of the device while running the program.
    - open target configuration in CCS, select advanced tab at bottom, click on C55xx, then delete the file path from initialization script field, and Save.

    Once connected, the program will halt wherever it happens to be, and you can read variables or memory and View --> Disassembly to see the assembly code, step through it, set breakpoints, etc.

    For additional debugging at the C-level, load just the symbols of the .out file that is running from Flash (Run --> Load --> Load Symbols, choose .out file) - this will let you see where in the C code the program is, then you can also set breakpoints at certain lines just like you normally use CCS). CCS may ask you to point it to the c file that is currently executing (just browse to your project source directory).

    Since your program is executing from Flash, it should have already configured the EMIF for Flash access.But if you need to reinit flash or run any other helper function, you can use a GEL file to call functions from the Scripts drop down menu. Just make sure OnTargetConnect() function is empty to avoid it wiping out the program state when connecting, then write your helper function with a "hotmenu function () { } syntax".

    Hope this helps,
    Mark

  • Wow, Thanks Mark!

    This seems a lot more promising than I had originally anticipated.

    I'll try out the steps you have outlined and post my findings.

    Thanks a lot!

    Ben

  • Worked like a charm!
    I ended up launching a debug session but only loading the symbols and it worked just as you said it would.
    This is going to be a huge time saver for me.
    Thanks a lot!