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.

zstack 串口接收问题

在GenericApp之上,添加了以下代码:

void GenericApp_Init( uint8 task_id )
{

...

halUARTCfg_t uartConfig;

uartConfig.configured           = TRUE;
uartConfig.baudRate             = HAL_UART_BR_115200;
uartConfig.flowControl          = FALSE;
uartConfig.callBackFunc         = rxCB;
HalUARTOpen (0, &uartConfig);

...

}

static void rxCB(uint8 port,uint8 event)
{  
  unsigned  char Uartbuf[10]={0};
  unsigned char len=0;
  len=HalUARTRead(0,Uartbuf,10);
  HalUARTWrite(0,"in rxCB\n",sizeof("in rxCB\n"));
  if(len)
  {
      HalUARTWrite(0,Uartbuf,len);
  }
}

但是模块一上电就会进入串口回掉函数,并且死循环,一直打印in rxCB,有人知道是什么问题吗?