Hi Annamol,
If you have the UART setup as interrupt, you should not need the IO_SERIAL_NON_BLOCKING defined as interrupt mode is inherently non-blocking.
As characters are received (or transmitted) the UART isr will add them to the UART Rx queue (or UART Tx queue for transmitted characters).
The queue size is set in the BSP board definition file (ex: twrk70f120m.h header) as #define BSPCFG_SCI0_QUEUE_SIZE 64.
You can increase or decrease this as needed.
The fstatus() function call is simply checking to see if the respective queue has any characters in it. If yes then it returns TRUE else FALSE.
I did a quick test using the hello_world MQX4.2 example for TWR-K70F120M (didn't have TWR-K65F180M handy) and was able to send long string of characters (256 long) and received correctly to application buffer (char data[512]) . Here is my code snippet and I have attached my hello.c file.
void hello_task
(
uint32_t initial_data
)
{
(void)initial_data; /* disable 'unused variable' warning */
printf("Hello World\n");
#if 1 //DES 1=test, 0=default code
char data[512];
char *data_ptr = data;
while(1) {
if(fstatus(stdin)) {
*data_ptr = fgetc(stdin);
data_ptr++;
// data= fgetc(stdin);
// fputc(data,stdout);
// fputc('\n', stdout);
}
}
#endif
_task_block();
}
Reference: C:\Freescale\Freescale_MQX_4_2\mqx\examples\hello
Regards,
David