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: system reset from debug script



Tool/software: Code Composer Studio

Hello,

I would like to send a system reset command (like the one the can be done manually from the toolbar) from a debug script (JS console).

I have seen someone suggested something like the syntax below  but it does not seem to work -  i get numReset=3 but all read from getResetType return nothing.

(working on the TDA2xx)

numReset = debugSession_a15.target.getNumResetTypes();
for ( j = 0; j < numReset; j++)
{
reset = debugSession_a15.target.getResetType(j);
if ( reset.isAllowed() )
{
if ("System Reset".equals(reset.getName()))
{
reset.issueReset();
}
}
}

Can you help me with the correct syntax for system reset and make it work?

Thanks

  • Hi Guy,
    The code snippet you posted looks good. I tried it on my DRA7x target (which has an A15) and it works for me. getResetType returns null for you?

    For my A15 target, I see:

    CPU Reset (SW)
    System Reset
    Reset Emulator

    Can you stick the below code after your getResetType call:

    print(reset.getName());

    And post the results?

    Thanks
    ki
  • Hi,
    Thanks - with print I get the resets names (if I don't use the print I get nothing) so now It is more clear.
    I found the system reset, isAllowed returns true and issueReset did cause a reset

    Thanks
    Guy
  • Hi,
    It seems to have worked while I was connected only to the A15
    I tried also connecting to one of the M4s and load it, then I repeated the "reset" commands I got the name right but both isAllowed and issueReset returned error now:

    js:> print(reset.getName());
    System Reset

    js:> reset.isAllowed()
    Wrapped com.ti.xpcom.XPCOMException: The function "Allowed" returned an error condition (0x80780001)
    js:> reset.issueReset()
    Wrapped com.ti.xpcom.XPCOMException: The function "Allowed" returned an error condition (0x80780001)

    Can you help ?

    Also - how / where can I find the guide to help figure out how to do these commands (where is it described that this how a reset can be issued ...) - the only guide I have found was a very generic one with no actual info on what the commands do (only their syntax)

    Thanks
    Guy
  • I am getting a different issue when trying to reset the M4. I have the option for a System Reset, but it fails (with an emulation error). CPU Reset works. If I had to guess, I suspect that you have to issue a System Reset from the A15.

    Are you able to successfully issue a System Reset from the M4?

    Guy Mardiks said:
    Also - how / where can I find the guide to help figure out how to do these commands (where is it described that this how a reset can be issued ...) - the only guide I have found was a very generic one with no actual info on what the commands do (only their syntax)

    I believe you are looking for the API guide:

    <CCS INDTALL DIR>/ccsv[x]/ccsv8/ccs_base/scripting/docs/DS_API/index.html

    <CCS INDTALL DIR>/ccsv[x]/ccs_base/scripting/docs/DS_API/com/ti/debug/engine/scripting/ResetType.html

    Thanks

    ki

  • Guy, Ki,

    If you have cores connected while issuing a System Reset, be careful as some of the AM57x/DRA7x devices/boards have the nRESET line set to power cycle the PMIC directly and cause the JTAG connection to fail. This was addressed in a specific silicon errata and, if I recall correctly, the only suitable workaround was to power cycle the device to get it back on a stable status.

    The procedure to properly execute such reset would be to disconnect from all cores, issue the reset, then reconnect/reload/run.

    To learn if your board/device does the above behaviour, issue a System Reset with a connected core from inside CCS .

    Regards,
    Rafael
  • Thanks Rafael,
    This seems to be the case with my DRA7x target

    ki
  • Hi,
    If i try to issue the system reset while connected to a core than it seems it will do the reset but i will no longer be able to reconnect to the cores (i will have to do a power cycle to the device).
    If i am doing the system reset while not connecting to any of the cores, i am able to connect the the cores as usual but the truth is that i am not sure how can i tell if it actually did anything.

    Thanks
    Guy
  • Hi, thanks for the info about the guide.
    i have seen these in the past but the problem is that they have one line or less per command that hardly explains what that commands does and/or how to use its parameters (no description about the inputs for the function and mostly all that is left is to try to guess ...)

    is there any other more descriptive manual for this?

    Thanks
    Guy
  • Our documentation in this area is admittedly weak. For DSS, that API doc is all that there is.

    As for the reset behavior, there is a wiki that covers it in more detail:
    processors.wiki.ti.com/.../Emulation_Resets

    Thanks
    ki