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.

TMS320F280039: OnTargetConnect Hangs: Waiting for MEMCFG_O_DXINITDONE

Part Number: TMS320F280039
Other Parts Discussed in Thread: UNIFLASH

Hi,

I am running into an inconvenience that I hope I can get some help with.

I am using the TMS320F280039 MCU with the XDS200 USB Debugger.

When I start a debugging session in CCS 12.7.0.00007 the system will hang at the OnTargetConnect() Gel Step.  If I hit cancel the connection session continues and I can start debugging.  I've added prints to the Gel Script and it appears that the following line is never evaluating to true.

    while(!(*(int *) (MEMCFG_BASE + MEMCFG_O_DXINITDONE) == 0x3));   /* Wait for InitDone Status       */

Can someone explain why the M0/M1 RAM initialization would not occur successfully?  It is also worth nothing that I do have the JTAGLock enabled as well and the SecureFlash Configured.

I've attached the entire OnTargetConnect function from the f280039.gel file.

Thanks,

-Colin

OnTargetConnect()
{

    *(int *)(MEMCFG_BASE + MEMCFG_O_DXINIT)  = 0x0003;               /* RAM INIT FOR M0/M1 Memory      */
    while(!(*(int *) (MEMCFG_BASE + MEMCFG_O_DXINITDONE) == 0x3));   /* Wait for InitDone Status       */

    *(int *)(MEMCFG_BASE + MEMCFG_O_LSXINIT) = 0x00FF;               /* RAM INIT FOR LS1..LS7  Memory  */
    while(!(*(int *) (MEMCFG_BASE + MEMCFG_O_LSXINITDONE) == 0xFF)); /* Wait for InitDone Status       */

    *(int *)(MEMCFG_BASE + MEMCFG_O_GSXINIT) = 0x000F;               /* RAM INIT FOR GS0.GS3 Memory    */
    while(!(*(int *) (MEMCFG_BASE + MEMCFG_O_GSXINITDONE) == 0xF));  /* Wait for InitDone Status       */

    GEL_TextOut("\n\nRAM initialization done\n\n");

    if (GEL_IsInRealtimeMode())     /* If in real-time-mode */
    {
    }
    else                            /* Put device into C28x Mode */
    {
        C28x_Mode();
    }

    f280039_Memory_Map();        /* Initialize the CCS memory map */

    /* Check to see if CCS has been started-up with the DSP already */
    /* running in real-time mode.  The user can add whatever        */
    /* custom initialization stuff they want to each case.          */

    if (GEL_IsInRealtimeMode())     /* Do real-time mode target initialization */
    {

    }
    else                            /* Do stop-mode target initialization */
    {
        GEL_Reset();                /* Reset DSP */
    }
}

  • Hi,

    Can someone explain why the M0/M1 RAM initialization would not occur successfully?  It is also worth nothing that I do have the JTAGLock enabled as well and the SecureFlash Configured.

    I don't see any obvious reason why M0/M1 would not get initialize. If you have JTAGLOCK enable, how are you able to connect to CCS? Are you unlocking the JTAG and then trying to connect ?

    Vivek Singh

  • Vivek,

    The JTAG password is placed in the Target configuration (.ccxml) file as (I think you?) described here in SPRACS4.

    I also see this issue when using the uniflash command line stand alone tool. (With the same target configuration file). Thats actually where I put the comments in the .gel file and was able to validate that it was stuck in the while 1.

    -Colin

  • Are you seeing this issue on multiple boards ?

  • Yes.  Including on a control card.

    Can you help me understand the jtag unlock process.  When does the password get transmitted to the device?  Does it need to be re-initialized after a reset.  (Any any form? nTRST, GEL_reset, ?)

    Along the same lines, if we are able to read the `MEMCFG_O_DXINITDONE` register values, I presume that means that the JTAG Password is not our issue at all?

    -Colin

  • Along the same lines, if we are able to read the `MEMCFG_O_DXINITDONE` register values, I presume that means that the JTAG Password is not our issue at all?

    -Colin

    That is correct understanding. Are you seeing this issue only after programming the device with JTAGLOCK feature ?

    Vivek Singh

  • The issue started appearing after I enabled the JtagLock and Secure Boot.  (Which occurred simultaneously)

    So I'm not certain which functionality introduced the issue.  I can try running some experiments later today with fresh boards.

    Any ideas on why the secure boot flow could cause this behavior?

    And thank you!

  • Can you try this on fresh device on the same CCS setup and let me know the result.

    Any ideas on why the secure boot flow could cause this behavior?

    I can not think of any link between secure boot and this issue. If you comment out this line in Gel file and then connect to CCS and check the value of INiT DONE for M0/M1 in CCS memory watch window. what value you see ?

    Vivek Singh

  • Ok, I figured out what was causing the issues.

    I our code we are configuring the access restrictions for the RAM sections so that only certain code sections can be accessed by the C28x or CLA.  

    After we set the configuration, we lock the sectors using `MemCfg_lockConfig`.

    When the debugger runs afterwards if the lock bit is set, then the init request fails and the system blocks waiting for the initialization to complete.

    Seems like there should be a set in the gel file that unlocks the RAM before trying to write to it on these parts.

  • Good to know you were able to debug it. I'll provide the feedback to our SW team on checking the LOCK and COMMIT for RAM init section.

    Thanks for your feedback.

    Regards,

    Vivek Singh