<?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 K40 execute code from flash in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209827#M3403</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am new on Kinetis and IAR .&lt;/P&gt;&lt;P&gt;Now I wrote a liitle program with IAR EWB 6.3 for my Kinetis K40 Tower.&lt;/P&gt;&lt;P&gt;I can execute my progam by debugging with my JLink debugger, but when I will start my program after a Power off -&amp;gt; on, the program will not start.&lt;/P&gt;&lt;P&gt;I have already tried many ICF files but none file works.&lt;/P&gt;&lt;P&gt;What is wrong in my source ?&lt;/P&gt;&lt;P&gt;I have attached my project. May be someone can help.&lt;/P&gt;&lt;P&gt;Thanks in advance ..&lt;/P&gt;&lt;P&gt;RW&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Feb 2012 22:21:20 GMT</pubDate>
    <dc:creator>royw</dc:creator>
    <dc:date>2012-02-24T22:21:20Z</dc:date>
    <item>
      <title>K40 execute code from flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209827#M3403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am new on Kinetis and IAR .&lt;/P&gt;&lt;P&gt;Now I wrote a liitle program with IAR EWB 6.3 for my Kinetis K40 Tower.&lt;/P&gt;&lt;P&gt;I can execute my progam by debugging with my JLink debugger, but when I will start my program after a Power off -&amp;gt; on, the program will not start.&lt;/P&gt;&lt;P&gt;I have already tried many ICF files but none file works.&lt;/P&gt;&lt;P&gt;What is wrong in my source ?&lt;/P&gt;&lt;P&gt;I have attached my project. May be someone can help.&lt;/P&gt;&lt;P&gt;Thanks in advance ..&lt;/P&gt;&lt;P&gt;RW&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2012 22:21:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209827#M3403</guid>
      <dc:creator>royw</dc:creator>
      <dc:date>2012-02-24T22:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: K40 execute code from flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209828#M3404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had the same problem. I added wait() for 0.25 second after MCU initialization and before all peripheries initialization. The time that you need for delay you can try by yourself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Evgeni.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;R&amp;amp;D Engineer&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2012 22:32:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209828#M3404</guid>
      <dc:creator>evgenik</dc:creator>
      <dc:date>2012-02-24T22:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: K40 execute code from flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209829#M3405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your fast reply, but that was not the reason ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;:smileysad:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2012 22:39:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209829#M3405</guid>
      <dc:creator>royw</dc:creator>
      <dc:date>2012-02-24T22:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: K40 execute code from flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209830#M3406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can nobody help me ? :smileysad:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Feb 2012 20:31:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209830#M3406</guid>
      <dc:creator>royw</dc:creator>
      <dc:date>2012-02-26T20:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: K40 execute code from flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209831#M3407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See pages 30/31 of the following &lt;A href="http://www.utasker.com/docs/KINETIS/uTaskerV1.4_Kinetis_demo.pdf" rel="nofollow" target="_blank"&gt;http://www.utasker.com/docs/KINETIS/uTaskerV1.4_Kinetis_demo.pdf&lt;/A&gt; "Reset and Watchdog"&lt;/P&gt;&lt;P&gt;Maybe that will explain a possible difficulty.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Feb 2012 21:33:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209831#M3407</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2012-02-26T21:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: K40 execute code from flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209832#M3408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in debugging mode all works fine, but&amp;nbsp;it does not work when I will start the firmware without debugger.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RW&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 15:55:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209832#M3408</guid>
      <dc:creator>royw</dc:creator>
      <dc:date>2012-02-27T15:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: K40 execute code from flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209833#M3409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hmm,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can somebody try it on your own K40 tower ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RW&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 15:30:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209833#M3409</guid>
      <dc:creator>royw</dc:creator>
      <dc:date>2012-02-28T15:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: K40 execute code from flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209834#M3410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi royw,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i run your example,&amp;nbsp; your project does not have correctly set up the start up code. It should start with crt0.s and jump to the start().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you check start function, first step is to disable wdog then call sysinit. Your problem was to disable wdog : wdog_disable();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then it runs even after power reset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;MartinK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 16:15:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209834#M3410</guid>
      <dc:creator>c0170</dc:creator>
      <dc:date>2012-02-28T16:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: K40 execute code from flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209835#M3411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't understand what you mean.&lt;/P&gt;&lt;P&gt;In my project is the "crt0.s" implemented and the start() function call the&amp;nbsp;wdog_disable();&amp;nbsp; as first. (start.c) .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can set a breakpoint to this line ind start() and the debugger stopp at this line.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 16:39:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209835#M3411</guid>
      <dc:creator>royw</dc:creator>
      <dc:date>2012-02-28T16:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: K40 execute code from flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209836#M3412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;why do you call function sysinit from main function?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I downloaded your project and I set breakpoint to the startup code. it did not jump there . Therefore quickly i called wdog_disable() and sysinit() from main. then everything worked after power on reset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 19:48:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209836#M3412</guid>
      <dc:creator>c0170</dc:creator>
      <dc:date>2012-02-28T19:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: K40 execute code from flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209837#M3413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have made a smaller project with blinking LEDs.&lt;/P&gt;&lt;P&gt;(.zip file attached)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can somebody test it on your&amp;nbsp;own K40-tower.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With JLinks debugger I can Start and debug&amp;nbsp;this project.&lt;/P&gt;&lt;P&gt;But it don't start from self after Power on ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2012 19:35:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209837#M3413</guid>
      <dc:creator>royw</dc:creator>
      <dc:date>2012-03-01T19:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: K40 execute code from flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209838#M3414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found my mistake .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now I can run my program from flash.&lt;/P&gt;&lt;P&gt;It was a wrong setting in the project options&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;under General options / library Configuration -&amp;gt; stdout/stderr must be set to "Via SWO" .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for all they want help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2012 16:06:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K40-execute-code-from-flash/m-p/209838#M3414</guid>
      <dc:creator>royw</dc:creator>
      <dc:date>2012-03-07T16:06:31Z</dc:date>
    </item>
  </channel>
</rss>

