DSPRelated.com
Forums

HPI fails on Occasion

Started by aine_canby September 6, 2003
Hi,

I'm using the DSK6711, Revision 2. I'm trying to load a dsp program
to my board using a windows app. I've noticed though that every 10
times or so my program doesn't run correctly.

What I have is a dsp program which outputs a sine wave, which is in
turn loaded to the dsp board by my windows application. When I run
this application, I mostly get a sine wave from my codec, but
sometimes I get a DC level, or noise (noticed that only one time),
but mostly when it fails I get 0 Volts from the codec output. A few
times also, one or more of the dsp leds switched on. When this
failure occurs, I simply run my application again (without having to
power cylce) and it works again for another few attempts. This code
works fine all of the time when I load it with CCS instead of my
windows application.

Have you any idea as to why this would be happening? Do the api calls
(such as dsk6x_open) return on completion, or do you put delays after
them?

None of the api function calls are failing (well they dont ruturn any
error anyway).

My api application is simply this -

char *sBoardFile = "ti_ppdsk.cfg";

pBoardFile = fopen( sBoardFile, "r" );
if ( pBoardFile == NULL )
exit(1);
else
fclose(pBoardFile);

if ( !dsk6x_open(sBoardFile,&hBd) )
exit(1);

if ( !dsk6x_reset_dsp(hBd,0,1) )
exit(2);

if ( !dsk6x_hpi_open(hBd))
exit(3);

/* Setup the EMIF */ /*My board is Revision 2 according to the GEL
file */
{
const int nNoRegisters = 9;
int nIndex;

char *arrEMIFCfgName[]= { "GCTL", // Global Control Reg
"CE1", // CE1 Space Control Reg
"CE0", // CE0 Space Control Reg
"CE2", // CE2 Space Control Reg
"CE3", // CE3 Space Control Reg
"SDRAMCTL", // SDRAM Control Reg
"SDRAMTIMING", // SDRAM Timing
Reg
"SDRAMEXT", // SDRAM Extension Reg
"L2CFG"}; // L2 Cache Config Reg

unsigned long arrEMIFCfgAddr[]= {
0x01800000, // Global Control Reg
0x01800004, // CE1 Space Control Reg
0x01800008, // CE0 Space Control Reg
0x01800010, // CE2 Space Control Reg
0x01800014, // CE3 Space Control Reg
0x01800018, // SDRAM Control Reg
0x0180001C, // SDRAM Timing Reg
0x01800020, // SDRAM Extension Reg
0x01840000}; // L2 Cache Config Reg

// I took these from my GEL file -

unsigned long arrEMIFCfgValue[]= {
0x00003300, // Global Control Reg
0xFFFFFF23, // CE1 Space Control Reg
0x00000030, // CE0 Space Control Reg
0xFFFFFF23, // CE2 Space Control Reg
0xFFFFFF23, // CE3 Space Control Reg
0x57116000, // SDRAM Control Reg
0x0000061A, // SDRAM Timing Reg
0x00054529, // SDRAM Extension Reg
0x00000003}; // L2 Cache Config Reg

// Loop through all EMIF registers
for (nIndex = 0; nIndex < nNoRegisters; nIndex++)
{
// Write configuration value to register
unsigned long ulWriteLength = sizeof (unsigned long);

if (!dsk6x_hpi_write (hBd, &arrEMIFCfgValue[nIndex],
&ulWriteLength, arrEMIFCfgAddr[nIndex]))
{
printf("Failed configuring EMIF (%d)\n", nIndex);
exit(4);
}

}
}

if (dsk6x_coff_load(hBd,coffNam,bVerbose,bClr,bDump))
exit(5);

if (!dsk6x_hpi_generate_int(hBd))
exit(6); // Should see sine at this point
getchar();

if ( !dsk6x_reset_dsp(hBd,0,1) )
exit(7);

if (!dsk6x_hpi_close(hBd))
exit(8);

if (!dsk6x_close(hBd))
exit(9); Anyway, if you have any notion as to my new problem please let me
know,

Thanks,

Aine.



Aine,
 
I have used the windows interface only ocaisionally and have never had any problems - once I got my first program running  [:-)
 
It sounds like something is going wrong during the load.  Either the emif is not getting initialized correctly or one or more memory writes are failing.
 
Some thoughts for troubleshooting...
 
Load some code into internal RAM, execute it first, have it checksum your SDRAM code and light a pass or fail LED.
 
