Tool/software: TI-RTOS
Hi,
I need to receive data via uart using interrupt( uart hardware interrupt) Can anyone suggest me how enable interrupt and receive data with an example.
Thanking you,
Vijay Rakesh
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.
Tool/software: TI-RTOS
Hi,
I need to receive data via uart using interrupt( uart hardware interrupt) Can anyone suggest me how enable interrupt and receive data with an example.
Thanking you,
Vijay Rakesh
Hello Vijay,
Please take a look at this example: http://dev.ti.com/tirex/content/simplelink_cc2640r2_sdk_1_50_00_58/examples/rtos/CC2640R2_LAUNCHXL/drivers/uartecho/README.html
Hopefully this helps.
David
Hi David,
Thanks for the reply, Now I'm able receive data upon interrupt but in ReadCallback function i'm try to send a notification but my program is hanging (code is below) when i comment the notification service its working perfectly. I couldn't understand the reason why it was hanging.
static void readCallback(UART_Handle uart, void *rxBuf, size_t size)
{
uint8_t Data[5];
UART_write( uart, rxBuf, 5 );
memcpy( Data , rxBuf ,5 );
BleNewService_SetParameter(BNS_BLE_NEW_SERVICE_NEW_CHARACTERISTIC_ID ,5 , Data );
UART_read( uart, rxBuf , 5 );
return;
}
Regards,
Vijay Rakesh
Hi David
Do I need to call every time UART_read() before I receive some data? If I call once at initialization I'm able to receive data through interrupt for once and from second time I'm not able to receive any data. If keep in uart_read() call after receiving a data I'm able to receive data for few times and then my program stops running. Please give me any solution for this problem.
Regards
Vijay Rakesh
Hi David,
Thanks for reply, I have two questions
1. Uart_read is not receiving data when it receives less than size which passed as an argument. My Other device will send uart data with different lengths without a new line. I commented uartParams.readReturnMode = UART_RETURN_FULL even though its not working. so how can i receive different length of data?
2.As per your suggestion i made a ICALL API call from task function then its working but some times it is hanging after receiving uart data (received uart matches to the length of the data). what could be the reason? I increased stack size even though its hanging
regards,
Vijay Rakesh