if i don't enable and disable CREN then it will cause overrun error and i don't have any other idea to solve both problem, this is very urgent and important to me, so can anyone help out on how to write the programming for storing 512 byte continuosly into an array ?
You need to have a circular buffer and two pointers, a read pointer and a write pointer.
You should use the receive interrupt to write the characters to the buffer and increment the write pinter, and your main program loop to read the data and increment the read pointer.