I would suggest you to configure the UART buffer to ~100 bytes and use the internal interrupt handler.
With the API _GetRxBufferSize() you can check for data ready.
In your code snippet, the line
will spoil your data when there are some bytes in the FIFO.
Thank you for so much for your kind reply bob actually i have modified my interrupt function like as you suggested but still it is missing some data could you please tell me how can i erase and reinitialize the buffer to zero after each time AT commands are ececuted
rx_buffer[ptr_rx_buffer_W] =UART_GetChar();// UART_RXDATA_REG;
Could you please suggest any other ideas or logics so that can move forward if you want my project i can upload my program here
Post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.