S32k311 SPI Module configuration

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

S32k311 SPI Module configuration

1,424 Views
dhanabharathi
Contributor III

Hello @nxp 

       I am configured in SPI in S32k31xevb board, I am getting SPI_JOB_PENDING. i connected the PINs correctly. what will the problem in this? i attached my project in here .  provide solution for this problem.                                                                                                                                                                                                                                                                                                            

0 Kudos
Reply
7 Replies

1,402 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @dhanabharathi 

I have reviewed your configurations and noticed an important detail: the SPI master and slave are set with different baud rates.

Both devices should operate at compatible speeds. Since the master provides the clock signal, the slave must be able to reliably receive and respond at that rate. A mismatch in baud rates can lead to data corruption, communication errors, or complete failure to establish a connection.

 

BR, VaneB

0 Kudos
Reply

1,307 Views
dhanabharathi
Contributor III

Hello @VaneB ,

  I changed both SPI master and slave baud rates, but still the problem exists. can you please recheck.


0 Kudos
Reply

1,283 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @dhanabharathi 

I have ported the Spi_Transfer_S32K344 project to the S32K311. To help ensure that no configurations, initializations, or code elements are missing from your setup, I am attaching both the .mex file and the main source file for your reference.

0 Kudos
Reply

1,109 Views
dhanabharathi
Contributor III

Hello @VaneB ,

  Now, it is working. Thank you for your support.

0 Kudos
Reply

827 Views
dhanabharathi
Contributor III

Hello @VaneB 

I have taken this as example and configured LPSPI1 as slave (using DMA) and LPSPI2 as master. after executing RxChBuf1 is successfully receiving the data whereas in RxChBuf1[0] =15, RxChBuf1[9]=16 and the remaining array is '0'. I tried different configuration still not works. can you please provide me the solution?

0 Kudos
Reply

770 Views
dhanabharathi
Contributor III

Hello @VaneB 

      I have analysed further in the function Lpspi_Ip_TransferProcess() the NumberOfReads is getting '0' because Base->FSR - RXCOUNTER is '0' so it is not updating RX buffer. Note: the breakpoint is hitting at Lpspi_Ip_IrqTxDmaHandler() and Lpspi_Ip_IrqRxDmaHandler() so, I guess DMA configuration is OK. Can you please help me on this topic? I need Rxbuf1 to be updated. I have configured master and slave as EB

 

 

0 Kudos
Reply

740 Views
VaneB
NXP TechSupport
NXP TechSupport
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2196655%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32k311%20SPI%20Module%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2196655%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F61445%22%20target%3D%22_blank%22%3E%40nxp%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BI%20am%20configured%20in%20SPI%20in%20S32k31xevb%20board%2C%20I%20am%20getting%20SPI_JOB_PENDING.%20i%20connected%20the%20PINs%20correctly.%20what%20will%20the%20problem%20in%20this%3F%20i%20attached%20my%20project%20in%20here%20.%26nbsp%3B%20provide%20solution%20for%20this%20problem.%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2206850%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32k311%20SPI%20Module%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2206850%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%3EHello%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F201913%22%20target%3D%22_blank%22%3E%40VaneB%3C%2FA%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20I%20have%20analysed%20further%20in%20the%20function%20Lpspi_Ip_TransferProcess()%20the%20NumberOfReads%20is%20getting%20'0'%20because%20Base-%26gt%3BFSR%20-%20RXCOUNTER%20is%20'0'%20so%20it%20is%20not%20updating%20RX%20buffer.%20Note%3A%20the%20breakpoint%20is%20hitting%20at%20Lpspi_Ip_IrqTxDmaHandler()%20and%20Lpspi_Ip_IrqRxDmaHandler()%20so%2C%20I%20guess%20DMA%20configuration%20is%20OK.%20Can%20you%20please%20help%20me%20on%20this%20topic%3F%20I%20need%20Rxbuf1%20to%20be%20updated.%20I%20have%20configured%20master%20and%20slave%20as%20EB%3C%2FSPAN%3E%3C%2FP%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2206076%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32k311%20SPI%20Module%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2206076%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F201913%22%20target%3D%22_blank%22%3E%40VaneB%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EI%20have%20taken%20this%20as%20example%20and%20configured%20LPSPI1%20as%20slave%20(using%20DMA)%20and%20LPSPI2%20as%20master.%20after%20executing%20RxChBuf1%20is%20successfully%20receiving%20the%20data%20whereas%20in%20RxChBuf1%5B0%5D%20%3D15%2C%20RxChBuf1%5B9%5D%3D16%20and%20the%20remaining%20array%20is%20'0'.%20I%20tried%20different%20configuration%20still%20not%20works.%20can%20you%20please%20provide%20me%20the%20solution%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2201881%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32k311%20SPI%20Module%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2201881%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F201913%22%20target%3D%22_blank%22%3E%40VaneB%3C%2FA%3E%26nbsp%3B%2C%3CBR%20%2F%3E%3CBR%20%2F%3E%26nbsp%3B%20Now%2C%20it%20is%20working.%20Thank%20you%20for%20your%20support.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2201072%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32k311%20SPI%20Module%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2201072%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F253997%22%20target%3D%22_blank%22%3E%40dhanabharathi%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20have%20ported%20the%20Spi_Transfer_S32K344%20project%20to%20the%20S32K311.%20To%20help%20ensure%20that%20no%20configurations%2C%20initializations%2C%20or%20code%20elements%20are%20missing%20from%20your%20setup%2C%20I%20am%20attaching%20both%20the%20.mex%20file%20and%20the%20main%20source%20file%20for%20your%20reference.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2200807%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32k311%20SPI%20Module%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2200807%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F201913%22%20target%3D%22_blank%22%3E%40VaneB%3C%2FA%3E%26nbsp%3B%2C%3CBR%20%2F%3E%3CBR%20%2F%3E%26nbsp%3B%20I%20changed%20both%26nbsp%3B%3CSPAN%3ESPI%20master%20and%20slave%20baud%20rates%2C%20but%20still%20the%20problem%20exists.%20can%20you%20please%20recheck.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2196823%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32k311%20SPI%20Module%20configuration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2196823%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F253997%22%20target%3D%22_blank%22%3E%40dhanabharathi%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20have%20reviewed%20your%20configurations%20and%20noticed%20an%20important%20detail%3A%20the%20SPI%20master%20and%20slave%20are%20set%20with%20different%20baud%20rates.%3C%2FP%3E%0A%3CP%3EBoth%20devices%20should%20operate%20at%20compatible%20speeds.%20Since%20the%20master%20provides%20the%20clock%20signal%2C%20the%20slave%20must%20be%20able%20to%20reliably%20receive%20and%20respond%20at%20that%20rate.%20A%20mismatch%20in%20baud%20rates%20can%20lead%20to%20data%20corruption%2C%20communication%20errors%2C%20or%20complete%20failure%20to%20establish%20a%20connection.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%2C%20VaneB%3C%2FP%3E%3C%2FLINGO-BODY%3E