<?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: Debug works but not running standalone in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debug-works-but-not-running-standalone/m-p/1829022#M66161</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/229942"&gt;@il_andil&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;a) are you using semihosting in your code? If so, if your hardfault handler does not deal with it without debugger, then it might block the target. See&amp;nbsp;&lt;A href="https://mcuoneclipse.com/2023/03/09/using-semihosting-the-direct-way/" target="_blank"&gt;https://mcuoneclipse.com/2023/03/09/using-semihosting-the-direct-way/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;b) Do you use anything from the cycle counter register? It is initialized by default by the debugger, but if you are using it from your application, then DWT needs to be initialized by the application:&amp;nbsp;&lt;A href="https://mcuoneclipse.com/2017/01/30/cycle-counting-on-arm-cortex-m-with-dwt/" target="_blank"&gt;https://mcuoneclipse.com/2017/01/30/cycle-counting-on-arm-cortex-m-with-dwt/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;c) If your device has an EzPort, make sure it is not entering the loader mode, check&amp;nbsp;&lt;A href="https://mcuoneclipse.com/2016/12/22/disabling-ezport-on-nxp-kinetis-to-solve-power-on-issues/" target="_blank"&gt;https://mcuoneclipse.com/2016/12/22/disabling-ezport-on-nxp-kinetis-to-solve-power-on-issues/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;d) Attach to the running (well, blocked) target with the debugger to see what is going on:&amp;nbsp;&lt;A href="https://mcuoneclipse.com/2021/04/25/attach-with-the-debugger-to-a-running-target/" target="_blank"&gt;https://mcuoneclipse.com/2021/04/25/attach-with-the-debugger-to-a-running-target/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;</description>
    <pubDate>Fri, 15 Mar 2024 04:38:47 GMT</pubDate>
    <dc:creator>ErichStyger</dc:creator>
    <dc:date>2024-03-15T04:38:47Z</dc:date>
    <item>
      <title>Debug works but not running standalone</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debug-works-but-not-running-standalone/m-p/1828707#M66159</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using microcontroller MKL02Z32CAF4 installed on a custom PCB and i program it with MCUExpresso IDE version 11.5; I use MCU-Link debug probe with v 3.133 firmware; my SKD is&amp;nbsp;SDK_2.x_FRDM-KL02Z, but I also used&amp;nbsp;SDK_2.x_MKL02Z32xxx4 and the result is the same.&lt;/P&gt;&lt;P&gt;When I flash the MCU (using SWD) with entering the debug mode, I can step through the code, continue the execution and I see with an oscilloscope a pin on a PCB toggling in an infinite loop (that is all the code is doing).&lt;/P&gt;&lt;P&gt;However, when I flash using GUI Flash Tool (or I just power of and then on after debugging session), then nothing happens - it seems like the code isn't running.&lt;/P&gt;&lt;P&gt;I've read a few posts in this forum and didn't find an answer that worked.&lt;/P&gt;&lt;P&gt;Here are a bit more details: I do mass erase, and do SOFT reset handling, and a reset on connection and on completion.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="il_andil_1-1710435468079.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/268472i1A9523109FF0835E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="il_andil_1-1710435468079.png" alt="il_andil_1-1710435468079.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help - is there any settings I can check? Does the IDE do something magical in the debug mode that makes the code run, but just flashing it won't work.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 17:01:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debug-works-but-not-running-standalone/m-p/1828707#M66159</guid>
      <dc:creator>il_andil</dc:creator>
      <dc:date>2024-03-14T17:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Debug works but not running standalone</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debug-works-but-not-running-standalone/m-p/1829022#M66161</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/229942"&gt;@il_andil&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;a) are you using semihosting in your code? If so, if your hardfault handler does not deal with it without debugger, then it might block the target. See&amp;nbsp;&lt;A href="https://mcuoneclipse.com/2023/03/09/using-semihosting-the-direct-way/" target="_blank"&gt;https://mcuoneclipse.com/2023/03/09/using-semihosting-the-direct-way/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;b) Do you use anything from the cycle counter register? It is initialized by default by the debugger, but if you are using it from your application, then DWT needs to be initialized by the application:&amp;nbsp;&lt;A href="https://mcuoneclipse.com/2017/01/30/cycle-counting-on-arm-cortex-m-with-dwt/" target="_blank"&gt;https://mcuoneclipse.com/2017/01/30/cycle-counting-on-arm-cortex-m-with-dwt/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;c) If your device has an EzPort, make sure it is not entering the loader mode, check&amp;nbsp;&lt;A href="https://mcuoneclipse.com/2016/12/22/disabling-ezport-on-nxp-kinetis-to-solve-power-on-issues/" target="_blank"&gt;https://mcuoneclipse.com/2016/12/22/disabling-ezport-on-nxp-kinetis-to-solve-power-on-issues/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;d) Attach to the running (well, blocked) target with the debugger to see what is going on:&amp;nbsp;&lt;A href="https://mcuoneclipse.com/2021/04/25/attach-with-the-debugger-to-a-running-target/" target="_blank"&gt;https://mcuoneclipse.com/2021/04/25/attach-with-the-debugger-to-a-running-target/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 04:38:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debug-works-but-not-running-standalone/m-p/1829022#M66161</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2024-03-15T04:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Debug works but not running standalone</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debug-works-but-not-running-standalone/m-p/1829237#M66163</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;From hardware perspective, you have to write the application code to internal flash instead of RAM, secondly, pls check the PTA5(Reset_b) pin, the Reset pin must be driven High or float(),there is internal pull-up resistor for the pinPTA5, so it is high if the pin is float.&lt;/P&gt;
