Stall in SPI DSPI_MasterHandleTransferByte in KW38

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

Stall in SPI DSPI_MasterHandleTransferByte in KW38

跳至解决方案
601 次查看
FedericoWegher
Contributor III

Hello.

I am using KW38 with SDK 2.6.6. My application uses SPI in master mode to communicate to external chip. Communication works fine, so SPI is properly configured.

The problem occurs when the external chip has bad contact in any of its SPI slave pins. In this case, we notice that the KW38 firmware is stalled inside function DSPI_MasterHandleTransferByte.

I checked that function and noticed that:

  1. it does not return error result code
  2. it contains two loops, one to enqueue data into TX fifo, the other to dequeue data from RX fifo, and both loops quit ONLY if they enqueue/dequeue the foreseen number of bytes

The function is design to loop forever in case the SPI is not able to transfer all bytes.

I would expect the function to break the loop and return error after a given number of retries in case of such communication fault.

0 项奖励
1 解答
583 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi FedericoWegher,

   Thank you for your interest in the NXP kinetis product, I would like to provide service for you.

   In fact, the SDK just give you the examples, if you want to meet your own produce situation, you can modify the driver and add your own required function.

   Take an example, in the loop, you can add your own code, use the timer to counter, if the time is overflow, you still can't get your own desired data, you can stop the loop and report the error.

   All the function you can design it and add it in your own project, the SDK is just the normal example which gives the customer referring code.

Wish it helps you!

If you still have questions about it, please kindly let me know!

Best Regards,

Kerry

-------------------------------------------------------------------------------

Note:

- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored

Please open a new thread and refer to the closed one, if you have a related question at a later point in time.

-----------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
1 回复
584 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi FedericoWegher,

   Thank you for your interest in the NXP kinetis product, I would like to provide service for you.

   In fact, the SDK just give you the examples, if you want to meet your own produce situation, you can modify the driver and add your own required function.

   Take an example, in the loop, you can add your own code, use the timer to counter, if the time is overflow, you still can't get your own desired data, you can stop the loop and report the error.

   All the function you can design it and add it in your own project, the SDK is just the normal example which gives the customer referring code.

Wish it helps you!

If you still have questions about it, please kindly let me know!

Best Regards,

Kerry

-------------------------------------------------------------------------------

Note:

- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored

Please open a new thread and refer to the closed one, if you have a related question at a later point in time.

-----------------------------------------------------------------------------

0 项奖励