LPI2C hangs with subaddressSize = 2

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPI2C hangs with subaddressSize = 2

Jump to solution
3,552 Views
flexeos
Contributor II

Hi All

With IMXRT1052 I experienced a hang on LPI2C when subaddressSize is 2 (subaddress @16 bit)

 

Setup:

IMXRT1052 with LPI2C2 connected to an EEPROM (address 0x50). IMXRT acts as a master, EEPROM acts as a slave

SDK version 2.10.0

A 16 byte read command from EEPROM starting from subaddress 0x00 is issued. subaddressSize is = 2 (subaddress @16 bit)

LP2IC initialized in transfer mode with wrapper FreeRTOS

 

Result:

Transfer is interrupted before receiving data from EEPROM. SCL is stuck low

Here handler state:

flexeos_1-1641397337254.png

 

State (0x03) is kTransferDataState

16 byte to be transfered

Here below scope captures

 

NOTE:

If subaddressSize = 1 or 4 transfer is completed correctly, without changing any other parameter

Also scope captures with subaddressSize  = 4 are reported

 

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

Scope capture with 16 bit subaddress

Just after R=0x50 SCL signal (yellow) is stuck low

flexeos_2-1641397337255.png

 

Detail::

flexeos_3-1641397337256.png

 

 

 

 

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

Scope capture with 32 bit subaddress

Just after R=0x50 SCL signal (yellow) is correct

flexeos_4-1641397337257.png

 

Detail:

flexeos_5-1641397337258.png

 

 

Thanks in advance

 

 

Labels (1)
Tags (2)
0 Kudos
Reply
1 Solution
3,399 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @flexeos ,

  Please also try our newest SDK2.11.0, whether you can reproduce the issues or not, this new version just uploaded to the website, just to check whether it can fix your issues.

  https://mcuxpresso.nxp.com/en/builder?hw=EVKB-IMXRT1050

  If you still have issues, just kindly let me know, I will find time to test it and analyze the detail code.

Best Regards,

Kerry

View solution in original post

0 Kudos
Reply
9 Replies
3,526 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @flexeos ,

  Do you try the I2C driver code which is without the freertos, eg:

SDK_2_10_0_EVKB-IMXRT1050\boards\evkbimxrt1050\driver_examples\lpi2c\interrupt_b2b_transfer\master

Then, you send out the subaddressSize = 2, whether the issue still reproduced or not?

  Do you have the logic analyzer tool? which can analyze the I2C bus, that will be more clear to check the bus data. 

  From your code test result, the master side is halted, you also can check the I2C register, MSR, whether some error happens or not?

  Please use the baremetal I2C project try it again.

Best Regards,

Kerry

 

0 Kudos
Reply
3,508 Views
flexeos
Contributor II

Hi @kerryzhou 

We tested lpi2c_interrupt_b2b_transfer_master adapting just LPI2C instance and slave address and the result is the same with SCL stuck at zero with subaddressSize = 2

See here below the capture from logic state analyzer

ScreenImg (6).png

I report here below status of some relevant registers:

flexeos_0-1641812672346.png

flexeos_1-1641812729455.png

Thanks again for your support

 

0 Kudos
Reply
3,491 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @flexeos ,

   Thanks for your information.

   Please tell me which detail eeprom partnumber you are using?

  You can also share me that EEPROM datasheet, I need to check it.

 

Best Regards,

Kerry

0 Kudos
Reply
3,486 Views
flexeos
Contributor II

Hi @kerryzhou 

EEPROM is CAT24C512WI-GT3 

You can find datasheet here: https://www.mouser.it/datasheet/2/308/1/CAT24C512_D-2310637.pdf

 

In the meanwhile we adapted lpi2c_interrupt_b2b_transfer_master example and we run it on EVB to communicate to FXOS8700CQ

The result is the very same: with subaddressSize = 2 SCL is stuck at zero

 

Regards

0 Kudos
Reply
3,453 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @flexeos ,

   Thanks for your information, good. Just test it based on the NXP MIMXRT1050-EVKB and the SDK.

   Just take the SDK code as an example:

SDK_2_10_0_EVKB-IMXRT1050\boards\evkbimxrt1050\demo_apps\bubble_peripheral

  Which detail code point you have modified to reproduce the issues?

  Best Regards,

Kerry

0 Kudos
Reply
3,405 Views
flexeos
Contributor II

Hi  @kerryzhou 

Sorry for the delay but in the meanwhile we made many tests:

 

We started from these projects:

  • evkbimxrt1050_lpi2c_interrupt_b2b_transfer_master
  • evkbimxrt1050_bubble_peripheral

 

and we modified following items to be compliant with our HW:

  • pin selection
  • LPI2C instance

 

With app evkbimxrt1050_lpi2c_interrupt_b2b_transfer_master the defect is exactly replicated as I described previously

With evkbimxrt1050_bubble_peripheral behavior is correct

 

Going deeply into the issue we identified that the difference is related to specific API called:

  • using LPI2C_MasterTransferNonBlocking  ---> DEFECT
  • using LPI2C_MasterTransferBlocking ---> CORRECT

 

LPI2C_MasterTransferBlocking is not feasible for our application due to multithread environment 

Let me know if you have some suggestions

 

Thanks

 

 

 

 

 

0 Kudos
Reply
3,400 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @flexeos ,

  Please also try our newest SDK2.11.0, whether you can reproduce the issues or not, this new version just uploaded to the website, just to check whether it can fix your issues.

  https://mcuxpresso.nxp.com/en/builder?hw=EVKB-IMXRT1050

  If you still have issues, just kindly let me know, I will find time to test it and analyze the detail code.

Best Regards,

Kerry

0 Kudos
Reply
3,393 Views
flexeos
Contributor II

Hi @kerryzhou 

At a first glance it seems that in SDK 2.11 problem is resolved

 

Thanks for your support

3,385 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @flexeos ,

  You are always welcome!

  Any new issues in the future, welcome to create the new post.

 

Best Regards,

Kerry

0 Kudos
Reply