QG8 Hanging on Power Reset when UART accessed

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

QG8 Hanging on Power Reset when UART accessed

1,818 次查看
jimstevens
Contributor I
I've got a simple application that hangs on power reset.  I'm programming it with the P&E USB Multilink through the debug screen in CodeWarrior.  The target is set correctly.
 
Once I disconnect the P&E and do a power cycle, the chip just hangs.  I'm using LEDs to verify correct operation.
 
However, if I comment out my readData (listed below) function which reads data from the UART, everything will function on a power reset.  I've tried both interrupt based and polling for the UART, and it makes no difference.
 
//=============================================================================
// readData
//-----------------------------------------------------------------------------
//=============================================================================
int readData(void *dataBuffer, int dataBufferSize)
{
int          returnValue = 0;
int   i;
  // If we have a bad data buffer pointer then we fail.
  if(dataBuffer == 0)
  {
     goto EXIT;
  }
  for(i=0;i<dataBufferSize;i++) {
          
   while (SCIS1_RDRF == 0);
     
   ((unsigned char*)dataBuffer)[i] = SCID;
   
   SCIS1_RDRF = 0;      //acknowledge Receiver Full flag
        
  }

  returnValue = 1;
  EXIT:
  return returnValue;
}
 
Is there something about the RX on the UART that would prevent the chip from reseting properly?
 
I also have a TX function in there and it works fine.  So I don't think it's the entire UART.
 
Any help is greatly appreciated.
 
James
标签 (1)
0 项奖励
回复
1 回复

619 次查看
peg
Senior Contributor IV

Hi Jim,

The COP is timing out while waiting for the data???

Disable COP or feed dog in your waiting for data to fill buffer loop.

Regards David

 

0 项奖励
回复