It may happen for example because fewer bytes are actually available right now (maybe because we were close to end-of-file, or because we are reading from a pipe, or from a terminal), or because read() was interrupted by a signal.
Repeat the read for as long as it has data available.
Also, since the other end is a microcontroller which might be slower than your workstation by a large margin, perhaps the data simply isn't available yet when you do the read(). That's another reason to try again, of course.
So looks like you can try
int n = 0, offset = 0, bytes_expected = 40;
do
{
n = read (*FileDesc, recBuff+offset, sizeof(recBuff));
offset += num;
} while (offset < bytes_expected);