I2C receive error

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

I2C receive error

411 次查看
huyle03
Contributor I

Hello everyone,

I have an error with I2C on S32K344 EVB board.  I don't know if the configuration and the code are wrong or missing something. The first frame address + 1 bit write is OK (ACK received). The next frame I sent is the data 0x00, I also got ACK from slave. However, the third frame is reading from slave but the API function return status "LPI2C_IP_BUSY_STATUS". Here are some captures of the problem . Thanks for your help.

 

0 项奖励
回复
1 回复

369 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

you are checking wrong return status of Send function. Non-blocking Send returns LPI2C_IP_SUCCESS_STATUS, if transfer was started properly. In your case it does not go to do-while loop to test transfer status. So try  
 
PetrS_0-1761044916821.png

BR, Petr

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2189037%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EI2C%20%E6%8E%A5%E6%94%B6%E9%94%99%E8%AF%AF%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2189037%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E5%A4%A7%E5%AE%B6%E5%A5%BD%3C%2FP%3E%3CP%3E%E6%88%91%E5%9C%A8%20S32K344%20%E5%BC%80%E5%8F%91%E6%9D%BF%E4%B8%8A%E7%9A%84%20I2C%20%E5%87%BA%E7%8E%B0%E9%94%99%E8%AF%AF%E3%80%82%3CSPAN%3E%E6%88%91%E4%B8%8D%E7%9F%A5%E9%81%93%E9%85%8D%E7%BD%AE%E5%92%8C%E4%BB%A3%E7%A0%81%E6%98%AF%E9%94%99%E8%AF%AF%E8%BF%98%E6%98%AF%E9%81%97%E6%BC%8F%E4%BA%86%E4%BB%80%E4%B9%88%E3%80%82%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%B8%A7%E5%9C%B0%E5%9D%80%20%2B%201%20%E4%BD%8D%E5%86%99%E5%85%A5%E6%AD%A3%E5%B8%B8%EF%BC%88%E5%B7%B2%E6%8E%A5%E6%94%B6%20ACK%EF%BC%89%E3%80%82%E6%88%91%E5%8F%91%E9%80%81%E7%9A%84%E4%B8%8B%E4%B8%80%E5%B8%A7%E6%98%AF%E6%95%B0%E6%8D%AE%200x00%EF%BC%8C%E6%88%91%E4%B9%9F%E4%BB%8E%E4%BB%8E%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%82%A3%E9%87%8C%E5%BE%97%E5%88%B0%E4%BA%86%20ACK%E3%80%82%E4%BD%86%E6%98%AF%EF%BC%8C%E7%AC%AC%E4%B8%89%E5%B8%A7%E6%AD%A3%E5%9C%A8%E4%BB%8E%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%AF%BB%E5%8F%96%EF%BC%8C%E4%BD%86%E6%98%AF%20API%20%E5%87%BD%E6%95%B0%E8%BF%94%E5%9B%9E%E7%8A%B6%E6%80%81%20%22%20LPI2C_IP_BUSY_STATUS%20%22%E3%80%82%E4%BB%A5%E4%B8%8B%E6%98%AF%E8%AF%A5%E9%97%AE%E9%A2%98%E7%9A%84%E4%B8%80%E4%BA%9B%E6%8D%95%E8%8E%B7%E3%80%82%E8%B0%A2%E8%B0%A2%E4%BD%A0%E7%9A%84%E5%B8%AE%E5%8A%A9%E3%80%82%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2189919%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20I2C%20receive%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2189919%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%82%A8%E5%A5%BD%EF%BC%8C%3C%2FP%3E%0A%3CDIV%3E%E6%82%A8%E6%AD%A3%E5%9C%A8%E6%A3%80%E6%9F%A5%E5%8F%91%E9%80%81%E5%87%BD%E6%95%B0%E7%9A%84%E9%94%99%E8%AF%AF%E8%BF%94%E5%9B%9E%E7%8A%B6%E6%80%81%E3%80%82%E5%A6%82%E6%9E%9C%E4%BC%A0%E8%BE%93%E6%AD%A3%E5%B8%B8%E5%BC%80%E5%A7%8B%EF%BC%8C%E9%9D%9E%E9%98%BB%E5%A1%9E%E5%8F%91%E9%80%81%E5%B0%86%E8%BF%94%E5%9B%9E%20LPI2C_IP_SUCCESS_STATUS%E3%80%82%E5%9C%A8%E8%BF%99%E7%A7%8D%E6%83%85%E5%86%B5%E4%B8%8B%EF%BC%8C%E5%AE%83%E4%B8%8D%E4%BC%9A%E8%BF%9B%E5%85%A5%20do-while%20%E5%BE%AA%E7%8E%AF%E6%9D%A5%E6%B5%8B%E8%AF%95%E4%BC%A0%E8%BE%93%E7%8A%B6%E6%80%81%E3%80%82%E9%82%A3%E5%B0%B1%E8%AF%95%E8%AF%95%20%20%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22PetrS_0-1761044916821.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22PetrS_0-1761044916821.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F361849iFF3079839A05E6EA%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22PetrS_0-1761044916821.png%22%20alt%3D%22PetrS_0-1761044916821.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CP%3EBR%2C%20Petr%3C%2FP%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E