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/AM6548: debugging a simple program

Part Number: AM6548

Tool/software: Code Composer Studio

I am debugging through the XDS110 USB debug probe to the AM654x EVM.

I have been able to connect to the DMSC Cortex M3 (Running).

I have also been able to connect to the Cortex A53_0_0 (Running).

I have the simple Hello World program loaded.

I was expecting the debugger to go to the first line of code in main.c and stop there.

But, nothing is happening. I added an infinite loop in the program, but the debugger does not see it, does not stop.

What am I missing?

Thanks 

  • Hello John,

    unfortunately a lot of things could go wrong.

    With some more information about what you're trying to do I might be able to help you:

    The CCS sets a breakpoint at the main() address, but really execution starts way before that. The programs that you build with the processor SDK contain startup code that configures the processor, e.g. caches, MMU. This code can usually be executed only once, i.e. on a system that is mostly reset to defaults. If any of the assumptions of the startup code are not true, the system crashes in various kinds of ways. Sometimes you're at least able to halt the core, and see that it's stuck in some abort handler, but sometimes you're unable to halt the core (you should get error messages in the "Console" in that case).

    Regards,

    Dominic

  • Yes, I am using the SDK RTOS for the AM6548.

    I am trying to start with bare metal, no OS. (I have DIP switch 3 set to 0.)

    I am trying to run on the first A53 core.

    I am using the Basic CCS setup.

    Here is my program:

    int main(void)
    {
        int count = 0;
        printf("Hello World\n");
        while(1)
        {
            count++;
            if(count > 10000)
            {
                count = 0;
                printf("Hello again\n");
            }
        };
    }

    Yes, I am connecting from the debug window that lists all of the cores.

    I first connect to DMSC Cortex M3 and set it to running.

    Texas Instruments XDS110 USB Debug Probe/DMSC_Cortex_M3_0 (Running)

    Then I connect to Cortex A53_0_0 and set it to running. 

    Texas Instruments XDS110 USB Debug Probe/CortexA53_0_0 (Running(Secure))

    I put a break point inside the while(1) loop.

    The next thing I tried was to load the program from the Run menu

    C:/CCS Workspace\hello_world_test\Debug\hello_world_test.out

    There is a window (0x200) that reads "Break at address "0x200" with no debug information available, or outside of program code."

    But, no messages on the console.

  • How did you create this hello world program, did you follow the steps from the RTOS guide (e.g. )? Is there an XDC/RTSC config file, and is the platform, target and compiler (note the aarch64) in the CCS project settings configured correctly?

    If you want you can attach the .out file and I'll have a look tomorrow.

    I've seen this "Running (secure)" myself, and in that case I've been unable to debug code on the A53.  In my case this happens only when I power-cycle the board while the processor is halted via the debugger, so this might be something else.

    I haven't used the "Basic Setup" for quite some time, but I can give it a try tomorrow in the office.

    You should see debug output in the console view (maybe you need to check different console subviews - there's a dropdown button somewhere for this) when you connect via the basic setup - are there any errors/warnings shown?

    Regards,

    Dominic

  • Hi,

    John Hoffman said:

    Then I connect to Cortex A53_0_0 and set it to running

    If you are following the exact sequence of events you posted, the step highlighed above is a problem. You can't set the processor to run and then set breakpoints, load code, etc. 

    The procedure sent by Dominic is sound and I was just able to run it to completion in my setup (both CCSv9.3 and 10.0).

    Hope this helps,

    Rafael

  • I started from section 9.9 instead of section 9.1.

    I have restarted now from section 9.1 and have been able to get a little further.

    I am able to load the project and step through the code (a little bit).

    But, I am not getting anything on the serial terminal.

    When using the UART connection, there are 4 ports that are created. Is it always the first one listed that is used?

  • It appears as though the program goes into Board_init(boardCfg) and never returns.

  • Hi,

    John Hoffman said:
    But, I am not getting anything on the serial terminal.

    I am a bit confused. The Hello world project above does not send anything through UART port. Perhaps another project?

    John Hoffman said:
    When using the UART connection, there are 4 ports that are created. Is it always the first one listed that is used?

    The COM port selection would be heavily dependent on the project itself. Just keep in mind the built in XDS110 Debug Probe also has an additional UART port. 

    I am building the projects of the SDK to see if there is a pre-canned UART project and will report back to this thread. 

    Regards,

    Rafael 

  • I am now stepping through the initialization part of the source code from the 9.1.4 Lab in the TI SDK RTOS How to Guide.

    In the am65xx_evm.c source file, there is function called :

    Board_STATUS Board_init(Board_initCfg cfg)

    Inside this file, there is a call to :

    ret = Board_moduleClockInit();

    This is located in board_clock.c

    This then goes into the following for loop and never returns:

    for(index = 0; index < loopCount; index++)

    {

    status = Board_moduleClockEnable(gBoardClkModuleID[index]);

    if(status != BOARD_SOK)

    {

    return BOARD_INIT_CLOCK_FAIL;

    }

    }

    Any thoughts on what is causing this to hang up?

  • Hi,

    Sorry, I didn't see your last reply. I was finally able to rebuild the SDK (I have it installed in a non-default directory and had a few issues).

    I could verify the <uart_diagExample_am65xx_idk_armv8.out> correctly outputs data through the first UART port of the J42 UART connector (the one that instantiates four UART ports). 

    I will try to get the specific project you mentioned to work, but my guess is that there is a bad initialization of some sort or perhaps some incompatibility between the SDK and the board. I will have to get back tomorrow after I go through the training. 

    Regards,

    Rafael

    (edit) sorry, I hit the Thinks Resolved button by accident. 

  • Hi,

    I was finally able to get around to run the template code, but it fails to me at the same function - the Call Stack ends at the Sciclient_waitThread() function, but I am unsure what may be going on in this case. Unfortunately the code at this point seems to be heavily optimized and the single step debugging moves quite erratically. 

    If you want to take a look at the code at this point, my project halts at the point shown below inside the file sciclient.c located at:

    C:\ti\ti-processor-sdk-rtos-am65xx-evm-06.01.00.08\pdk_am65xx_1_0_6\packages\ti\drv\sciclient\src

    I will notify the device experts as they may have a better idea on what is going on. 

    Regards,

    Rafael

  • Yes, you have gotten to the same point that I have.

    The debugger does not help in this case.

  • Yes, that was loaded the first time I attempted to connect to the DMSC.

  • Brad,

    Thanks for the heads up. I looked at the javascript and did the steps manually, just to be sure I fully understood the process. It worked for me as it can be seen on the short clip below:

    Hope this helps,

    Rafael

  • Rafael -- that's great!  Thanks for recording the video.

    John -- are you able to replicate what Rafael did?  We can work on optimizing the flow once you have it working.

  • John -- can you please update on your current status?  Were you able to reproduce what Rafael did?

  • Rafael,

    Thanks for the video.

    I am out of the office until Thursday, but I still may be able try the sequence from the video before then.

    Thanks

    John