AnsweredAssumed Answered

how to enable UART1 for JN516x in JN-AN-1184 application?

Question asked by Xingquan Jiang on Mar 14, 2018
Latest reply on Mar 20, 2018 by Mario Ignacio Castaneda Lopez

I followed the 《JN516x Integrated Peripherals API User Guide》to add UART1 for the coordinator in method vStartup() like follows:

vAHI_UartSetRTSCTS(E_AHI_UART_1,FALSE);
bAHI_UartEnable(E_AHI_UART_1,Tx_Buf,Tx_Buf_Lenth,Rx_Buf,Rx_Buf_Lenth);
vAHI_UartSetBaudRate(E_AHI_UART_1,E_AHI_UART_RATE_115200);
vAHI_UartSetInterrupt(E_AHI_UART_1,FALSE,FALSE,FALSE,TRUE,E_AHI_UART_FIFO_LEVEL_8);
vAHI_Uart0RegisterCallback(vDeviceCallBack);
sprintf((char*)Datas,"test12345678");

DBG_vPrintf(TRACE_APP,"test");

u16AHI_UartBlockWriteData(E_AHI_UART_1,(uint8*)Datas,(uint16)strlen((char*)Datas));

tmp=u16AHI_UartReadTxFifoLevel(E_AHI_UART_1);
DBG_vPrintf(TRACE_APP,"test%d\n",tmp);
tmp=u16AHI_UartReadTxFifoLevel(E_AHI_UART_1);
DBG_vPrintf(TRACE_APP,"test%d\n",tmp);
tmp=u16AHI_UartReadTxFifoLevel(E_AHI_UART_1);
DBG_vPrintf(TRACE_APP,"test%d\n",tmp);
tmp=u16AHI_UartReadTxFifoLevel(E_AHI_UART_1);
DBG_vPrintf(TRACE_APP,"test%d\n",tmp);
tmp=u16AHI_UartReadTxFifoLevel(E_AHI_UART_1);
DBG_vPrintf(TRACE_APP,"test%d\n",tmp);

```

But the uart1 doesn't output anything. However, when I check the UART1 Fifo, it seems that the message has been sended. What else should I do to enable the UART1?

Outcomes