Hello,
I'm using -> MCU : S32K144, IDE : S32DS ARM 2.2
Currently, I'm implementing 176Byte long SPI messages transmit/receive function.
with the SPI bare-metal example code
If I increase the Frame size register in TCR, up to 320bit(4 * 10Byte) it works well
But, If I try to send/receive bigger values it doesn't work.
for example from my code
uint32_t spi_tx[44] = { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA,
0xB, 0xC, 0xD, 0xE, 0xF, 0x10, 0x11, 0x12, 0x13, 0x14,
0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E,
0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
0x29, 0x2A, 0x2B, 0x2C };
uint32_t spi_rx[44] = {0,};
void LPSPI0_tx(void)
{
for(i=0;i<10;i++)
{
while((LPSPI0->SR & LPSPI_SR_TDF_MASK)>>LPSPI_SR_TDF_SHIFT==0);
LPSPI0->TDR = spi_tx[i];
LPSPI0->SR |= LPSPI_SR_TDF_MASK; /* Clear TDF flag */
}
}
void LPSPI0_rx(void)
{
for(j=0;j<10;j++)
{
while((LPSPI0->SR & LPSPI_SR_RDF_MASK)>>LPSPI_SR_RDF_SHIFT==0);
spi_rx[j] = LPSPI0->RDR;
LPSPI0->SR |= LPSPI_SR_RDF_MASK;
}
}
If I use i,j = 10 and frame size = 319(320bit) it works well
But, If I use i,j = 11 and frame size = 351(352bit) it doesn't work
Can I find an answer?