Why I2C interrupt occured even I had absorted the transfer?

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

Why I2C interrupt occured even I had absorted the transfer?

655 次查看
wengzhaojie
Contributor I

Hello,I am using I2C on S32K148. IDE is S32DS ARM2.2(version:1.0.0.202001161613)

The flow is:
(1) start a I2C transder by calling  LPI2C_DRV_MasterSendDataBlocking, which is using DMA.
(2) transfer time out
(3) call: 
LPI2C_DRV_MasterAbortTransferData
(4) call: 
LPI2C_DRV_MasterDeinit
(5) the I2C dma transfer error interrupt(EDMA_DRV_ErrorIRQHandler) occured, and drop into the DEV_ASSERT for no available I2C instance.

Why did this happened? And how can I avoid this?

0 项奖励
回复
1 回复

621 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @wengzhaojie,

Please refer to the documentation of the driver.

danielmartynek_0-1722863525177.png

 

The blocking transfer is completed when the function returns (with error or success status), there is nothing to abort.

danielmartynek_1-1722863618260.png

LPI2C_DRV_MasterAbortTransferData() can be used for non-blocking transfers.

danielmartynek_2-1722863701361.png

 

Regards,

Daniel

0 项奖励
回复