Kinetis K - I2C: Repeat start cannot be generated

cancel
Showing results for 
Search instead for 
Did you mean: 

Kinetis K - I2C: Repeat start cannot be generated

1,539 Views
pavelst
Contributor II

Hello,

We are using Kinetis K and have encountered a problem which seems exactly as the known one in Kinetis L, but it doesn't appear in our Kinetis K erratas.

What we see is exactly the same behavior and working behavior as explained in mask set errata 2N97F, ID 6070, title: "I2C: Repeat start cannot be generated if the I2Cx_F[MULT] field is set to a non-zero value".

We are using Kinetis K MK11/MK21 and both don't have this errata published on the web site.

Is this a known issue for the Kinetis K devices or we have are missing something here?

Thank you,

Pavel

Labels (1)
18 Replies

528 Views
jeremyzhou
NXP TechSupport
NXP TechSupport

Hi Pavel,

According to your mention, the MK11/MK21 also ecountered the same issue which has been recorded in Errta 2N97F.

I'd like to confirm that whether the issue could be fixed by workaround or not and I was wondering if you could upload your code, then I could run this code with board for test.

I'm looking forward to your reply.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

528 Views
BlackNight
NXP Employee
NXP Employee
0 Kudos

528 Views
dave408
Senior Contributor II

Hi Erich, I believe I'm seeing this exact problem on my K64F, but I'm not positive.  However, the problem I've got is that I can't make the changes you've suggested because I can't find them in PEx.

pastedImage_0.png

By any chance is that option selected elsewhere in KDS 2.0?

I'm doing a write here, rather than a read.  Perhaps I'm barking up the wrong tree, but I was trying to figure out if there's a way to force the repeated start when I found this post.  The chip I'm using specifies that I either send a STOP or repeated start after the 0x01 in the image above.

0 Kudos

528 Views
chris_brown
NXP Employee
NXP Employee

Dave,

You should not be seeing the same issue as the K64 does not have the same version of the I2C module as the K22/K21/ L Family.  But please let us know if changing the clock settings fixes your issue.  Also, could you let us know what version of PEx and the SDK that you are using?

Thanks,

Chris

528 Views
dave408
Senior Contributor II

Hi Chris, I'm using KSDK 1.1 and whatever version of PEx is included with that.  I haven't figured out how to modify the KSDK to generate the repeat start.  However, I did fudge my function calls to mimic the signals for a repeat start, and it didn't help.  It looks like we also have an issue with our I2C address selection, so in the end it looks like I probably won't need the repeat start.

0 Kudos

528 Views
BlackNight
NXP Employee
NXP Employee

Yes, it seems that issue is present in many more devices, as they probably share the same silicon implementation.

Which I2C component are you using with Processor Expert?

0 Kudos

528 Views
dave408
Senior Contributor II

Wow, thank you for the super prompt reply!  :smileyhappy:  I'm using fsl_i2c.

0 Kudos

528 Views
BlackNight
NXP Employee
NXP Employee

that means you are using the Kinetis SDK? I believe it is in the clock manager, but not sure.

0 Kudos

528 Views
dave408
Senior Contributor II

Yes, I'm using KSDK as well.  I have disabled tabs and am going through each item in PEx, but nothing jumped out at me.  I looked at the clock manager and there's nothing really there.

pastedImage_0.png

There are a lot of clock-related settings for the CPU, but I never know what is safe to play with there.  Usually, I delete all configs except for the "maximum speed" config, but at the moment I have all five available and I'm using #1 (max speed).

0 Kudos

528 Views
BlackNight
NXP Employee
NXP Employee

This is handled in the SDK source code, and I believe you cannot influence this with the settings in the components. You would need to check the SDK source code.

0 Kudos

528 Views
dave408
Senior Contributor II

Ok, thanks, I'll take a look at the clock configuration in the setup code and will post up what I find.

0 Kudos

528 Views
pavelst
Contributor II

Yes, MCU on Eclipse is the first place where we found this bug mentioned.

The related two workarounds are also mentioned on the discussed errata 2N97F.

0 Kudos

528 Views
chris_brown
NXP Employee
NXP Employee

Pavel,

I am having some trouble understanding some of this post, but I just wanted to clarify that this errata has been documented already for certain K22 and K21 devices.  If you check the errata sheets for Masks 2N03G and 3N03G, it is documented for these mask sets.  Can you please check your silicon and let us know if these are the Mask numbers on your parts?  If not, we definitely want to know the mask set numbers that you are seeing it on so that we can make sure we have all of the affected devices documented. 

Thanks!  :smileyhappy:

Chris

0 Kudos

528 Views
jeremyzhou
NXP TechSupport
NXP TechSupport

Hi Pavel,

Could you please tell me the workaroud whetlher work or not when MK11/MK21 couldn't generate the repeat start?

I'm looking forward to your reply.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

528 Views
pavelst
Contributor II

Hi Ping,

Yes, the workaround worked.

When we reconfigured the prescaler to 0 (divide by 1) while remaining the same resulting I2C frequency (with the help of PE), it started working correctly.

Thank you,

Pavel

0 Kudos

528 Views
jeremyzhou
NXP TechSupport
NXP TechSupport

Hi Pavel,

Thanks for your reply.

I was wondering if you could upload the demo and I can reproduce this situation, then I will report this issue to document team to correct the Errata document.

I'm looking forward to your reply.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

528 Views
rev
Contributor III

This silicon bug was an issue for me too. (K22 device) and unfortunately I spent 6 hours debugging before finding this post.  This was complex code that I've moved from a slower Kinetis part so changing the multiplier seemed like a no brainer.  The work-around solved the problem.

Jeremy or Erich  (or someone else at Freescale), _please_ get this added to the errata for all affected Kinetis families!

0 Kudos

528 Views
jeremyzhou
NXP TechSupport
NXP TechSupport

Hi Jonathan,

Thanks for your information.

I was wondering if you can tell the specific MCU of K22 device you used?

I'm looking forward to your reply.
Have a great day,

Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos