Hi,
The source code in that .rar file is not readable.
Can you attach it again?
Regarding the code that you posted here,
flag = ( LPSPI_DRV_MasterGetTransferStatus(INST_LPSPI_2, bytesRemained) == STATUS_SUCCESS);
The function will not return STATUS_SUCCESS immediately.
Can you use something like this intead?
LPSPI_DRV_MasterTransfer(INST_LPSPI_2, masterDataSend, masterDataReceive, BUFFER_SIZE);
while(LPSPI_DRV_MasterGetTransferStatus(INST_LPSPI_2, bytesRemained) != STATUS_SUCCESS);
If you want to receive all the data transmitted by the master, connect MOSI to MISO in a loop.
Have you scoped the SPI bus with a logic analyzer?
BR, Daniel