<?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: What am I missing, FRDM-KL25Z, Desire Debug and Serial comms. in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-am-I-missing-FRDM-KL25Z-Desire-Debug-and-Serial-comms/m-p/204364#M3084</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Hi Peter,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Your answer that &lt;SPAN style="background-color: #ffffff;"&gt;&lt;STRONG&gt;DEBUG-APP_Pemicro_v102.SDA&lt;/STRONG&gt;&amp;nbsp; does support &lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;USB CDC serial comms contradicts&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; background-color: #ffffff;"&gt;item B in my original post.&amp;nbsp; So that's where I started looking.&amp;nbsp; Eventually I uninstalled the device drivers&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; background-color: #ffffff;"&gt;and re-installed them, and now I see both the Debug port and the Comms port in the Windows device&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; background-color: #ffffff;"&gt;manager display. Once I got to this point I was able to get back to debugging my program, and also&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; background-color: #ffffff;"&gt;having serial output to a console terminal.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; background-color: #ffffff;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; background-color: #ffffff;"&gt;Philip&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Dec 2012 00:14:03 GMT</pubDate>
    <dc:creator>philipfreidin</dc:creator>
    <dc:date>2012-12-14T00:14:03Z</dc:date>
    <item>
      <title>What am I missing, FRDM-KL25Z, Desire Debug and Serial comms.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-am-I-missing-FRDM-KL25Z-Desire-Debug-and-Serial-comms/m-p/204360#M3080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's what I have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FRDM-KL25Z&lt;/P&gt;&lt;P&gt;Keil MDK 4.60&lt;/P&gt;&lt;P&gt;CMSIS-DAP_OpenSDA.S19&lt;/P&gt;&lt;P&gt;DEBUG-APP_Pemicro_v102.SDA&lt;/P&gt;&lt;P&gt;MSD-FRDM-KL25Z_Pemicro_v107.SDA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want is to be able debug a program and have serial&lt;/P&gt;&lt;P&gt;communications through the same USB cable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's what I have achieved:&lt;/P&gt;&lt;P&gt;A) CMSIS-DAP_OpenSDA.S19&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Can download and run/debug app, but no serial comms.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B) DEBUG-APP_Pemicro_v102.SDA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Can download and run/debug app, but no serial comms.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C) MSD-FRDM-KL25Z_Pemicro_v107.SDA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Can drag/drop to download and run, serial comms works,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; but no debug. Only the pre-compiled .srec files .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Keil compiler generates HEX or AFX files that can't be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drag/drop and since no debug, compiler download does&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; not work. So can't create new apps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there an SDA that supports debug and comms?&lt;/P&gt;&lt;P&gt;Am I doing something wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On a separate note, there seems to be two totally different&lt;/P&gt;&lt;P&gt;ways of referring to registers:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The examples for this board that are part of the Keil install&lt;/P&gt;&lt;P&gt;(Blinky) looks like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SIM-&amp;gt;SCGC5&amp;nbsp;&amp;nbsp;&amp;nbsp; |= (1UL &amp;lt;&amp;lt;&amp;nbsp; 10) | (1UL &amp;lt;&amp;lt;&amp;nbsp; 12);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORTB-&amp;gt;PCR[18] = (1UL &amp;lt;&amp;lt;&amp;nbsp; 8);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Freescale KL25_Sample_Code.exe unpacks to a pile&lt;/P&gt;&lt;P&gt;of directories. In the klxx-sc-baremetal source files it looks&lt;/P&gt;&lt;P&gt;like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SIM_SCGC5 |= (SIM_SCGC5_PORTA_MASK)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why are there two styles? Which should I use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On another separate note, I can't find an example directory&lt;/P&gt;&lt;P&gt;for a Keil version of demo program that the board is shipped with.&lt;/P&gt;&lt;P&gt;I did an IAR version:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; kl25_sc\klxx-sc-baremetal\build\iar\FRDM_KL25ZDemo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 20:11:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-am-I-missing-FRDM-KL25Z-Desire-Debug-and-Serial-comms/m-p/204360#M3080</guid>
      <dc:creator>philipfreidin</dc:creator>
      <dc:date>2012-12-11T20:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: What am I missing, FRDM-KL25Z, Desire Debug and Serial comms.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-am-I-missing-FRDM-KL25Z-Desire-Debug-and-Serial-comms/m-p/204361#M3081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;this tutorial/demo shows how to debug and to do serial communication through the OpenSDA USB cable:&lt;/P&gt;&lt;P&gt;&lt;A href="http://mcuoneclipse.com/2012/08/05/a-shell-for-the-freedom-kl25z-board/" title="http://mcuoneclipse.com/2012/08/05/a-shell-for-the-freedom-kl25z-board/"&gt;A Shell for the Freedom KL25Z Board | MCU on Eclipse&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 20:20:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-am-I-missing-FRDM-KL25Z-Desire-Debug-and-Serial-comms/m-p/204361#M3081</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2012-12-11T20:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: What am I missing, FRDM-KL25Z, Desire Debug and Serial comms.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-am-I-missing-FRDM-KL25Z-Desire-Debug-and-Serial-comms/m-p/204362#M3082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Philip&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Both the &lt;SPAN style="background-color: #ffffff;"&gt;&lt;STRONG&gt;DEBUG-APP_Pemicro_v102.SDA&lt;/STRONG&gt; and &lt;STRONG style="background-color: #ffffff;"&gt;MSD-FRDM-KL25Z_Pemicro_v105.SDA&lt;/STRONG&gt; applications support USB CDC serial comms (via the KL25's UART0 to the K20 SDA MCU on the Freedom board). &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; background-color: #ffffff;"&gt;The &lt;STRONG style="background-color: #ffffff;"&gt;CMSIS-DAP_OpenSDA.S19&lt;/STRONG&gt; debug App however does &lt;SPAN style="text-decoration: underline;"&gt;not&lt;/SPAN&gt; include a USB CDC serial driver at this time but my understanding is that it will do so in future version of this SDA App...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-size: 12pt;"&gt;More on OpenSDA at: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;A href="http://www.freescale.com/files/32bit/doc/user_guide/OPENSDAUG.pdf" title="http://www.freescale.com/files/32bit/doc/user_guide/OPENSDAUG.pdf"&gt;http://www.freescale.com/files/32bit/doc/user_guide/OPENSDAUG.pdf&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;The differences between the SDA applications are covered in detail in Avnet's Kinetis-L hands-on Speedway Workshops! :-)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;A href="http://www.em.avnet.com/KinetisLSpeedway"&gt;http://www.em.avnet.com/KinetisLSpeedway&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;Peter&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Dec 2012 12:48:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-am-I-missing-FRDM-KL25Z-Desire-Debug-and-Serial-comms/m-p/204362#M3082</guid>
      <dc:creator>peter_fenn</dc:creator>
      <dc:date>2012-12-12T12:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: What am I missing, FRDM-KL25Z, Desire Debug and Serial comms.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-am-I-missing-FRDM-KL25Z-Desire-Debug-and-Serial-comms/m-p/204363#M3083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply and link to your blog site. I have spent several hours reading your excellent&lt;/P&gt;&lt;P&gt;articles/tutorials.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The underlying problem though is that in my original post I wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B) DEBUG-APP_Pemicro_v102.SDA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Can download and run/debug app, but no serial comms.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and this is incorrect. I have now got this going. See my response below to Peter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On a more tragic note, I just spent about 10 hours trying to debug the I2C link to the MMA8451 on my&lt;/P&gt;&lt;P&gt;board, with the link hanging up at random times. I eventually found it was related to the way the&lt;/P&gt;&lt;P&gt;I2C clock was created (choice of the various control values). Even creating the same frequency but&lt;/P&gt;&lt;P&gt;with different combinations of control values could cause a success or failure. Then I found your&lt;/P&gt;&lt;P&gt;article describing this &lt;A href="http://mcuoneclipse.com/2012/12/05/kl25z-and-i2c-missing-repeated-start-condition/"&gt;problem&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case anyone else is having this problem, I found the following works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Crystal is 8MHz , CPU clock is 48 MHz, Bus Clock is 24 MHz&lt;/P&gt;&lt;P&gt;I2C0 F register (@ 0x6000_6001) value is 0x14 Mult field is 0b00 -&amp;gt; mul = 1&lt;/P&gt;&lt;P&gt;and ICR is 0b010100&amp;nbsp; which gives an SCL divider value of 80&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus 24MHz/80 = 300KHz for SCL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, various examples I found have a delay/pause at the end of each read or write&lt;/P&gt;&lt;P&gt;sequence. I adjusted the delay to be 20us so the gap between each sequence is&lt;/P&gt;&lt;P&gt;real obvious on an oscilloscope.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2012 00:03:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-am-I-missing-FRDM-KL25Z-Desire-Debug-and-Serial-comms/m-p/204363#M3083</guid>
      <dc:creator>philipfreidin</dc:creator>
      <dc:date>2012-12-14T00:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: What am I missing, FRDM-KL25Z, Desire Debug and Serial comms.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-am-I-missing-FRDM-KL25Z-Desire-Debug-and-Serial-comms/m-p/204364#M3084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Hi Peter,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Your answer that &lt;SPAN style="background-color: #ffffff;"&gt;&lt;STRONG&gt;DEBUG-APP_Pemicro_v102.SDA&lt;/STRONG&gt;&amp;nbsp; does support &lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;USB CDC serial comms contradicts&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; background-color: #ffffff;"&gt;item B in my original post.&amp;nbsp; So that's where I started looking.&amp;nbsp; Eventually I uninstalled the device drivers&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; background-color: #ffffff;"&gt;and re-installed them, and now I see both the Debug port and the Comms port in the Windows device&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; background-color: #ffffff;"&gt;manager display. Once I got to this point I was able to get back to debugging my program, and also&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; background-color: #ffffff;"&gt;having serial output to a console terminal.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; background-color: #ffffff;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; background-color: #ffffff;"&gt;Philip&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2012 00:14:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-am-I-missing-FRDM-KL25Z-Desire-Debug-and-Serial-comms/m-p/204364#M3084</guid>
      <dc:creator>philipfreidin</dc:creator>
      <dc:date>2012-12-14T00:14:03Z</dc:date>
    </item>
  </channel>
</rss>

