So I'm really not making any headway here. I worked on the suggestions last night, tried it this morning, and it's not getting better. Let me show some code; MOD5272 platform. Here are what I think are the relevant snippets from the various things:
Code: Select all
OS_SEM g_datasem; // These are in the declarations of the global space
OS_SEM g_passsem;
// These next lines are a snippets of UserMain()
OSChangePrio(MAIN_PRIO); // Set this task priority
// Insure semaphores are initialized early
if (OSSemInit( &g_passsem, 0) != OS_NO_ERR )
iprintf("Pass Semaphore Init Failed");
if (OSSemInit( &g_datasem, 0) != OS_NO_ERR )
iprintf("Data Semaphore Init Failed");
// Then later
// Create TCP Server task
OSTaskCreate( TcpServerTask,
(void *)TCP_LISTEN_PORT,
&TcpServerTaskStack[USER_TASK_STK_SIZE] ,
TcpServerTaskStack,
MAIN_PRIO - 1); // higher priority than UserMain
// Create TCP Image receiver task
OSTaskCreate( TcpImageRcvTask,
(void*) TCP_IMAGE_PORT,
&TcpImageTaskStack[USER_TASK_STK_SIZE],
TcpImageTaskStack,
MAIN_PRIO - 2); // Higher priority than TcpServerTask
// Create Pass Data Manager task
OSTaskCreate( PassRunTask,
(void*) 0,
&PassTaskStack[USER_TASK_STK_SIZE],
PassTaskStack,
MAIN_PRIO - 3); // Higher priority than TcpImageTask
SetupDataDoneUnit();
SetupFCDoneDummyUnit();
// The actual pass data management task that won't unPend
void PassRunTask( void * pd )
{
//bool b_done = false;
iprintf("In PassRunTask\r\n"); // This message comes thru the diagnostic port
// This task will run the data feeding portion of the PHC. This is needed because of the new data overrun problem.
while(1)
{
OSSemPend( &g_passsem, 0 ); // Wait for cue to start the pass cycle.
putchar( '.' ); // This never comes down the port
*cpldcfg = SET_LAT | SET_POL | SET_BLK;
*cpldcfg = SET_POL | SET_BLK;
// Now we need to do the work of shifting in the data
// Send in the data
for( int i=0; i<SHIFT_COUNT; i++ ) // You ALWAYS need 32 writes, regardless of bus size or module count.
{
*data01 = *g_pCurReadIdx;
g_pCurReadIdx++;
OSSemPend( &g_datasem, 0);
}
g_LinesRendered++;
putchar( ',' ); // This never comes down the diagnostic port
if( g_LinesRendered == g_LinesToRender )
{
vector_base.table[70] = (long)&FirePassNLL;
vector_base.table[90] = (long)&FireDoneDummy;
putchar( 'd' );
}
}
iprintf("Dumped\r\n");
return;
}
// The interrupt
INTERRUPT( FireDone, 0x2700 )
{
// One Fire Cycle just completed
OSSemPost( &g_passsem );
putchar('|'); // This message DOES come down the diagnostic port, in a constant unending stream
sim.icr4 = 0x08000000; // Clear the Interrupt Pending
sim.icr4 = 0x09000000; // Re-enable the interrupt
return;
}
// The other interrupt
INTERRUPT( DataACK, 0x2700 )
{
// Release the pending write (I think)
OSSemPost( &g_datasem );
// putchar('.');
sim.icr1 = 0x00800000; // Clear IRQ 3, prevent from posting again
sim.icr1 = 0x00F00000; // Re-enabled /INT3 with priority #5
}
What's basically happening is that a strobe fires a physical High voltage signal, and when it decays below a certain level, the data shifting has to continue. That decay is captured by the FireDone interrupt, and like I say, it's firing. The DataACK fires as well, though it doesn't in this context because the pass manager never kicks in. When I do singular testing of the data shifter, it's fine.
Any clues? Thanks, Dan B.