Stall in SPI DSPI_MasterHandleTransferByte in KW38

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Stall in SPI DSPI_MasterHandleTransferByte in KW38

ソリューションへジャンプ
594件の閲覧回数
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 解決策
576件の閲覧回数
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 返信
577件の閲覧回数
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 件の賞賛