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