S32 SDK SPI Slave only sends 10 valid bytes

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32 SDK SPI Slave only sends 10 valid bytes

598 Views
tonytony
Contributor I

Hi There

I need a pointer with a little SPI problem I'm having

I'm using the S32 SDK SPI Pal example with the SPC5748G Devkit

As a starting point I have taken the spi pal demo application in the SDK directory and am using SPI0 peripheral in slave mode.  The required transmission is 64 bytes.

What I see when I load SPI_SlaveTransfer with 64 byte tx/rx buffers like so:

SPI_SlaveTransfer(&spi1Instance,slaveTx1, slaveRx1, 64);

When master device reads out the 64 bytes the slave sends the first 10 bytes correctly then for the remaining 56 bytes the slave sends byte 10, the last byte for all the other 56 bytes.

Interestingly the stock example only sends 10 bytes and make no reference as to why sending more might be a problem.

I am not using DMA mode.

The data received at the master is correct for the first 10 bytes and I have validated traffic on the SPI lines using an analyser so I know my problem is on the slave side.

 

Thanks


Tony

0 Kudos
2 Replies

587 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Tony,

not sure what's going on, it works on my side. I did quick test using original spi_pal example. I changed only;

#define NUMBER_OF_FRAMES 64U
#define BUFFER_SIZE 64U

and then I filled master_send and slave_send with some data and I can successfully receive all 64 bytes. So, this should work on your side, there's no limitation.

If you check slaveTx1 directly in the memory, does it contain expected data?

Regards,

Lukas

 

570 Views
tonytony
Contributor I

Thanks Lukas

I'll get back to this in a week or so to retest

Rgds

Tony

0 Kudos