Error reading data from UART in PIC32
Your code is activated as soon as the UART has received at least one character. Then it tries to retrieve as many characters from the UARTs buffer, with a maximum of 5 characters, and waiting a maximum of 122 * 19 instruction cycles. Apparently, that time limit is not enough to receive the next character, so you end up with only the one character that was fully received. If you want to receive more charcaters you will have to call this code again (and again...), or you must specify a timeout that is sufficient to receive all characters (but that requires that you know whether the sender sends all characters back-to-back, which in general you can't know).