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.

Can CCS5.5 be configured to assert a system reset before loading a program

Other Parts Discussed in Thread: AM3358, AM3359

Is there any way to configure CCS 5.5 to assert a system reset before loading a program?

The use case is downloading a SYS/BIOS program to a AM335x starter kit using the built in XDS100v2. SYS/BIOS enables the MMU such that:

a) Power on the AM335x starter kit

b) Download the program, successfully in which the AM3358_StarterKit.gel script successfully configures the target hardware

c) Terminate the debug session.

d) Restart the debug session. Because of the way the SYS/BIOS program has configured the MMU, the AM3358_StarterKit.gel OnTargetConnect function fails with an error when it attempts to configure the target hardware:

CortxA8: Output: **** AM3358_SK Initialization is in progress ..........
CortxA8: Output: **** AM335x ALL PLL Config for OPP == OPP100 is in progress .........
CortxA8: GEL: Error while executing OnTargetConnect(): Target failed to read 0x44E10040 at (*((unsigned int *) (0x44E10000+0x40))>>22) [AM3358_StarterKit.gel:379] at GetInputClockFrequency() [AM3358_StarterKit.gel:450] at ARM_OPP100_Config() [AM3358_StarterKit.gel:370] at AM3358_SK_Initialization() [AM3358_StarterKit.gel:356] at OnTargetConnect() .

To prevent the GEL script failing with an error on the 2nd and subsequent download a System Reset is required to get the AM3359 into the initial reset state.

I couldn't find a way in the CCS debug properties to generate a System Reset before loading the program. The only way I found to generate a System Reset before loading the program was to add the following to the AM3358_StarterKit.gel script:

StartUp()
{
    GEL_AdvancedReset("System Reset");
    GEL_TextOut("Performed System Reset\n");
}

While a system reset can be generated by modifying the GEL script, I think it would be useful if the CCS project properties could specify a System Reset before loading a program, to get a target into a known state.

  • Chester,

    It is possible to issue a Reset before connecting/loading code via the menu Run --> Debug Configurations. Check the screenshot below.

    One thing I am unsure is what type of reset is issued. I imagine it is whatever defined to be run by the GEL_Reset() API (which varies by device).

    Regards,

    Rafael

  • desouza said:
    It is possible to issue a Reset before connecting/loading code via the menu Run --> Debug Configurations. Check the screenshot below..

    I had tried that before I came up with the "work-around" of adding the StartUp() to the AM3358_StarterKit.gel script. However, I have since realised that the reset can be applied independanty to routers / subpaths / CPUs within the AM3359 device.

    Restored the original unmodified AM3358_StarterKit.gel script and tried different options.

    1) Set "Reset the target on a connect" only on the CortexA8:

    If the Cortex A8 had last run a SYS/BIOS program, then resetting the Cortex A8 upon a re-connection results in errors running the GEL script and/or the downloaded program failed.

    2) Set the "Reset the target on a connect" only on the CS_DAP_DebugSS:

    This results in the following additional error, and if the Cortex A8 had last run a SYS/BIOS program then upon a re-connection still resulted in errors running the GEL script and/or the downloaded program failed.

    CS_DAP_DebugSS: GEL: Error while executing GEL_Reset(): A reset is not allowed at this time  at GEL_Reset() .

    3) Set the "Reset the target on a connect" only on the IcePick_D_0:

    If the Cortex A8 had last run a SYS/BIOS program, then resetting the IcePick_D_0 upon a re-connection allowed the GEL script to run without error and the program was downloaded and ran without error. Resetting the IcePick_D_0 upon connection also causes three "C" characters to be output on the AM335x starter kit serial terminal, which is a sign that the ROM bootloader attempted to run which I think means a System Reset had occured [the ROM bootloader runs if you press the reset button on the board]

    desouza said:
    One thing I am unsure is what type of reset is issued. I imagine it is whatever defined to be run by the GEL_Reset() API (which varies by device).

    My experiment appears to show that the type of reset varies according to if the reset is applied to a router or CPU within a device. Is this documented somewhere?