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.

C6747 PSC Init Problem

Hello E2E Community,

i have trouble with the initialization of the C6747 DSP unit "Power and Sleep Controller" (PSC) on a custom hardware. I'm using Code Composer Studio 5 with the compiler version 7.4.2 for the C6000 processor family.

The Problem is the following output on the console, when i run the initialization:

GPIO Module Enable timed out
HPI Module Enable timed out
EMIFB Module Enable timed out

I've checked the register's in debug mode and the init of these peripheral modules have no effekt on the module status register (MDSTAT).

Is there any mistake in the init routine? I've checked the initialization process steps in the "technical reference manual" and i have seen no mistake.

This is the initialization of the PSC Unit:
----------------------------------------------------- 

#include <stdio.h>
#include "C6747_Psc.h"

void initPsc(void)
{

volatile Uint32 temp = 0;
volatile Uint32 pscTimeoutCount = 10240u;

/*Wait for any previos power state transition to occur */
while ( ((psc1Regs->PTSTAT & (CSL_PSC_PTSTAT_GOSTAT1_IN_TRANSITION)) != 0)
&& (pscTimeoutCount>0) )
{
  pscTimeoutCount--;
}

/* Check if PSC state transition timed out */
if(pscTimeoutCount == 0)
{
  printf("first PSC transition to ON state timed out\n");
  return;
}

/* Bring the GPIO module out of sleep state */
/* Configure the GPIO Module to Enable state */
psc1Regs->MDCTL[CSL_PSC_GPIO] = ( (psc1Regs->MDCTL[CSL_PSC_GPIO] & 0xFFFFFFF8) | \
CSL_PSC_MDSTAT_STATE_ENABLE );

/* Bring the HPI module out of sleep state */
/* Configure the HPI Module to Enable state */
psc1Regs->MDCTL[CSL_PSC_UHPI] = ( (psc1Regs->MDCTL[CSL_PSC_UHPI] & 0xFFFFFFF8) | \
CSL_PSC_MDSTAT_STATE_ENABLE );

/* Bring the EMIFB module out of sleep state */
/* Configure the EMIFB Module to Enable state */
psc1Regs->MDCTL[CSL_PSC_EMIFB] = ( (psc1Regs->MDCTL[CSL_PSC_EMIFB] & 0xFFFFFFF8) | \
CSL_PSC_MDSTAT_STATE_ENABLE );

/* Kick start the Enable Command */
// Set the GO1 bit in PTCMD to 1 to initiate the transitions
temp = psc1Regs->PTCMD;
temp = ( (temp & CSL_PSC_PTCMD_GO1_MASK) |
(CSL_PSC_PTCMD_GO1_SET << CSL_PSC_PTCMD_GO1_SHIFT) );
psc1Regs->PTCMD |= temp;

// psc1Regs->PTCMD = 0x00000002u;

/*Wait for the power state transition to occur */
pscTimeoutCount = 10240u;
while ( ((psc1Regs->PTSTAT & (CSL_PSC_PTSTAT_GOSTAT1_MASK)) != 0)
&& (pscTimeoutCount>0) )
{
  pscTimeoutCount--;
}

/* Check if PSC state transition timed out */
if(pscTimeoutCount == 0)
{
  printf("second PSC transition to ON state timed out\n");
}

/* Wait for MODSTAT = ENABLE/DISABLE from LPSC */
pscTimeoutCount = 10240u;
while( ((psc1Regs->MDSTAT[CSL_PSC_GPIO] & (CSL_PSC_MDSTAT_STATE_MASK))
!= CSL_PSC_MDSTAT_STATE_ENABLE) && (pscTimeoutCount>0))
{
  pscTimeoutCount--;
}

/* If timeout, the resource may not be functioning */
if (0 == pscTimeoutCount)
{
  printf("GPIO Module Enable timed out\n");
}


/* Wait for MODSTAT = ENABLE/DISABLE from LPSC */
pscTimeoutCount = 10240u;
while( ((psc1Regs->MDSTAT[CSL_PSC_UHPI] & (CSL_PSC_MDSTAT_STATE_MASK))
!= CSL_PSC_MDSTAT_STATE_ENABLE) && (pscTimeoutCount>0))
{
  pscTimeoutCount--;
}

/* If timeout, the resource may not be functioning */
if (0 == pscTimeoutCount)
{
  printf("HPI Module Enable timed out\n");
}

/* Wait for MODSTAT = ENABLE/DISABLE from LPSC */
pscTimeoutCount = 10240u;
while( ((psc1Regs->MDSTAT[CSL_PSC_EMIFB] & (CSL_PSC_MDSTAT_STATE_MASK))
!= CSL_PSC_MDSTAT_STATE_ENABLE) && (pscTimeoutCount>0))
{
  pscTimeoutCount--;
}

/* If timeout, the resource may not be functioning */
if (0 == pscTimeoutCount)
{
  printf("EMIFB Module Enable timed out\n");
}

}

Thanks and regards,

Felix

  • Hi Felix

    If you think you have software issues with the PSC initialization code, i would recommend you cross check your code against the DSP GEL file available from Spectrum Digital on OMAPL137/C6747.

    You can find it here

    http://support.spectrumdigital.com/boards/evmomapl137/revg/

    The gel file has the initialization routines for PSC enabling/disabling of modules that you can adapt to.

    If that doesn't help, it would be good to see how your code works on EVM vs your custom board? 

    Hope this helps

    Regards

    Mukul

  • Hi Mukul,

    thank you so much for your answer! I compared my initialization code with the gel file and found my mistake...

    I used the GO1 bit to enable the Power Transition instead of using the correct GO0 bit.

    /* Kick start the Enable Command */
    // Set the GO1GO0 bit in PTCMD to 1 to initiate the transitions
    temp = psc1Regs->PTCMD;
    temp = ( (temp & CSL_PSC_PTCMD_GO1GO0_MASK) |
    (CSL_PSC_PTCMD_GO1GO0_SET << CSL_PSC_PTCMD_GO1GO0_SHIFT) );
    psc1Regs->PTCMD |= temp;

    Thanks!

    Felix