S32K344 SPI data wrong

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

S32K344 SPI data wrong

Jump to solution
1,346 Views
IanHsueh
Contributor II

Hello NXP Team.

I tried configuring SPI, CPOL = 1 ,CPHA = 1.

The waveform is correct when i use 100K baudreate,

But when i use 1M baudrate, the waveform will be wrong.

Usually, data error will occur after the data pin maintains a high voitage for a long time.

Baudrate 100k

{BC7AB95C-0000-43AE-B266-63F0C802412B}.png

Baudrate 1M

123.png

The following is my project

Thank you

0 Kudos
Reply
1 Solution
1,327 Views
RomanVR
NXP Employee
NXP Employee

Hello @IanHsueh.

I tested your project on my side without any modifications, connecting the MOSI to the MISO to verify if the data was transmitted correctly despite the analyzer's information. I successfully received in the buffer the correct data. Could you please do perform the same test? This will help us rule out any potential issues with the logic analyzer, as we have encountered problems with them when observing a data frame.

Also, let me know if the tests were done in a custom board or in one of our evaluation boards.

I will be waiting for your answer.

- RomanVR.

Best Regards!

View solution in original post

0 Kudos
Reply
5 Replies
1,263 Views
IanHsueh
Contributor II

Hello @RomanVR ,after a few days of testing, i found that it seems to be a problem with the C code of main.c

1,251 Views
RomanVR
NXP Employee
NXP Employee

Thank you for informing us that you've identified the issue.

If you have any further questions or encounter any other unresolved issues, please feel free to reach out.

- RomanVR.

Best Regards!
0 Kudos
Reply
1,292 Views
IanHsueh
Contributor II

Hello @RomanVR  ,thank for ur reply

I don't know how to connect MOSI to MISO to verify the data, is there any instructions?

And I'm running on this board.

20250302_203741.jpg

btw, I used the example on this webpage(used LSPI2, without dma), deleted the configuration, used 1M baudrate, and tested it. The waveform was correct.

Example S32K344 SPI Transmit & Receive Using DMA DS3.5 RTD500 - NXP Community

The following is an example of my modification. I compared the SPI and PORT settings and they are consistent. I don't know what went wrong with the project I created.

0 Kudos
Reply
1,328 Views
RomanVR
NXP Employee
NXP Employee

Hello @IanHsueh.

I tested your project on my side without any modifications, connecting the MOSI to the MISO to verify if the data was transmitted correctly despite the analyzer's information. I successfully received in the buffer the correct data. Could you please do perform the same test? This will help us rule out any potential issues with the logic analyzer, as we have encountered problems with them when observing a data frame.

Also, let me know if the tests were done in a custom board or in one of our evaluation boards.

I will be waiting for your answer.

- RomanVR.

Best Regards!
0 Kudos
Reply
939 Views
IanHsueh
Contributor II
I currently solved the problem, I cleared the RxBuffer
0 Kudos
Reply