AnsweredAssumed Answered

JN5168 UART only receive 5 bytes

Question asked by liang guo on Aug 1, 2018
Latest reply on Aug 3, 2018 by Mario Ignacio Castaneda Lopez

I only can receive 5 bytes from UART0 with JN5168. Who can tell what the reason is? Thank you!

void UartInit(void)
{
    vAHI_UartSetRTSCTS(UART, FALSE);
    vAHI_UartEnable(UART);

    /* Reset UART */
    vAHI_UartReset(UART, TRUE, TRUE);
    vAHI_UartReset(UART, FALSE, FALSE);

    vAHI_UartSetBaudRate(UART, E_AHI_UART_RATE_115200);

    /* Set remaining settings */
    vAHI_UartSetControl(UART, FALSE, FALSE, E_AHI_UART_WORD_LEN_8, TRUE, FALSE);
    vAHI_UartSetInterrupt(UART, FALSE, FALSE, TRUE, TRUE, E_AHI_UART_FIFO_LEVEL_1);

    vInitPrintf((void *)vPutChar);
}

 

PRIVATE void vProcessIncomingHwEvent(AppQApiHwInd_s *psAHI_Ind)
{
    if (psAHI_Ind->u32DeviceId == E_AHI_DEVICE_UART0)
    {
        if ((psAHI_Ind->u32ItemBitmap & 0x000000FF) == E_AHI_UART_INT_RXDATA)
        {
            /* Store Data */
            uart0_rxBuffer[uart0_rd] = (uint8)((psAHI_Ind->u32ItemBitmap & 0x0000FF00) >> 8);
            uart0_rd = (uart0_rd + 1) % RX_BUFF_SIZE;
        }
    }
}

Outcomes