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 debugger restart doesn't go back to main()

Hi,

I'm using the AM243x EVM.

I'm running the hello world example from the SDK_AM243x.

I can do a single step and put breakpoints but I cannot reset the program from the debugger.

When I press restart icon I see on the disassembly that the program counter points to address 0 instead of pointing to main().

How do I config the restart to go back to main() ?

Thanks,

Eli

 

  • Hi Eli,

    Depending on the device and application, sometimes a restart will not work as intended. If you do a system reset then try a restart, does that help?

    Thanks

    ki

  • Hi Ki,

    I'm debugging a program step by step <F6> then I'd like to use the restart icon on the CCS menu and start from the main()

    instead the program counter goes to 0.

    Is there a way to configure it to go to main() ?

    Thanks,

    Eli

  • Is there a way to configure it to go to main() ?

    a CCS Restart will set the program counter to the entry point of the application (usually _c_int00 for TI compiled executable). There is a debugger option to autorun to main on CCS restart. This is ON by default. Hence restart should set the application halted at main. If you are not able to get back to main, then there is likely an issue with the target state when the restart occurs, preventing the application from reaching main again. Try disabling the autorun on program restart option and see if you get to the entry point. Then see if you can run to main. If it fails to reach main, then it is a application and target issue, not a debugger issue.

  • Hi Ki,

    When I unchecked the "Connect to target on debugger startup

    and  checked the "Continue debug launch if target conn...."  -   the debugger stopped working !

    So I restored the default.

    Now the debugger works (<F6> , <F5> and BP) but still the restart doesn't go to main().

    Maybe there's  some more configurations has to be done for that ? Maybe a script or GEL ?

    I'm using the simple "Hello World" SDK_243x example so there's nothing special in the program.

    Please advice.

    Thanks,

    Eli

  • When I unchecked the "Connect to target on debugger startup

    The option you want to disable is  "On a program load a restart" option. This will disable autorun to main.

    I tried the same example with the option disabled. After running successfully, a restart will set the program counter to the entry point. Then when i run from there, it never reaches main but instead gets stuck below:

    A system reset and reconnect/reload will resolve the issue. But why do I have to do this? I can't answer that as this is an issue specific to the application and target. It is not a debugger issue.

    I will bring this thread to the attention of the device experts.

    Thanks

    ki

  • Hi Ki,

    It is very time consuming to reset the target and reload the code every time we like to restart.

    Many users will appreciate if restart icon works.

    Thanks,

    Eli

  • Many users will appreciate if restart icon works.

    To clarify - the restart button works fine. It is doing what is expected - setting the program counter to the address of the entry point of the loaded application. The issue is that from the entry point, the application is unable to run to main. This is NOT an issue with the restart feature or the debugger. It is a target and application issue.

    Thanks

    ki

  • Hi Eli,

    The issue is with the SysFW runs on the DMSC (M3 core). The SysFW was loaded to the DMSC by the R5F_0_0 at the bootloading time. It will allocate and manage the system resources. Your application program will request and release the system resource via DMSC.  If you reset the R5F_0_0 without notifying the DMSC, the DMSC will continue its duty as if nothing happens. On the other hand, the R5F cores will start the new execution, as if the DMSC is started fresh. That is why you need to do the system reset instead of the reset, because the system reset will trigger the RBL bootloading and starts everything fresh.

    See the following URL for details for bootloading:

    AM243x MCU+ SDK: Understanding the bootflow and bootloaders (ti.com)

    Best regards,

    Ming