Are there any thing I miss here?
Yes, you are too fast. The PutArray() API is non-blocking when the transmit buffer is large enough. So your reading GetTxBufferSize() just shows that the complete transfer to the slave is not done yet.
So for the putArray(), it will put data on tx buffer and send data automatically to slave? I thought it will keep the data in buffer
void SPIM_1_PutArray(const uint8 buffer, uint8 byteCount)
bufIndex = 0u;
while(byteCount > 0u)
/* Wait until TX FIFO has a place */
while(0u == (SPIM_1_TX_STATUS_REG & SPIM_1_STS_TX_FIFO_NOT_FULL))
/* Put data element into the TX FIFO */