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.

CODECOMPOSER: Loading program and symbols from different files

Part Number: CODECOMPOSER

Tool/software:

Hello,

CCS 20.0.1.

How would I set up CCS debugger to load program and symbols from different files?

Let's say I have HEX record formed from executable with signatures etc. through custom post-build actions and ELF OUT file with symbols but without all additional data. I would like to be able to program HEX record into target Flash memory and only load symbols from OUT file. How this could be done in CCS?

Regards,

Eugene

  • How would I set up CCS debugger to load program and symbols from different files?

    This is not supported via just a launch configuration.

    You can have the launch reference the hex file to load and then use an initialization script to load the symbols or other related actions.

  • Hi Ki,

    Thank you for suggestion. Do you happened to have an example of the initialization script for this option?

    On the other hand, it might be worth to consider enhancement to launch configuration for this split load. It is quite common option in other debuggers.

    Regards,

    Eugene

  • Do you happened to have an example of the initialization script for this option?

    I spent some time trying to figure out the best option and in doing so, I uncovered some issues along the way that I hope future CCS releases will fix. In the mean time I was able to work around the issues.

    What worked best right now is to have your project-less launch configuration simply reference the initialization script and then have your script do the rest (load the hex and symbols).

    So for the launch config, it can look like:

            {
                "name": "f280049c.ccxml",
                "type": "ccs-debug",
                "request": "launch",
                "targetConfig": "/d:/SCRATCH/targetConfigs/f280049c.ccxml",
                "initializationScript": "C:/Users/user/workspace_ccstheia2/gpio_ex2_toggle/init.js"
            }

    and then init script:

    ds = initScripting();
    
    session = ds.openSession("Texas Instruments XDS110 USB Debug Probe/C28xx_CPU1");
    session.target.connect();
     
    // A bug causes memory.loadProgram() to get blocked when loading hex files. Hence using GEL_Load() as workaround 
    //session.memory.loadProgram("C:/Users/user/workspace_ccstheia2/gpio_ex2_toggle/CPU1_RAM/gpio_ex2_toggle.hex");
    session.expressions.evaluate('GEL_Load("C:/Users/user/workspace_ccstheia2/gpio_ex2_toggle/CPU1_RAM/gpio_ex2_toggle.hex")');
    session.expressions.evaluate('GEL_SymbolLoad("C:/Users/user/workspace_ccstheia2/gpio_ex2_toggle/CPU1_RAM/gpio_ex2_toggle.out")');
    
    // initialization scripts will not return unless the debug server instance for it is shutdown. CCS should remove this dependency inthe future.
    ds.shutdown();

    This will launch a debug session for the launch config and call the init.js script to connect to the target, load the hex and then load the symbols.