mikedunn

aine_canby <a...@yahoo.com> wrote:
Hi,

I'm using the DSK6711, Revision 2. I'm trying to load a dsp program
to my board using a windows app. I've noticed though that every 10
times or so my program doesn't run correctly.

What I have is a dsp program which outputs a sine wave, which is in
turn loaded to the dsp board by my windows application. When I run
this application, I mostly get a sine wave from my codec, but
sometimes I get a DC level, or noise (noticed that only one time),
but mostly when it fails I get 0 Volts from the codec output. A few
times also, one or more of the dsp leds switched on. When this
failure occurs, I simply run my application again (without having to
power cylce) and it works again for another few attempts. This code
works fine all of the time when I load it with CCS instead of my
windows application.

Have you any idea as to why this would be happening? Do the api calls
(such as dsk6x_open) return on completion, or do you put delays after
them?

None of the api function calls are failing (well they dont ruturn any
error anyway).

My api application is simply this -

char *sBoardFile = "ti_ppdsk.cfg";

pBoardFile = fopen( sBoardFile, "r" );
if ( pBoardFile == NULL )
exit(1);
else
fclose(pBoardFile);

if ( !dsk6x_open(sBoardFile,&hBd) )
exit(1);

if ( !dsk6x_reset_dsp(hBd,0,1) )
exit(2);

if ( !dsk6x_hpi_open(hBd))
exit(3);

/* Setup the EMIF */ /*My board is Revision 2 according to the GEL
file */
{
const int nNoRegisters = 9;
int nIndex;

char *arrEMIFCfgName[]= { "GCTL", // Global Control Reg
"CE1", // CE1 Space Control Reg
"CE0", // CE0 Space Control Reg
"CE2", // CE2 Space Control Reg
"CE3", // CE3 Space Control Reg
"SDRAMCTL", // SDRAM Control Reg
"SDRAMTIMING", // SDRAM Timing
Reg
"SDRAMEXT", // SDRAM Extension Reg
"L2CFG"}; // L2 Cache Config Reg

unsigned long arrEMIFCfgAddr[]= {
0x01800000, // Global Control Reg
0x01800004, // CE1 Space Control Reg
0x01800008, // CE0 Space Control Reg
0x01800010, // CE2 Space Control Reg
0x01800014, // CE3 Space Control Reg
0x01800018, // SDRAM Control Reg
0x0180001C, // SDRAM Timing Reg
0x01800020, // SDRAM Extension Reg
0x01840000}; // L2 Cache Config Reg

// I took these from my GEL file -

unsigned long arrEMIFCfgValue[]= {
0x00003300, // Global Control Reg
0xFFFFFF23, // CE1 Space Control Reg
0x00000030, // CE0 Space Control Reg
0xFFFFFF23, // CE2 Space Control Reg
0xFFFFFF23, // CE3 Space Control Reg
0x57116000, // SDRAM Control Reg
0x0000061A, // SDRAM Timing Reg
0x00054529, // SDRAM Extension Reg
0x00000003}; // L2 Cache Config Reg

// Loop through all EMIF registers
for (nIndex = 0; nIndex < nNoRegisters; nIndex++)
{
// Write configuration value to register
unsigned long ulWriteLength = sizeof (unsigned long);

if (!dsk6x_hpi_write (hBd, &arrEMIFCfgValue[nIndex],
&ulWriteLength, arrEMIFCfgAddr[nIndex]))
{
printf("Failed configuring EMIF (%d)\n", nIndex);
exit(4);
}

}
}

if (dsk6x_coff_load(hBd,coffNam,bVerbose,bClr,bDump))
exit(5);

if (!dsk6x_hpi_generate_int(hBd))
exit(6);// Should see sine at this point
getchar();

if ( !dsk6x_reset_dsp(hBd,0,1) )
exit(7);

if (!dsk6x_hpi_close(hBd))
exit(8);

if (!dsk6x_close(hBd))
exit(9);Anyway, if you have any notion as to my new problem please let me
know,

Thanks,

Aine._____________________________________
Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer. You need to do a "reply all" if you want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join: Send an email to c...@yahoogroups.com

To Post: Send an email to c...@yahoogroups.com

To Leave: Send an email to c...@yahoogroups.com

Archives: http://www.yahoogroups.com/group/c6x

Other Groups: http://www.dsprelated.com