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.

[FAQ] AM2612-Q1: How to debug XIP application using CCS Theia

Part Number: AM2612-Q1

Hi Experts,

Please share the steps to debug XIP applications using CCS Theia.

  • For this exercise we are using AM261x Launchpad. However the steps would be the same for all AM263P and AM261 Parts


    Please see an outline of the steps below

    1. Preparing the application

    2. Modifying target configuration

    3. Flash the application and booting the same

    4. Debugging the Application

     


    Please follow the below steps to debug XIP application using CCS Theia.

    A. Preparing the Application

    1. As an example to debug XIP we will use the following example,

    Example Path: examples\hello_world_xip_fss1

    Load the example in CCS theia and build the example.

    2. Before building the example, we need to change the flash window address range in devconfig.mak file. This example used the second flash window from 0x8000 0000 to 0x8800 0000, so we can change this MCEL_XIP_FLASH_RANGE value. If your application uses the flash range from 0x6000 0000. Then this is not required. This flash range belongs to the first flash window.

    When developing XIP applications, the linker needs to aligned to how it is mentioned in the SDK docs.

    3. Put a while loop after the inside the main function.

    We debug XIP applications in OSPI boot mode. So in OSPI boot mode, once the application is flashed and booted, it will run. So we need to stop it at main function. For this we are adding this while(1) loop.


    B. Modifying target configuration

    4. Regular target configurations cannot be used for XIP debugging. Target configuration requires some changes. Create a new target configuration with a new name. Here I have created a target configuration called AM261_XIP.ccxml. To create new target configuration, click the ‘+’ icon in target configuration section of debug window.

    5. Select the device as AM261x

    6. Gel scripts are not required, so remove the gel scripts. Initialization script field should be blank to remove the gel scripts.

    7. Now launch the target configuration in project less debug mode.

    8. Right Click on the core and select properties and go to Debug.

    9. Inside the debug window with category as Program/Memory Load Options, disable the following options

    a. Enable CIO function use (requires setting a breakpoint)

    b. Enable Semihosting breakpoint (requires setting a breakpoint at SVC_Handler)

    10. Now change category to ‘Debugger Options’ and disable ‘Allow Software breakpoints to be used’.


    C. Flashing and Booting the application

    11. Now flash both the example application and SBL.

    SBL flashed at offset: 0x0

    Application flashed at offset: 0x81000

    These are the default flash offsets. The default pre built SBL can be used. If debugging custom board, then align the flash and ospi configurations, pin muxing as required.

    Once flashed boot the example.


    D. Debugging the Application

    12. After booting the example, connect to the core,

    Once connected, load the symbols. Symbols refer to the ,out file. This option is in Run > Load > Load Symbols…

    Locate the .out file and load the symbol.

    13. Once loaded, we can see that the execution is stuck at the while loop inside main. The loop control variable is visible in variables window. Modify this to debug forward.

    14. Modify the loop control variable and debug forward.

    We can see the output in the UART terminal.