Hi Tommaso Bergero
FRDM-KE06 sdk has the SPI master and slave code, do you test that code, whether it works OK on your side or not?

When you want to send the data in the SPI slave, you need to write the related data to the Transmit FIFO:
void SPI_SLAVE_IRQHandler(void)
{
if ((SPI_GetStatusFlags(EXAMPLE_SPI_SLAVE) & kSPI_RxBufferFullFlag) && (rxIndex > 0U))
{
destBuff[BUFFER_SIZE - rxIndex] = SPI_ReadData(EXAMPLE_SPI_SLAVE);
rxIndex--;
}
if ((SPI_GetStatusFlags(EXAMPLE_SPI_SLAVE) & kSPI_TxBufferEmptyFlag) && (txIndex > 0U))
{
SPI_WriteData(EXAMPLE_SPI_SLAVE, (uint16_t)(srcBuff[BUFFER_SIZE - txIndex]));
txIndex--;
}
if ((rxIndex == 0U) && (txIndex == 0U))
{
slaveFinished = true;
SPI_DisableInterrupts(EXAMPLE_SPI_SLAVE, kSPI_RxFullAndModfInterruptEnable | kSPI_TxEmptyInterruptEnable);
}
SDK_ISR_EXIT_BARRIER;
}
i suggest you test the official SDK code:SDK_2.8.0_FRDM-KE06Z\boards\frdmke06z\driver_examples\spi\interrupt_b2b\slave
at first, which can be downloaded from this link:
Welcome | MCUXpresso SDK Builder
Wish it helps you!
If you still have questions about it, pelase kindly let me know.
Best Regards,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------