<?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>Kinetis MicrocontrollersのトピックRe: Debugging issue with FRDM-KE02Z40M</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debugging-issue-with-FRDM-KE02Z40M/m-p/351521#M17399</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like you haven't enabled the clock for FTM0, so you get a bus-fault on any access, that may take effect immediately or 'after a couple clocks' with Cortex write-buffering.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Nov 2014 16:45:23 GMT</pubDate>
    <dc:creator>egoodii</dc:creator>
    <dc:date>2014-11-19T16:45:23Z</dc:date>
    <item>
      <title>Debugging issue with FRDM-KE02Z40M</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debugging-issue-with-FRDM-KE02Z40M/m-p/351520#M17398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two FRDM boards, and both exhibit the same behavior. If I run the sample programs provided by Freescale, using the IAR toolchain, they generally seen to to do what they are supposed to. However - I have tried a variety of small projects that use the FTM, and all do the same thing - when I build and debug, the debugger interface comes up as expected, and I click the "run" button. Nothing happens on the FRDM board. If I click the"halt" button on the debugger, it is always stalled at one of two places - either the "default isr" in vectors.c, or whatever the FIRST line of code is that calls an FTM setting.&lt;/P&gt;&lt;P&gt;For example, I have a line: FTM0_MODE = 4; If this is the first call to the FTM, the program will stall/crash here. If I click the halt button, it will stop at this line. If I click the single-step enter button, the debugfger shows a 'run" condition (i.e. it doesn't step, it's as if I clicked the "run" button) and if I click "halt" again, it will be at the start of that line. If I switch to the assembler mode, and click the single step enter button, it will immediately jump to the default_isr in vectors.c, and then alternate between the default_isr function and the LAST line of the assembler function (STR R1, [R0]).&lt;/P&gt;&lt;P&gt;If I comment out the FTM0_MODE line, then the program will run until it encounters another FTM access, then stall in the same way.&lt;/P&gt;&lt;P&gt;I am totally stumped here, and need some help, as my ultimate application depends very heavily on the FTM. Below is a sample of what I'm trying:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* timer_int_setup.c tests various timer interrupt &amp;amp; counting functions */&lt;/P&gt;&lt;P&gt;#include "common.h"&lt;/P&gt;&lt;P&gt;#include "ftm.h"&lt;/P&gt;&lt;P&gt;#include "wdog.h"&lt;/P&gt;&lt;P&gt;//#include "rtc.h"&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;int main (void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;uint16_t counter;&lt;/P&gt;&lt;P&gt;uint32_t temp;&lt;/P&gt;&lt;P&gt;wdog_disable();&lt;/P&gt;&lt;P&gt;typedef struct&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint8_t Port0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint8_t Port1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint8_t Port2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint8_t Port3;&lt;/P&gt;&lt;P&gt;} fourBytes;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;typedef struct&lt;/P&gt;&lt;P&gt; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; uint16_t dbyte0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; uint16_t dbyte1;&lt;/P&gt;&lt;P&gt; } twoDbyte;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; union {&lt;/P&gt;&lt;P&gt;&amp;nbsp; fourBytes portBytes;&lt;/P&gt;&lt;P&gt;&amp;nbsp; twoDbyte port16;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint32_t portWord;&lt;/P&gt;&lt;P&gt;}PORTA;&lt;/P&gt;&lt;P&gt;&amp;nbsp; temp = FTM0_FMS; &lt;SPAN style="color: #ff0000;"&gt;WILL STALL HERE, UNLESS COMMENTED OUT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTM0_MODE = 4; // set WPDIS bit &lt;SPAN style="color: #ff0000;"&gt;WILL STALL HERE, UNLESS COMMENTED OUT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; GPIOA_PDDR = 0xffffffff; /* all ones for outputs */&lt;/P&gt;&lt;P&gt;&amp;nbsp; counter = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTM0_SC = 0x0000000f; // set for system clock, /128 &lt;SPAN style="color: #ff0000;"&gt;WILL STALL HERE, UNLESS COMMENTED OUT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; while (1)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; PORTA.portWord = GPIOA_PDOR;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; PORTA.port16.dbyte0 = counter;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; GPIOA_PDOR = PORTA.portWord;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; counter = FTM0_CNT; &lt;SPAN style="color: #ff0000;"&gt;WILL STALL HERE, UNLESS COMMENTED OUT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if (counter == 100)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // toggle bit 0 of GPIOA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIOA_PTOR = 00000001;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 23:25:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debugging-issue-with-FRDM-KE02Z40M/m-p/351520#M17398</guid>
      <dc:creator>davetelling</dc:creator>
      <dc:date>2014-11-18T23:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging issue with FRDM-KE02Z40M</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debugging-issue-with-FRDM-KE02Z40M/m-p/351521#M17399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like you haven't enabled the clock for FTM0, so you get a bus-fault on any access, that may take effect immediately or 'after a couple clocks' with Cortex write-buffering.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 16:45:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debugging-issue-with-FRDM-KE02Z40M/m-p/351521#M17399</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2014-11-19T16:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging issue with FRDM-KE02Z40M</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debugging-issue-with-FRDM-KE02Z40M/m-p/351522#M17400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Earl, I have a line in my code: FTM0_SC = 0x0000000f;&lt;/P&gt;&lt;P&gt;As far as I can tell, this should select the system clock, with a 128 divisor. Is there something else I need to do?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Dave T.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 17:21:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debugging-issue-with-FRDM-KE02Z40M/m-p/351522#M17400</guid>
      <dc:creator>davetelling</dc:creator>
      <dc:date>2014-11-19T17:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging issue with FRDM-KE02Z40M</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debugging-issue-with-FRDM-KE02Z40M/m-p/351523#M17401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, I found that if I add this:&lt;/P&gt;&lt;P&gt;SIM-&amp;gt;SCGC |= SIM_SCGC_FTM0_MASK;&lt;/P&gt;&lt;P&gt;The debugging seems to run normally.&lt;/P&gt;&lt;P&gt;Earl, you were right! Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 22:20:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debugging-issue-with-FRDM-KE02Z40M/m-p/351523#M17401</guid>
      <dc:creator>davetelling</dc:creator>
      <dc:date>2014-11-19T22:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging issue with FRDM-KE02Z40M</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debugging-issue-with-FRDM-KE02Z40M/m-p/351524#M17402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, THAT clock!&amp;nbsp; Sorry I wasn't more explicit (and more timely!).&amp;nbsp; That 'enable' powers-up the peripheral and brings the registers into the bus-space (as well as the actual clocking of internal 'flops').&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 04:14:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debugging-issue-with-FRDM-KE02Z40M/m-p/351524#M17402</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2014-11-20T04:14:43Z</dc:date>
    </item>
  </channel>
</rss>

