<?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: I2C stops working if Segger or CMSIS-DAP is used in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-stops-working-if-Segger-or-CMSIS-DAP-is-used/m-p/392445#M21404</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jan Rychter:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to confirm, does the issue only happen in Debug mode or also in standalone mode?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you share a binary or even better the I2C test project to investigate this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At this moment I cannot think of the reason, but if it's in Debug mode then we have seen issues for example with the NMI pin, as explained in the next post:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-244787"&gt;Interrupts appear to be disabled when debugging.pdf&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Jorge Gonzalez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Nov 2015 22:51:35 GMT</pubDate>
    <dc:creator>Jorge_Gonzalez</dc:creator>
    <dc:date>2015-11-09T22:51:35Z</dc:date>
    <item>
      <title>I2C stops working if Segger or CMSIS-DAP is used</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-stops-working-if-Segger-or-CMSIS-DAP-is-used/m-p/392444#M21403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the process of bringing up my board based on a K20, I encountered problems with I2C. I would initialize I2C and load the first address byte, but then I'd get no interrupts, ever.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This was strange, because the I2C code is my own (&lt;A href="https://github.com/jwr/kinetis_i2c/tree/cmsis"&gt;https://github.com/jwr/kinetis_i2c/tree/cmsis&lt;/A&gt;), and I used it before with no problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using KDS 3.0.0 (updated) under Linux, with Segger J-Link to connect to my board.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I started looking at my recent code changes, clocking, all kinds of possible problems. I also took out a FRDM-K20D50M board (Segger debug firmware) just to be sure that I can reproduce the problem in a pristine environment. The problem was the same on the FRDM board.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I brought up an old virtual machine with CodeWarrior 5.5 and some old I2C project that used to work — same result, none of them worked. I was sure they worked before. This was getting weird.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In an act of desperation, I decided to reflash the OpenSDA part of the FRDM-K20D50M, just to see if using the P&amp;amp;E debug firmware would give me a better view of the registers. This took quite a while, because I had an old 1.09 bootloader, which can't be updated using any modern OS. Luckily I had an ancient VMware snapshot with Windows XP!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And suddenly things started working again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did some more testing and I don't understand the results. Here's a breakdown:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;my board + Segger J-Link -&amp;gt; I2C does not work&lt;/LI&gt;&lt;LI&gt;FRDM + Segger firmware -&amp;gt; I2C does not work&lt;/LI&gt;&lt;LI&gt;FRDM + P&amp;amp;E firmware -&amp;gt; I2C &lt;STRONG&gt;works&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;FRDM + bootloader only (booted in firmware update mode) -&amp;gt; I2C &lt;STRONG&gt;works&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;FRDM + CMSIS-DAP firmware -&amp;gt; I2C does not work&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the FRDM board, it seems that just the presence of Segger or CMSIS-DAP firmware prevents I2C from working. It doesn't matter if I'm debugging — just hitting RESET with P&amp;amp;E firmware present produces an I2C transaction, and with Segger or CMSIS-DAP firmware present it does not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When stepping through the code, everything looks fine up to a certain point. I2C module is initialized, interrupts get enabled, master mode is set and a start condition generated. But then I write to the D register and... nothing happens. I get no interrupts. A bus sniffer shows only a start condition being generated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The firmware versions I used for testing are: JLink_OpenSDA_2015-10-13.sda, CMSIS-DAP_OpenSDA.S19, MSD-DEBUG-FRDM-K20D50M_Pemicro_v115.SDA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Frankly, I have no idea what to make of this, which is why I'm asking for help. Leaving aside my board for now, on the FRDM — I can't understand how just the presence of certain OpenSDA debug firmware could influence how my code works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2015 20:16:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-stops-working-if-Segger-or-CMSIS-DAP-is-used/m-p/392444#M21403</guid>
      <dc:creator>jrychter</dc:creator>
      <dc:date>2015-11-06T20:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: I2C stops working if Segger or CMSIS-DAP is used</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-stops-working-if-Segger-or-CMSIS-DAP-is-used/m-p/392445#M21404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jan Rychter:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to confirm, does the issue only happen in Debug mode or also in standalone mode?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you share a binary or even better the I2C test project to investigate this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At this moment I cannot think of the reason, but if it's in Debug mode then we have seen issues for example with the NMI pin, as explained in the next post:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-244787"&gt;Interrupts appear to be disabled when debugging.pdf&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Jorge Gonzalez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Nov 2015 22:51:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-stops-working-if-Segger-or-CMSIS-DAP-is-used/m-p/392445#M21404</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-11-09T22:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: I2C stops working if Segger or CMSIS-DAP is used</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-stops-working-if-Segger-or-CMSIS-DAP-is-used/m-p/392446#M21405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I only tested with a debugger connected — so I do not know if the same thing happens without a debugger (if that's what you mean by standalone mode).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The NMI issue explanation would actually fit, but another part of the code uses DMA and DMA0_IRQHandler does get called just fine. It's just I2C that doesn't seem to work. From what I understand, a hanging NMI exception would disable all interrupts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess I have to extract a minimal example, then.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 08:48:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-stops-working-if-Segger-or-CMSIS-DAP-is-used/m-p/392446#M21405</guid>
      <dc:creator>jrychter</dc:creator>
      <dc:date>2015-11-10T08:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: I2C stops working if Segger or CMSIS-DAP is used</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-stops-working-if-Segger-or-CMSIS-DAP-is-used/m-p/392447#M21406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I extracted a minimal example. I tried running this on a FRDM-K20D50M, with two debug configurations:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Segger J-Link OpenSDA firmware&lt;/P&gt;&lt;P&gt;2. PEMicro OpenSDA firmware.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I set a breakpoint in the I2C0_IRQHandler. In the first case, the handler never gets called. In the second case, it does get called several times, as it should, and the device_id variable in the main() function contains the correct value 0x1a (as read from the on-board accelerometer).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The entire project (including the binaries) is at:&lt;/P&gt;&lt;P&gt;&lt;A href="https://dl.dropboxusercontent.com/u/448282/I2C%20Debug.tar.gz"&gt;https://dl.dropboxusercontent.com/u/448282/I2C%20Debug.tar.gz&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 09:16:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-stops-working-if-Segger-or-CMSIS-DAP-is-used/m-p/392447#M21406</guid>
      <dc:creator>jrychter</dc:creator>
      <dc:date>2015-11-10T09:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: I2C stops working if Segger or CMSIS-DAP is used</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-stops-working-if-Segger-or-CMSIS-DAP-is-used/m-p/392448#M21407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jan:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just as an update, I found the same issue as you, but this is related to the debug interface application and I've not found the time to investigate further. For the J-Link case, the code works if I connect the Freedom board in BOOTLOADER mode (pressing reset while connecting the board).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the meantime you can go with the P&amp;amp;E interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;BR /&gt;Jorge Gonzalez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2015 02:20:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-stops-working-if-Segger-or-CMSIS-DAP-is-used/m-p/392448#M21407</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-11-17T02:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: I2C stops working if Segger or CMSIS-DAP is used</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-stops-working-if-Segger-or-CMSIS-DAP-is-used/m-p/392449#M21408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jorge,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the FRDM board I can use the P&amp;amp;E interface, but I don't have that option with my own boards, as I can only connect to them using a Segger J-Link. So I'd really like to get to the bottom of this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm glad you could reproduce the problem — any chance you will investigate further?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks and best regards,&lt;/P&gt;&lt;P&gt;--Jan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2015 12:00:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-stops-working-if-Segger-or-CMSIS-DAP-is-used/m-p/392449#M21408</guid>
      <dc:creator>jrychter</dc:creator>
      <dc:date>2015-11-19T12:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: I2C stops working if Segger or CMSIS-DAP is used</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-stops-working-if-Segger-or-CMSIS-DAP-is-used/m-p/392450#M21409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wonder — have you found any time to look at this? It is a showstopper for one of my projects, where I can't use a FRDM board.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Dec 2015 16:55:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-stops-working-if-Segger-or-CMSIS-DAP-is-used/m-p/392450#M21409</guid>
      <dc:creator>jrychter</dc:creator>
      <dc:date>2015-12-19T16:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: I2C stops working if Segger or CMSIS-DAP is used</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-stops-working-if-Segger-or-CMSIS-DAP-is-used/m-p/392451#M21410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems that the KDS 3.1.0 update fixed the problem — at least with a Segger J-Link I2C started working again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Dec 2015 08:53:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-stops-working-if-Segger-or-CMSIS-DAP-is-used/m-p/392451#M21410</guid>
      <dc:creator>jrychter</dc:creator>
      <dc:date>2015-12-23T08:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: I2C stops working if Segger or CMSIS-DAP is used</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-stops-working-if-Segger-or-CMSIS-DAP-is-used/m-p/392452#M21411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jan:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry, I was in PTO. I could not get any further finding the cause of this issue. It's good to know you got J-Link working with the new update.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've seen you have another post related to FRDM-K22F (&lt;A _jive_internal="true" href="https://community.nxp.com/thread/382600"&gt;&lt;STRONG&gt;here&lt;/STRONG&gt;&lt;/A&gt;). I am not very knowledgeable in the workings of GDB but I hope Erich can give you some good hints.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you have a good New Year!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Jorge Gonzalez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Dec 2015 21:00:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I2C-stops-working-if-Segger-or-CMSIS-DAP-is-used/m-p/392452#M21411</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-12-28T21:00:55Z</dc:date>
    </item>
  </channel>
</rss>

