Hi VIGNESH BALAJI,
Your code have some errors.
Master:
1. select the SSEL as the SPI select pin instead of just GPIO.
SPI0_C1 |= SPI_C1_SSOE_MASK;
SPI0_C2 |= SPI_C2_MODFEN_MASK;
2. enable the PTE0, PTE1,PTE2,PTE3 pull up for working stable.
PORT_PUE1 |= PORT_PUE1_PTEPE0_MASK | PORT_PUE1_PTEPE1_MASK|PORT_PUE1_PTEPE2_MASK|PORT_PUE1_PTEPE3_MASK;
3. After enter main file, add a small delay for the power on stable.
int main(void){
unsigned int i,j;
Clk_Init();
SPI_init();
for(i=0;i<100;i++) for(j=0;j<65535;j++); // delay, wait for the system stable
for(;;) {
SPI_write(0x21);
uint8_t spi_d = SPI_read();
}
return 0;
}
Slave:
1. select the SSEL as the SPI select pin instead of just GPIO.
SPI0_C1 &= ~SPI_C1_SSOE_MASK;
SPI0_C2 |= SPI_C2_MODFEN_MASK;
2. enable the PTE0, PTE1,PTE2,PTE3 pull up for working stable.
PORT_PUE1 |= PORT_PUE1_PTEPE0_MASK | PORT_PUE1_PTEPE1_MASK|PORT_PUE1_PTEPE2_MASK|PORT_PUE1_PTEPE3_MASK;
Then after connect two KEA128 together, it will work fine.
I have test your code on my TRK KEA128 board, it works ok.

Slave debug result:

Slave can receive the correct data 0x21 from master.
Logic analyzer wave:

I also attached my modified project for your reference.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------