&lt;P&gt;Hope it can give you a clue.&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 08:58:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debug-works-but-not-running-standalone/m-p/1829237#M66163</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2024-03-15T08:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Debug works but not running standalone</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debug-works-but-not-running-standalone/m-p/1829339#M66164</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/26034"&gt;@xiangjun_rong&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;The reset_b pin is floating.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;The issue is that in standalone mode I see on an oscilloscope that reset_b goes LOW for 30us.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I think I do write the code into the internal flash.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 10:38:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debug-works-but-not-running-standalone/m-p/1829339#M66164</guid>
      <dc:creator>il_andil</dc:creator>
      <dc:date>2024-03-15T10:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: Debug works but not running standalone</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debug-works-but-not-running-standalone/m-p/1829343#M66165</link>
      <description>&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/17173"&gt;@ErichStyger&lt;/a&gt;&lt;BR /&gt;a) semihosting is disabled.&lt;BR /&gt;I will check your links on (b), (c), (d)&lt;BR /&gt;/Andrii</description>
      <pubDate>Fri, 15 Mar 2024 10:41:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debug-works-but-not-running-standalone/m-p/1829343#M66165</guid>
      <dc:creator>il_andil</dc:creator>
      <dc:date>2024-03-15T10:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: Debug works but not running standalone</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debug-works-but-not-running-standalone/m-p/1829865#M66169</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;From software perspective, Erich has given you a lot of suggestion.&lt;/P&gt;
&lt;P&gt;From hardware perspective, pls check the PTB5(NMI_b) pin logic, you'd better configure it high by connecting a 10K ohm pull-up resistor so that the NMI interrupt can not happen. Or clear the FTFA_FOPT[NMI_DIS] bit in the application code.&lt;/P&gt;
&lt;P&gt;Pls have a check&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 02:50:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debug-works-but-not-running-standalone/m-p/1829865#M66169</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2024-03-18T02:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Debug works but not running standalone</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debug-works-but-not-running-standalone/m-p/1830215#M66171</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/26034"&gt;@xiangjun_rong&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The NMI_b pin is driven to the GND on the custom PCB I use. Do you think this could explain why I see resets?&lt;/P&gt;&lt;P&gt;Could you guide me on how to clear&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;FTFA_FOPT[NMI_DIS] bit from the application code?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/Andrii&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 10:16:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debug-works-but-not-running-standalone/m-p/1830215#M66171</guid>
      <dc:creator>il_andil</dc:creator>
      <dc:date>2024-03-18T10:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: Debug works but not running standalone</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debug-works-but-not-running-standalone/m-p/1830634#M66174</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Pls try to set the flash configuration field with:&lt;/P&gt;
&lt;DIV style="background-color: #ffffff; padding: 0px 0px 0px 2px;"&gt;
&lt;DIV style="color: #000000; background-color: #ffffff; font-family: 'Consolas'; font-size: 10pt; white-space: pre;"&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;__attribute__&lt;/SPAN&gt;&lt;SPAN&gt; ((used,section(&lt;/SPAN&gt;&lt;SPAN&gt;".FlashConfig"&lt;/SPAN&gt;&lt;SPAN&gt;))) &lt;/SPAN&gt;&lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN&gt;struct&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;unsigned&lt;/SPAN&gt; &lt;SPAN&gt;int&lt;/SPAN&gt; &lt;SPAN&gt;word1&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;unsigned&lt;/SPAN&gt; &lt;SPAN&gt;int&lt;/SPAN&gt; &lt;SPAN&gt;word2&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;unsigned&lt;/SPAN&gt; &lt;SPAN&gt;int&lt;/SPAN&gt; &lt;SPAN&gt;word3&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;unsigned&lt;/SPAN&gt; &lt;SPAN&gt;int&lt;/SPAN&gt; &lt;SPAN&gt;word4&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;} Flash_Config = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFBFE};&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xiangjun_rong_0-1710815741950.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/269049iAD9998F192CC3098/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xiangjun_rong_0-1710815741950.png" alt="xiangjun_rong_0-1710815741950.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The FTFA_FOPT[NMI_DIS] bit will be cleared&lt;/P&gt;
&lt;P&gt;Hope it can help you&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 02:37:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debug-works-but-not-running-standalone/m-p/1830634#M66174</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2024-03-19T02:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: Debug works but not running standalone</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debug-works-but-not-running-standalone/m-p/1830944#M66175</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/26034"&gt;@xiangjun_rong&lt;/a&gt;&amp;nbsp;this did the trick. Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 08:06:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debug-works-but-not-running-standalone/m-p/1830944#M66175</guid>
      <dc:creator>il_andil</dc:creator>
      <dc:date>2024-03-19T08:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: Debug works but not running standalone</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debug-works-but-not-running-standalone/m-p/1912211#M66589</link>
      <description>&lt;P&gt;Hello, I am facing a similar issue with MIMXRT1064 custom board. But above mentioned options are not avaliable in the startup file. Please help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 11:05:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debug-works-but-not-running-standalone/m-p/1912211#M66589</guid>
      <dc:creator>JKPAPER_DELOPT_SR</dc:creator>
      <dc:date>2024-07-19T11:05:26Z</dc:date>
    </item>
  </channel>
</rss>

