<?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: What exactly does the debugger do to execute your program?</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-exactly-does-the-debugger-do-to-execute-your-program/m-p/398209#M22018</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Dave:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually the main issue is the EzPort mode, not the NMI handler. If the pin detects a low level at Power ON, then it will enter EzPort mode, so it won't even get to trigger the NMI interrupt. It would be better if you desolder the capacitor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EzPort can also disabled. If you are using KSDK, then the Flash configuration registers are not handled by Processor Expert. In the first discussion I linked you can see there is a file called &lt;STRONG&gt;startup_MK64F12.S&lt;/STRONG&gt; which contains the Flash Configuration:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14453605069491445 jive_text_macro" data-renderedposition="176.4499969482422_8_1050_96" jivemacro_uid="_14453605069491445"&gt;&lt;P&gt;/* Flash Configuration */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .section .FlashConfig, "a"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFE&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change it to this to disable EzPort and NMI (see the F9):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14453605127286676 jive_text_macro" data-renderedposition="335.45001220703125_8_1050_96" jivemacro_uid="_14453605127286676"&gt;&lt;P&gt;/* Flash Configuration */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .section .FlashConfig, "a"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFF9FE&lt;/P&gt;&lt;/PRE&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>Tue, 20 Oct 2015 17:01:45 GMT</pubDate>
    <dc:creator>Jorge_Gonzalez</dc:creator>
    <dc:date>2015-10-20T17:01:45Z</dc:date>
    <item>
      <title>What exactly does the debugger do to execute your program?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-exactly-does-the-debugger-do-to-execute-your-program/m-p/398206#M22015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a problem where a particular PCB with a K64F will run via the debugger in KDS, but when I power cycle it, the program does not execute.&amp;nbsp; I have already tried the approach suggested in one of my previous posts: &lt;A href="https://community.nxp.com/thread/353792"&gt;How do you program and run from flash?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, 1/3 of my boards (same revision PCB) &lt;STRONG&gt;does&lt;/STRONG&gt; boot on startup.&amp;nbsp; I'm trying to understand why this is the case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since all of the boards work when debugging under KDS, I'm interested in knowing exactly what happens.&amp;nbsp; My simplified guess would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;flash program&lt;/LI&gt;&lt;LI&gt;verify program&lt;/LI&gt;&lt;LI&gt;reset processor&lt;/LI&gt;&lt;LI&gt;send go command&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used the J-Link Commander to flash my hex image, then I reset the processor and sent the go command.&amp;nbsp; My program does not run.&amp;nbsp; I must be missing some important steps here!&amp;nbsp; While it is necessary for me to eventually get the program to run on powerup, for the time being, it will be good enough if I can "kick start" the execution of the program via J-Link Commander commands.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Can anyone provide me with some more information about what's happening under the hood when the KDS debugger runs?&amp;nbsp; Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p.s. any suggestions about what I should look at with the scope to determine why the program isn't running on powerup would be much appreciated as well!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2015 03:03:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-exactly-does-the-debugger-do-to-execute-your-program/m-p/398206#M22015</guid>
      <dc:creator>dave408</dc:creator>
      <dc:date>2015-10-15T03:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: What exactly does the debugger do to execute your program?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-exactly-does-the-debugger-do-to-execute-your-program/m-p/398207#M22016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Dave:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could not say exactly how the GDB debugger works apart from what you mentioned (reset processor could instead be loading the Program Counter and sending Go command would be to release the Core from debug Halt mode). Moreover it depends on the programming tool, each manufacturer creates their own programming algorithms (Segger, P&amp;amp;E Micro).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on your issue what I can recommend you is to check that the NMI/EzPort pin on your custom boards is not pulled low by an external signal. See the next discussion about a similar problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/332195"&gt;FRDM-K64F booting issue when powered from USB port&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The next document is related, although it is for the opposite situation, the application not working in Debug mode:&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;BR /&gt;Jorge Gonzalez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2015 22:00:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-exactly-does-the-debugger-do-to-execute-your-program/m-p/398207#M22016</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-10-19T22:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: What exactly does the debugger do to execute your program?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-exactly-does-the-debugger-do-to-execute-your-program/m-p/398208#M22017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jorge, thanks for your reply.&amp;nbsp; I've been trying to mess with the NMI settings, but it seems like everything available online at the moment doesn't accurately represent what I'm seeing in KDS 3.0.&amp;nbsp; I don't see any NMI or EzPort settings anywhere, even when I enable the advanced view and switch off tabbed views.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I therefore added NMI_Handler manually as described in your referenced post to try to force the pin to be an input and not be NMI:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14453534756609883 jive_text_macro" data-renderedposition="113_8_1232_128" jivemacro_uid="_14453534756609883"&gt;&lt;P&gt;void NMI_Handler(unsigned long *hardfault_args)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // &lt;/SPAN&gt;&lt;A class="jive-link-thread-small" data-containerid="2019" data-containertype="14" data-objectid="332195" data-objecttype="1" href="https://community.freescale.com/thread/332195" rel="nofollow noopener noreferrer" target="_blank"&gt;https://community.freescale.com/thread/332195&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SIM_SCGC5 |= (uint32_t)SIM_SCGC5_PORTA_MASK; /* NMI and PORTA clock gate enable */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORTA_PCR4 &amp;amp;= PORT_PCR_MUX_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* enable input with pull up enable not NMI */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORTA_PCR4 |= PORT_PCR_MUX(01) | PORT_PCR_PE_MASK | PORT_PCR_PS_MASK;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That did not help.&amp;nbsp; At this point, I think I'll have to desolder the cap between PTA4 and GND.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any other suggestions about what I can try in the latest KDS (3.0)?&amp;nbsp; Is there any updated information on configuring EzPort and NMI with this IDE?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Oct 2015 15:04:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-exactly-does-the-debugger-do-to-execute-your-program/m-p/398208#M22017</guid>
      <dc:creator>dave408</dc:creator>
      <dc:date>2015-10-20T15:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: What exactly does the debugger do to execute your program?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-exactly-does-the-debugger-do-to-execute-your-program/m-p/398209#M22018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Dave:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually the main issue is the EzPort mode, not the NMI handler. If the pin detects a low level at Power ON, then it will enter EzPort mode, so it won't even get to trigger the NMI interrupt. It would be better if you desolder the capacitor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EzPort can also disabled. If you are using KSDK, then the Flash configuration registers are not handled by Processor Expert. In the first discussion I linked you can see there is a file called &lt;STRONG&gt;startup_MK64F12.S&lt;/STRONG&gt; which contains the Flash Configuration:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14453605069491445 jive_text_macro" data-renderedposition="176.4499969482422_8_1050_96" jivemacro_uid="_14453605069491445"&gt;&lt;P&gt;/* Flash Configuration */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .section .FlashConfig, "a"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFE&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change it to this to disable EzPort and NMI (see the F9):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14453605127286676 jive_text_macro" data-renderedposition="335.45001220703125_8_1050_96" jivemacro_uid="_14453605127286676"&gt;&lt;P&gt;/* Flash Configuration */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .section .FlashConfig, "a"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFFFFF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .long 0xFFFFF9FE&lt;/P&gt;&lt;/PRE&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>Tue, 20 Oct 2015 17:01:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-exactly-does-the-debugger-do-to-execute-your-program/m-p/398209#M22018</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-10-20T17:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: What exactly does the debugger do to execute your program?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-exactly-does-the-debugger-do-to-execute-your-program/m-p/398210#M22019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jorge, unfortunately, when I did that, two things happened.&amp;nbsp; First, when I boot, the code still doesn't execute.&amp;nbsp; Secondly, when I try to run through the debugger, my flash codes indicate a MemManage fault.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Oct 2015 18:20:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-exactly-does-the-debugger-do-to-execute-your-program/m-p/398210#M22019</guid>
      <dc:creator>dave408</dc:creator>
      <dc:date>2015-10-20T18:20:55Z</dc:date>
    </item>
  </channel>
</rss>

