Cant' find how to edit my post so will add further info here.
I looked again at the waveforms and the data being send and received at the hardware level is correct.
The main issue is the data I get in "readBuffer" is incorrect
Can you try the following and let us know if it works?
Use the SPIM_GetRxBufferSize() API to read the Rx buffer size and then, read the data using SPIM_ReadRxData()?
This is to ensure that you are reading the data, only after the Rx FIFO has received the data and not after Tx FIFO is flushed out. There may be a delay between the two, depending on your interface.
Isn't the communication synchronous, RX data is clocked in AS the TX data is going out. So if 1 byte is being sent at a time, the next byte is already received once the tx byte has gone?
Yes, the communication is synchronous. However, when the tx byte from Tx FIFO is sent out, there may be a path delay due to which the Rx FIFO may be loaded with rx data a little later.
As mentioned in the datasheet, it is always recommended to confirm the Rxbuffer size before using ReadRxData API.