S32K144 LPSPI getting stuck in "void LPSPI1_transmit_16bits (uint16_t send)" function

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

S32K144 LPSPI getting stuck in "void LPSPI1_transmit_16bits (uint16_t send)" function

跳至解决方案
2,387 次查看
pritampatil
Contributor III

S32K144 LPSPI getting stuck in "void LPSPI1_transmit_16bits (uint16_t send)" function

I tried debugging LPSPI code from example projects.

When i started debugging, the transmit function executes 8 times without any interruption, then it gets stuck  in 

"void LPSPI1_transmit_16bits (uint16_t send)" function in LPSPI.c

  • I used a global variable and incremented it after "void LPSPI1_transmit_16bits (uint16_t send)" function. The variable value never exceeded 8. After transmit function executes 8 times, it gets stuck in  while((LPSPI1->SR & LPSPI_SR_TDF_MASK)>>LPSPI_SR_TDF_SHIFT==0); in transmit function.
  • I tried giving slight delay after it transmits each time, but the issue remains same.
  • I haven't used any interrupts.

Please provide solution for this.

Regards,

Pritam.

PS: 

update, i have attached project zip file to this.

You can find same code in example projects for S32K144 in S32DS.

1 解答
1,847 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Pritam,

Thank you for the code.

You can either read the receive data register (RDR) or set the CFGR1[NOSTALL] bit in the SPI init function.

Please refer to the description of the bit.

Regards,

Daniel

在原帖中查看解决方案

5 回复数
1,847 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Can you share a test code?

Thanks,

Daniel

0 项奖励
1,847 次查看
pritampatil
Contributor III

Sure Daniel.. 

Please find the attached zip file of project attached to the original question.

You can also find this code in example projects in S32DS for K144 series.

Regards

Pritam

0 项奖励
1,848 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Pritam,

Thank you for the code.

You can either read the receive data register (RDR) or set the CFGR1[NOSTALL] bit in the SPI init function.

Please refer to the description of the bit.

Regards,

Daniel

1,823 次查看
Joey_van_Hummel
Contributor III

Hi Daniel,

 

Sorry to bump an old topic like this. I have also run into the problem that when Rx-FIFO overflows, transmit stalls. Setting NOSTALL=1 solves this problem. However, NOSTALL=1 is not described to have any effect on Rx-FIFO overrun in RM 12.1.

 

I came here originally to see if this behaviour is guaranteed, even though it is undocumented. I searched the forum and found your proposal. Can I take this to mean that NOSTALL also has a guaranteed effect on allowing transfers after RX overrun, and is not an errata?

 

Kind regards,

Joey

0 项奖励
1,847 次查看
pritampatil
Contributor III

Thanks a lot Daniel... It actually worked..

:smileyhappy::smileyhappy::smileyhappy:

0 项奖励