Other Parts Discussed in Thread: CC2640R2F
Hi,
I am using CC2340R5 basic_ble peripheral code with ANCS and I have added the UART code as follows.
void UART_Init() { /* Create a UART in CALLBACK read mode */ UART2_Params_init(&uartParams); uartParams.readMode = UART2_Mode_CALLBACK; uartParams.readCallback = UARTCallback; uartParams.readReturnMode = UART2_ReadReturnMode_PARTIAL; uartParams.baudRate = 115200; uartParams.eventCallback = UARTEventCallback; uartParams.eventMask = UART2_EVENT_OVERRUN; uart = UART2_open(CONFIG_UART2_0, &uartParams); if (uart == NULL) { /* UART2_open() failed */ while (1) { } } // Setup an initial read UART2_read(uart, &uartReadBuffer, UART_MAX_READ_SIZE, 0); } void eventcallbackFxn(UART2_Handle handle, uint32_t event, uint32_t data, void *userArg) { if (event == UART2_EVENT_OVERRUN) //check if the event is overrun event { UART2_flushRx(uart); } } void UARTCallback(UART2_Handle handle, void *buffer, size_t count, void *userArg, int_fast16_t status) { uartPacketSize = count; BLEAppUtil_invokeFunction(HandlingFunction,buffer); } void HandlingFunction(char *pData) { UART2_write(uart,pData,uartPacketSize,0); UART2_read(uart, uartReadBuffer, UART_MAX_READ_SIZE, 0); }
Now iPhone has connected to the peripheral and doing continuous call and SMS (info will print on uart) and parallelly doing an connection disconnection in mobile Bluetooth settings. And an interval of 100ms pushing an data via serial to the peripheral while these test case uart overrun event has occurring.
when overrun occurs In eventcallbackFxn calling an UART2_flushRx(uart) function and after 5 sec HAL_ASSERT_CAUSE_ICALL_TIMEOUT.
So how to avoid from uart overrun and why UART2_flushRx(uart) function causing an HAL_ASSERT_CAUSE_ICALL_TIMEOUT.
SDK Version : simplelink_lowpower_f3_sdk_7_40_00_64 (peripheral)
CCS version: CCS 12.5.0
Thanks.
Vignesh.