Be warned that function Chip_UART_ReadBlocking in LPCopen version 2.10 for LPC17xx is broken, for six years now - as it looks to me that doesn't exist a newer release.
The short function is the following:
int Chip_UART_ReadBlocking(LPC_USART_T *pUART, void *data, int numBytes)
{
int pass, readBytes = 0;
uint8_t *p8 = (uint8_t *) data;
while (readBytes < numBytes) {
pass = Chip_UART_Read(pUART, p8, numBytes);
numBytes -= pass;
readBytes += pass;
p8 += pass;
}
return readBytes;
}
What happens here is that if the data read is coming in more than one read (because remote host is slow, or even because it's fragmented while reading FIFO) the first read can make readBytes > numBytes and the loop will end prematurely.
Take as example reading 10 bytes of data in two passes, the first of 6 bytes: next 4 bytes won't be read.
Besides writing a complete alternative, it could save modifying the control loop as follows
while (0 < numBytes) {
I guess that this blocking function is less likey to be used than Chip_UART_Read itself, with a good external timeout limit. I discovered it while using it for a quick intervention in a test, that became eventually a long and complex debug session, as I thought the issue was on my side of code.