<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: MQX 4.0 I2C Locks Up in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276929#M8596</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx for the reply.&amp;nbsp; As I said, the new driver does seem to be reliable (much more reliable than the original driver).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know of any updates to the driver (such as getting the data rate correct).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 28 Apr 2013 15:09:22 GMT</pubDate>
    <dc:creator>myke_predko</dc:creator>
    <dc:date>2013-04-28T15:09:22Z</dc:date>
    <item>
      <title>MQX 4.0 I2C Locks Up</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276916#M8583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This may be a follow on to "Using AN4652 - I2C Driver Locks Up" (&lt;A _jive_internal="true" href="https://community.nxp.com/message/313948#313948"&gt;https://community.freescale.com/message/313948#313948&lt;/A&gt;) but I had a couple of questions that didn't seem to be answered here.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am prototyping my product using the Tower System with the TWRK20D72M processor board (note that J25 and J26 have been pulled to minimize the load on the I2C bus, which seems to help), a TWR-SER PCB (there are no I2C devices here) and a prototype PCB with an I2C hand wired OLED mounted to it and a connection to an I2C controlled audio amplifier through an IDC cable.&amp;nbsp; I'm running at 400,000bps.&amp;nbsp; This is obviously not an optimal situation and I can see where the wiring can cause problems on the line as opposed to a properly terminated line on a PCB - this supposition seems to be supported with what I am observing.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Periodically, the I2C crashes with the SDA line being held low.&amp;nbsp; The OLED *seems* to be holding down the (ie I can see the line being held low and when I pull the OLED, the SDA line goes high again).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the I2C line is down, I pause the application in CW and I find that execution is stuck in I2c_pol_ki2c.c at line 361:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (tmp &amp;amp; I2C_S_BUSY_MASK)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (tmp &amp;amp; I2C_S_IICIF_MASK)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_ptr-&amp;gt;S |= I2C_S_IICIF_MASK;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp = (uint_8)i2c_ptr-&amp;gt;D;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp = i2c_ptr-&amp;gt;S;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This seems to be polling loop for the SDA line to go high.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I hinted at above, with the accelerometer connection through J25 and J26 disconnected, the rate of errors is much less - but it still happens.&amp;nbsp; What is really interesting is that if there is a 'scope probe on the SDA line, the program runs indefinitely (which tells me that it's a termination problem).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My questions are:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; Is there a version of the MQX I2C driver which supports timeouts on the SDA/SCL lines?&amp;nbsp; I didn't want to use the code that was attached to "Using AN4652 - I2C Driver Locks Up" as the discussion was regarding MQX 3.8.1 and I'm working with MQX 4.0&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; Any suggestions on how the line should be terminated?&amp;nbsp; This won't be an issue with the final product, but I want to have a reliable prototyping platform until the PCBs are available.&amp;nbsp; I'm going to try to match the scope termination with 1M resistors to ground.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Apr 2013 17:38:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276916#M8583</guid>
      <dc:creator>myke_predko</dc:creator>
      <dc:date>2013-04-19T17:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.0 I2C Locks Up</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276917#M8584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just a few more datapoints.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried a number of different resistors to ground with no luck on improving the performance of the prototype hardware.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried dropping the data rate, but I found that the code started looping in i2C_int_ki2c.c at line 359:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (0 == (i2c_ptr-&amp;gt;S &amp;amp; I2C_S_IICIF_MASK))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { };&amp;nbsp;&amp;nbsp;&amp;nbsp; /* wait for address transferred */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Apr 2013 18:44:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276917#M8584</guid>
      <dc:creator>myke_predko</dc:creator>
      <dc:date>2013-04-19T18:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.0 I2C Locks Up</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276918#M8585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Myke,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We think MQX 4.0 I2C driver has a sw problem when flushing. I've used the attached patch to fix, it has much improved my test application (running now on my table). Please give it a try (build your BSP with the attached file, then the application) and let me know how that works for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Apr 2013 10:33:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276918#M8585</guid>
      <dc:creator>Martin_</dc:creator>
      <dc:date>2013-04-22T10:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.0 I2C Locks Up</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276919#M8586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Myke&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We also used the i2c polled driver and found that it would hang. My experience is that the best driver to use is the i2c interrupt driven driver in an4652, we have never had it fail as of yet. We previously had the polled driver hang and it was (for us) impossible to code around. All you need is to miss an ACK because of a system function (MQX) and you are done. There is no recovery; it hangs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use the above driver, make sure you get the latest code base. It was updated a few weeks ago. I have spent a lot of time on&amp;nbsp; polled i3c polled driver in Coldfire and Kinetis (using PE and MQX) and couldn't get reliable operation. IMO is just the nature of a polled anything in an interrupt driven OS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2013 01:12:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276919#M8586</guid>
      <dc:creator>Cdn_aye</dc:creator>
      <dc:date>2013-04-25T01:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.0 I2C Locks Up</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276920#M8587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert and Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the replies.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before I implement the code in AN4652, I have a couple of questions:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;In my user_config.h file, I have specified the &lt;STRONG&gt;interrupt&lt;/STRONG&gt; operation of the I2C driver (I am using both I2C ports on the K20) - which I should have noted in my original email, and was surprised to see the polling loop.&amp;nbsp; Will the driver in AN4652 change this to a full interrupt implementation?&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;I notice in the AppNote pdf, that it instructs the user to add the two lines select the II2C0 but NOT the II2C1 (Page 10) - will this fix work for both I2C ports on the K20?&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;Why would I patch the i2c_ki2c.h and init_bsp.c files when there are the same files in the .zip that comes with the AppNote?&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;Robert, you talk about getting the latest code base.&amp;nbsp; According to the "Release Notes", I have 4.0.0 (is there a better source for this information)?&amp;nbsp; If I look at the MQX page, all I see is 4.0 - where do I find the "latest code base" and what are the instructions for installing it?&amp;nbsp; Even if I look here: &lt;A href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MQX&amp;amp;fpsp=1&amp;amp;tab=Design_Tools_Tab" title="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MQX&amp;amp;fpsp=1&amp;amp;tab=Design_Tools_Tab"&gt;Freescale MQX&amp;amp;amp;#8482; Software Solutions Product Summary Page&lt;/A&gt;, I don't see any information on something that was released a few weeks ago.&amp;nbsp;&amp;nbsp; &lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx, I want to make sure this goes as smoothly as possible with minimal switch over time.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2013 03:02:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276920#M8587</guid>
      <dc:creator>myke_predko</dc:creator>
      <dc:date>2013-04-25T03:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.0 I2C Locks Up</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276921#M8588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately I don't have experience with AN4652, I'm happy to hear it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to add to MQX 4.0 i2c driver Ad 1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fix I posted is for interrupt version of the driver. Unfortunately interrupt version uses polling method for flush(). I think it is bad software design.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It can be improved, for example add _time_delay() blocking call in fflush ioctl in the patched source file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another (better) option would be to synchronize with the interrupt routine using lwsem_wait/lwsem_post. The fflush ioctl would call lwsem_wait. The I2C interrupt routine would lwsem_post as soon as it writes the last data byte. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for timeouts, you would need to add them manually around while(1) loops in the i2c driver. Especially around the while loops in the ioctl "flush" and maybe also ioctl "stop", in order to allow master to detect a problem at application level and recover. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We plan to re-desing the i2c driver, as we did previously with spi driver. It is on TODO list.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2013 05:20:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276921#M8588</guid>
      <dc:creator>Martin_</dc:creator>
      <dc:date>2013-04-25T05:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.0 I2C Locks Up</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276922#M8589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Myke&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You turn off the i2c drivers in user_config.h&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my user_config.h; note the II2C0_FB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the K20dx256VLL10&amp;nbsp; although this is the user_config.h for the bsp for the twrk40dx256 because there is no bsp for the k20dx256&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The extra code you mention relates to having the BSP load the driver during the init.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would load the new code for the appnote but I can't see a way to do that for some reason. But it is simple; the code was updated about feb 21 2013. Just do a search for the authors name in the appnote. He added an additional flag check for a certain condition in a status register.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, it is well written and works without problem. Just follow the appnote for building the code. One of the files may have changed location for the build procedure, that is it is on level higher in the directory structure for mqx 4.0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have a problem, post your question and I can show you how to proceed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;P&gt;//====================================================================================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* mandatory CPU identification */&lt;/P&gt;&lt;P&gt;#define MQX_CPU&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PSP_CPU_MK40DX256Z&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define BSP_DEFAULT_IO_CHANNEL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "ittya:"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // rwl, change so printf's not going on BT channel, ittya&lt;/P&gt;&lt;P&gt;#define BSP_DEFAULT_IO_CHANNEL_DEFINED&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_IO_SUBSYSTEM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_II2C0_FB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // interrupt driven i2c driver re-added Feb 19 2013&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_II2C1_FB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* MGCT: &amp;lt;generated_code&amp;gt; */&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_TTYA&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_ITTYA&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;#define BSPCFG_SCI0_BAUD_RATE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9600&lt;/P&gt;&lt;P&gt;#define BSPCFG_SCI0_QUEUE_SIZE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 64&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_TTYB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // defined so printf goes here&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_ITTYB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_TTYC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_ITTYC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_TTYD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_ITTYD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_TTYE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_ITTYE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_TTYF&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_ITTYF&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_I2C0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_II2C0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_I2C1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_II2C1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_SPI0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_ISPI0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_SPI1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_ISPI1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_SPI2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_ISPI2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_RTCDEV&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_II2S0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_IODEBUG&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* pccard shares CS signal with MRAM - opening pccard in user application disables MRAM */&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_PCFLASH&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_ADC0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_ADC1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_FLASHX&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_ESDHC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define BSPCFG_ENABLE_LCD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define MQX_USE_SW_WATCHDOGS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define&amp;nbsp; MQX_USE_TIMER&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;#define MQX_HAS_TIME_SLICE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;#define MQX_USE_IDLE_TASK&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;#define MQX_ENABLE_LOW_POWER&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define RTCSCFG_ENABLE_TCP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;#define SHELLCFG_USES_MFS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;#define SHELLCFG_USES_RTCS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define MQX_KERNEL_LOGGING&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;#define MQX_USE_LOGS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define&amp;nbsp; MQX_ROM_VECTORS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // put vectors in RAM for bootloader&lt;/P&gt;&lt;P&gt;/* MGCT: &amp;lt;/generated_code&amp;gt; */&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2013 06:23:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276922#M8589</guid>
      <dc:creator>Cdn_aye</dc:creator>
      <dc:date>2013-04-25T06:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.0 I2C Locks Up</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276923#M8590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Martin and Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the quick replies.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just a couple of quick ones back:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I have the code from the AppNote - to find it, put in "AN4652" in the search bar, when you get all the options, click on "Documentation" and PDF and zip files come up.&amp;nbsp; The "date last modified" is "3/20/2013".&amp;nbsp; I believe this is the correct one according to what's written above.&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;When I look at Martin's reply, it seems to be a separate one to AN4652 and reading through things, it sounds like AN4652 is the superior solution, correct?&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;Finally, Robert, you mentioned above about getting the latest code base - could you please explain that in more detail?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2013 12:55:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276923#M8590</guid>
      <dc:creator>myke_predko</dc:creator>
      <dc:date>2013-04-25T12:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.0 I2C Locks Up</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276924#M8591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Myke&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just downloaded the appnote zip from Mar 20 2013 and did a comparison and I don't see any difference from the original. I may be overlooking something but I don't think this is the latest code. File i2c_int_k_fb.c, is the only changed file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I uploaded this to this site and it is said to be queued and waiting for scan but I am not sure how to make this available to others...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I just did a search for Guo Jia on this forum and the file you need is attached by him with an explanation; download that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2013 14:05:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276924#M8591</guid>
      <dc:creator>Cdn_aye</dc:creator>
      <dc:date>2013-04-25T14:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.0 I2C Locks Up</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276925#M8592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, use the &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;i2c_int_k_fb.c&lt;/SPAN&gt; driver file found here: &lt;A _jive_internal="true" href="https://community.nxp.com/message/315959#315959"&gt;https://community.freescale.com/message/315959#315959&lt;/A&gt; with the same instructions as in AN4652 which call for the patches to:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I2c_ki2c.h&lt;/LI&gt;&lt;LI&gt;init_bsp.c&lt;/LI&gt;&lt;LI&gt;user_config.h&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, I can use the version of MQX 4.0 that I downloaded without any other changes?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2013 16:55:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276925#M8592</guid>
      <dc:creator>myke_predko</dc:creator>
      <dc:date>2013-04-25T16:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.0 I2C Locks Up</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276926#M8593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Myke&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yes, that is correct&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2013 17:15:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276926#M8593</guid>
      <dc:creator>Cdn_aye</dc:creator>
      <dc:date>2013-04-25T17:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.0 I2C Locks Up</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276927#M8594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert and Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the help - I have installed the update and have run it consistently (ie consistent writes from the K20 to the OLD and I2C based amplifier on the I2C bus for about five hours now without any hangs.)&amp;nbsp; I'm crossing it off my list of issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For people who are looking to get reliable interrupt based I2C communications - this seems like the way to go, but I must warn you; the new driver does not work like the old (or any other driver) - study the code in AN4652 before making your changes.&amp;nbsp; I ended up rewriting all my I2C code and there are some changes to my messaging that I would like to make going forwards to eliminate the need for a separate txBuffer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Robert and Martin there are a few issues that I would like to bring to your attention (and if you put in fixes for them I would appreciate you letting me know):&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;1.&amp;nbsp; I don't believe that I2C writes are correct.&amp;nbsp; When I am sending a byte to a register, there are five write cycles, not the three that I would expect (7 bit slave address + R/W flag, 8 bit register address, 8 bit data for register).&amp;nbsp; Things seem to work but when I look at the waveform on my 'scope, I could see the two additional writes.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;2.&amp;nbsp; Reads appear correct - four byte transfers (with the last one being an unacknowledged read).&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;3.&amp;nbsp; The data rate is one half the specified rate - to get a full 400kbps data rate (2.5us per bit), I had to specify 800kbps to get this actual data rate.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;4.&amp;nbsp; The first screen shots in AN4652 (figure 5 &amp;amp; 6) does not match what would be sent out by the "master" and "slave" code, respectively, in the actual application.&amp;nbsp; It caused me a bit of time to convince myself that it wasn't correct because it would been very time consuming to wire up representative hardware to see the code in operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The steps I took to implement the AN4652 code were:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;1.&amp;nbsp; Shut down CodeWarrior.&amp;nbsp; This was done to make sure the &lt;STRONG&gt;i2c_int_k_fb.c&lt;/STRONG&gt; driver (I used the one attached in this thread) would be in the MQX bsp could be copied into the mqx source code folders.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;2.&amp;nbsp; Copy the &lt;STRONG&gt;i2c_int_k_fb.c&lt;/STRONG&gt; driver into &lt;STRONG&gt;C:\Freescale\Freescale_MQX_4_0\mqx\source\io\i2c\int&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;3.&amp;nbsp; Restart CodeWarrior.&amp;nbsp; When it was up, &lt;STRONG&gt;drag I2C_int_k_fb.c&lt;/STRONG&gt; from C:&lt;STRONG&gt;\Freescale\Freescale_MQX_4_0\mqx\source\io\i2c\int&lt;/STRONG&gt; into the &lt;STRONG&gt;bsp_.../Peripheral IO Drivers/i2c/int&lt;/STRONG&gt; folder.&amp;nbsp; The file should be both part of the MQX project as well as have this location recognized by CodeWarrior.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;4.&amp;nbsp; Add&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;extern uint_32 _ki2c_int_fb_install (char_ptr, KI2C_INIT_STRUCT_CPTR);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;to &lt;STRONG&gt;i2c_ki2c.h&lt;/STRONG&gt; in the "FUNCTION PROTOTYPES" area of the include file (which is found in&lt;STRONG&gt; bsp_.../Peripheral IO Drivers/i2c&lt;/STRONG&gt;).&amp;nbsp; I noted that this was part of "AN4652" in case I had to find it again later.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;5.&amp;nbsp; In, &lt;STRONG&gt;init_bsp.c&lt;/STRONG&gt;, found in &lt;STRONG&gt;bsp_.../twrk... BSP Files&lt;/STRONG&gt;, add the lines (after the I2C definitions and you may want to mark that this is an "AN4652" change as well:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;#if BSPCFG_ENABLE_II2C0_FB&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;_ki2c_int_fb_install("ii2c0fb:", &amp;amp;_bsp_i2c0_init);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;#endif&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;#if BSPCFG_ENABLE_II2C1_FB&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;_ki2c_int_fb_install("ii2c1fb:", &amp;amp;_bsp_i2c1_init);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;#endif&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;6.&amp;nbsp; Open &lt;STRONG&gt;user_config.h&lt;/STRONG&gt; and make sure all the I2C options are "&lt;STRONG&gt;false&lt;/STRONG&gt;" (in the "BSP" tab). &lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;7.&amp;nbsp; Next, click on the "user_config.h" tab to enable the text editor for user_config.h and add the lines to enable the use of AN4652 interrupt based I2C driver (set define to "1" if the I2C port is to be used - in the example below, both are enabled):&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;#define BSPCFG_ENABLE_II2C0_FB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp; // interrupt driven i2c driver re-added Feb 19 2013&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;#define BSPCFG_ENABLE_II2C1_FB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;8.&amp;nbsp; "Clean" and "Build" the bsp project. &lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;9.&amp;nbsp; Modify your application to work with the AN4652 interrupt based driver.&amp;nbsp; Go through the AppNote text and make sure you understand the use of &lt;STRONG&gt;fopen&lt;/STRONG&gt;, &lt;STRONG&gt;ioctl(i2cHandle, IO_IOCTL_I2C_SET_BAUD&lt;/STRONG&gt; (note that this requires 2x the speed that is desired to be specified), &lt;STRONG&gt;fwrite&lt;/STRONG&gt; and &lt;STRONG&gt;fread&lt;/STRONG&gt;. &lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;10.&amp;nbsp; "Clean" and "Build" your application project. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great weekend!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Apr 2013 03:17:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276927#M8594</guid>
      <dc:creator>myke_predko</dc:creator>
      <dc:date>2013-04-27T03:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.0 I2C Locks Up</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276928#M8595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Myke&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good to hear you got it going.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The write &amp;amp; read methodology will normally depend on the device. Some devices require setup of a register pointer to access further registers and support a burst read which auto increments the pointer, other devices like the i2c eeprom example use special write procedures that differ from the RT clocks like the DS1305 for example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as I know the only thing that is defined for i2c as a protocol are the bits in the 9 bit data stream and the relationship within the ACK NACK sequences for the SCL &amp;amp; SDA lines. The implementation of access to the registers is device dependent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Apr 2013 19:03:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276928#M8595</guid>
      <dc:creator>Cdn_aye</dc:creator>
      <dc:date>2013-04-27T19:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.0 I2C Locks Up</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276929#M8596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx for the reply.&amp;nbsp; As I said, the new driver does seem to be reliable (much more reliable than the original driver).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know of any updates to the driver (such as getting the data rate correct).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Apr 2013 15:09:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276929#M8596</guid>
      <dc:creator>myke_predko</dc:creator>
      <dc:date>2013-04-28T15:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.0 I2C Locks Up</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276930#M8597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Myke,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; We are facing some issues with the MQX interrupt mode i2c. We have done all the settings as mentioned in AN4652. When running the code for reading data from a device register,the device is waiting for the condition &lt;/P&gt;&lt;P&gt;if(_lwevent_wait_ticks((LWEVENT_STRUCT_PTR)(&amp;amp;(io_info_ptr-&amp;gt;lwevent_master)), 1, FALSE, 400) == LWEVENT_WAIT_TIMEOUT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Everything will go fine till the call&amp;nbsp; in the Rx_master_ISR,&lt;/P&gt;&lt;P&gt;_lwevent_set((LWEVENT_STRUCT_PTR)(&amp;amp;(io_info_ptr-&amp;gt;lwevent_master)), 1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After this control is going to dispatch.s and lost. Do you have any idea why this is happening? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same device is working fine in polling mode but after some time it will get hangs in &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt; while (tmp &amp;amp; I2C_S_BUSY_MASK)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (tmp &amp;amp; I2C_S_IICIF_MASK)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_ptr-&amp;gt;S |= I2C_S_IICIF_MASK;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp = (uint_8)i2c_ptr-&amp;gt;D;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp = i2c_ptr-&amp;gt;S;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;Because of this issue,i tried using interrupt mode.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;Please help.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;regards,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: 'courier new', courier;"&gt;Kiran&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 15:41:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276930#M8597</guid>
      <dc:creator>kirankunnath</dc:creator>
      <dc:date>2014-05-19T15:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.0 I2C Locks Up</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276931#M8598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that it's fairly well established that the int I2C handler code that comes with the MQX 4.0.0 and earlier (I don't know the exact status of what will be available for 4.1.0 and 5.0) don't work and you have to replace the code with the "i2c_int_k_fb.c" file that is linked to above.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my bsp documentation, below are the steps that I go through.&amp;nbsp; This is for using both I2C devices in a K20.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;1. Shut down CW.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2. Copy &lt;SPAN style="color: red;"&gt;i2c_int_k_fb.c&lt;/SPAN&gt; into &lt;SPAN style="color: red;"&gt;C:\Freescale\Freescale_MQX_4_0\mqx\source\io\i2c\int&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;3. Edit &lt;SPAN style="color: red;"&gt;j20&lt;/SPAN&gt; in &lt;SPAN style="color: red;"&gt;C:\Freescale\Freescale_MQX_4_0\mqx\source\bsp\j20&lt;/SPAN&gt; and add the lines after the “&lt;SPAN style="color: red;"&gt;** Interrupt-driver I2C1 device&lt;/SPAN&gt;”:&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;/*&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;** Enhanced Interrupt-driven I2C0 device&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;** MGCT: &amp;lt;option type="bool"/&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;#ifndef &lt;SPAN style="background: white;"&gt;BSPCFG_ENABLE_II2C0_FB&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define &lt;SPAN style="background: white;"&gt;BSPCFG_ENABLE_II2C0_FB&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;#endif&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;/*&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;** Enhanced Interrupt-driven I2C1 device&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;** MGCT: &amp;lt;option type="bool"/&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;#ifndef &lt;SPAN style="background: white;"&gt;BSPCFG_ENABLE_II2C1_FB&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define &lt;SPAN style="background: white;"&gt;BSPCFG_ENABLE_II2C1_FB&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;#endif&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;4. Edit &lt;SPAN style="color: red;"&gt;user_config.h&lt;/SPAN&gt; in &lt;SPAN style="color: red;"&gt;C:\Freescale\Freescale_MQX_4_0\config\j20&lt;/SPAN&gt; and add the lines after the “&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;#define BSPCFG_ENABLE_II2C1&lt;/SPAN&gt;”:&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;#define BSPCFG_ENABLE_II2C0_FB 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt;#define BSPCFG_ENABLE_II2C1_FB 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;5. Restart CW.&amp;nbsp; &lt;/P&gt;&lt;P&gt;6. Drag &lt;SPAN style="color: red;"&gt;i2c_int_k_fb.c&lt;/SPAN&gt; from &lt;SPAN style="color: red;"&gt;C:\Freescale\Freescale_MQX_4_0\mqx\source\io\i2c\int&lt;/SPAN&gt; into CW’s &lt;SPAN style="color: red;"&gt;bsp_j20\Peripheral IO Drivers\i2c\int&lt;/SPAN&gt; project&lt;/P&gt;&lt;P&gt;7. In &lt;SPAN style="color: red;"&gt;i2c_ki2c.h&lt;/SPAN&gt; found in CW’s &lt;SPAN style="color: red;"&gt;bsp_j20\Peripheral IO Drivers\i2c&lt;/SPAN&gt; project, in the “&lt;SPAN style="color: red;"&gt;Function Prototypes&lt;/SPAN&gt;” area, add the line:&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: red; background: white; font-family: 'Courier New';"&gt;extern uint_32 _ki2c_int_fb_install (char_ptr, KI2C_INIT_STRUCT_CPTR);&lt;/STRONG&gt;&lt;STRONG style="font-size: 10pt; line-height: 1.5em;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;8. In &lt;SPAN style="color: red;"&gt;init_bsp.c&lt;/SPAN&gt; found in CW’s &lt;SPAN style="color: red;"&gt;bsp_j20\j20 BSP Files&lt;/SPAN&gt; project, after the check for &lt;SPAN style="font-family: 'Courier New';"&gt;“&lt;SPAN style="color: red;"&gt;BSPCFG_ENABLE_II2C1&lt;/SPAN&gt;” add the lines:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red; background: white;"&gt;#if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: red; background: white;"&gt; BSPCFG_ENABLE_II2C0_FB&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red; background: white;"&gt;_ki2c_int_fb_install("ii2c0fb:", &amp;amp;_bsp_i2c0_init);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red; background: white;"&gt;#endif&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red; background: white;"&gt;#if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: red; background: white;"&gt; BSPCFG_ENABLE_II2C1_FB&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red; background: white;"&gt;_ki2c_int_fb_install("ii2c1fb:", &amp;amp;_bsp_i2c1_init);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: red; background: white;"&gt;#endif&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;9. Open &lt;SPAN style="color: red;"&gt;user_config.h&lt;/SPAN&gt; in CW and set the I2C options as:&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: red; font-family: 'Courier New';"&gt;#define&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt; BSPCFG_ENABLE_I2C0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: red; font-family: 'Courier New';"&gt;#define&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt; BSPCFG_ENABLE_I2C1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: red; font-family: 'Courier New';"&gt;#define&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt; BSPCFG_ENABLE_II2C0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: red; font-family: 'Courier New';"&gt;#define&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt; BSPCFG_ENABLE_II2C1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: red; font-family: 'Courier New';"&gt;#define&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt; BSPCFG_ENABLE_II2C0_FB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: red; font-family: 'Courier New';"&gt;#define&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: red;"&gt; BSPCFG_ENABLE_II2C1_FB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;10. Build the &lt;SPAN style="color: red;"&gt;j20&lt;/SPAN&gt; libraries:&lt;/P&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;- PSP&lt;/LI&gt;&lt;LI&gt;- BSP&lt;/LI&gt;&lt;LI&gt;- MFS&lt;/LI&gt;&lt;LI&gt;- RTCS&lt;/LI&gt;&lt;LI&gt;- Shell&lt;/LI&gt;&lt;LI&gt;- USB Device&lt;/LI&gt;&lt;LI&gt;- USB Host&lt;/LI&gt;&lt;/UL&gt;&lt;/OL&gt;&lt;P&gt;11. Ready to create applications which use the enhanced I2C libraries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry it's a lot of work - but I tried multiple options and this is the one that works.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 16:22:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276931#M8598</guid>
      <dc:creator>myke_predko</dc:creator>
      <dc:date>2014-05-19T16:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.0 I2C Locks Up</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276932#M8599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this fix needed in MQX 4.1?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Colin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2014 16:48:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276932#M8599</guid>
      <dc:creator>c_dawg</dc:creator>
      <dc:date>2014-07-31T16:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.0 I2C Locks Up</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276933#M8600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the fix for the bug appears in MQX 4.0.2. However, the fix above is only for Kinetis specific file, so it is possible that ColdFire files are still affected. If so, copy IO_IOCTL_FLUSH_OUTPUT code from the Kinetis file to the ColdFire file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Aug 2014 04:31:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276933#M8600</guid>
      <dc:creator>Martin_</dc:creator>
      <dc:date>2014-08-01T04:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.0 I2C Locks Up</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276934#M8601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that in Myke Predko's response to your query above, he repeated the correct instructions for installing and calling the AN4652 driver, but I didn't see any answer to your question concerning the lwevent_wait_ticks() timeout, or the issue with a scheduler context switch. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you ever determine what was causing the MQX scheduler (in dispatch.S) to perform a context switch in your i2c_int_k_fb.c code when the _ki2c_isr made a call to _lwevent_set()? And did your code in _fb_rx_master receive the event using _lwevent_wait_ticks without timing out? If there was a timeout, was the code following the if statement executed without a context switch?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have modified our version of the __fb_rx_master() and __fb_tx_master() which attempts to do a i2c bus reset (bin-banging the SCL/SDA lines as GPIOs to send clocks to the slave to release the SDA line if held low). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I did notice that there seems to be a missing "return 0;" statement in _fb_tx_master() function for the timeout condition. We assume that there should be a "return 0;"&amp;nbsp; statement here in a similar fashion to the code _fb_rx_master() where it handles the timeout for the _lwevent_wait_ticks call. We also have added code to do a forced i2c bus reset and to send a slave stop condition when the event timeouts occur (indicating that the ISR returned prematurely without sending an event due to the SLTF or SHTF2 flag bits in the SMB register indicating a SCL Low timeout or SDA Low timeout being set ).&amp;nbsp; Can you confirm if the driver should be doing a return after the timeout without falling through to the code below the if-block?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static uint_32 _fb_rx_master ( FB_VKI2C_INFO_STRUCT_PTR io_info_ptr, I2C_MemMapPtr i2c_ptr, uchar_ptr buffer, uint_32 length )&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; //if(i2c_ptr-&amp;gt;S &amp;amp; I2C_S_BUSY_MASK)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; length = I2C_FB_DATA_LEN(length);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; io_info_ptr-&amp;gt;data = buffer;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; io_info_ptr-&amp;gt;data_len = length;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; io_info_ptr-&amp;gt;index = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; io_info_ptr-&amp;gt;index_rx_tx = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; io_info_ptr-&amp;gt;index_repeat_start = REPEAT_INDEX_RX;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; i2c_ptr-&amp;gt;C1 |= 0x80;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; _start(i2c_ptr);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; io_info_ptr-&amp;gt;index++;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; i2c_ptr-&amp;gt;D = (io_info_ptr-&amp;gt;data[io_info_ptr-&amp;gt;index - 1] &amp;lt;&amp;lt; 1) | I2C_OPERATION_WRITE; // send address&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; // wait 1000 ticks --&amp;gt; 5 sec (maximum) for the transaction to end&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;&amp;nbsp;&amp;nbsp; if (_lwevent_wait_ticks((LWEVENT_STRUCT_PTR)(&amp;amp;(io_info_ptr-&amp;gt;lwevent_master)), 1, FALSE, 1000) == LWEVENT_WAIT_TIMEOUT)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_ptr-&amp;gt;C1 &amp;amp;= 0x7f;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_ptr-&amp;gt;C1 |= 0x80;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clock_out_slave();&amp;nbsp;&amp;nbsp; // Bit-bang SCL/SDA lines to perform I2C reset to clock out slave if necessary&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _stop(i2c_ptr);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Send a slave stop condition&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; i2c_ptr-&amp;gt;C1 &amp;amp;= 0x7f;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if (io_info_ptr-&amp;gt;index_rx_tx &amp;lt; 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return io_info_ptr-&amp;gt;index_rx_tx - 1;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static uint_32 _fb_tx_master ( FB_VKI2C_INFO_STRUCT_PTR io_info_ptr, I2C_MemMapPtr i2c_ptr, uchar_ptr buffer, uint_32 length )&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; i2c_ptr = io_info_ptr-&amp;gt;i2c_ptr;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; io_info_ptr-&amp;gt;data = buffer;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; io_info_ptr-&amp;gt;data_len = I2C_FB_DATA_LEN(length);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; io_info_ptr-&amp;gt;index = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; io_info_ptr-&amp;gt;index_rx_tx = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; io_info_ptr-&amp;gt;index_repeat_start = REPEAT_INDEX_TX_NOT_USED; //ylly we do not want repeated start&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; io_info_ptr-&amp;gt;buf_x_stop[0] = io_info_ptr-&amp;gt;data[0]; // record dst i2c slave address&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; i2c_ptr-&amp;gt;C1 |= 0x80;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; _start(i2c_ptr);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; io_info_ptr-&amp;gt;index++;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; i2c_ptr-&amp;gt;D = (io_info_ptr-&amp;gt;data[io_info_ptr-&amp;gt;index - 1] &amp;lt;&amp;lt; 1) | I2C_OPERATION_WRITE; // send address&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;&amp;nbsp;&amp;nbsp; // wait 1000 ticks --&amp;gt; 5 sec (maximum) for the transaction to end&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;&amp;nbsp;&amp;nbsp; if (_lwevent_wait_ticks((LWEVENT_STRUCT_PTR)(&amp;amp;(io_info_ptr-&amp;gt;lwevent_master)), 1, FALSE, 1000) != MQX_OK)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_ptr-&amp;gt;C1 &amp;amp;= 0x7f;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i2c_ptr-&amp;gt;C1 |= 0x80;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clock_out_slave();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Bit-bang SCL/SDA lines to perform I2C reset to clock out slave if necessary&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _stop(i2c_ptr);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Send a slave stop condition&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // In the original patched code from Guo Jia - this line ( "return 0;" ) was missing - I assume that&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // it should be here (similar to _fb_rx_master function) to prevent falling through this if block to the lines below???&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; i2c_ptr-&amp;gt;C1 &amp;amp;= 0x7f;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if (io_info_ptr-&amp;gt;index_rx_tx &amp;lt; 2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return io_info_ptr-&amp;gt;index_rx_tx - 2;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I look forward to your comments.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2015 20:48:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276934#M8601</guid>
      <dc:creator>gordonfinlay</dc:creator>
      <dc:date>2015-06-01T20:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.0 I2C Locks Up</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276935#M8602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;I want to know whether the i2c lockup is removed in mqx4.2? Im working on K65 and trying to interface AFE4404 with K65 via I2C. The code is getting hanged after single write. I tried the same with capacitive touch panel and the same issue happened.Can anyone helps me to solve this issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2016 05:40:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-0-I2C-Locks-Up/m-p/276935#M8602</guid>
      <dc:creator>shikhasuresh</dc:creator>
      <dc:date>2016-02-25T05:40:20Z</dc:date>
    </item>
  </channel>
</rss>

