<?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 Stuck in __pe_initialize_hardware after booting with custom bootloader in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Stuck-in-pe-initialize-hardware-after-booting-with-custom/m-p/224424#M6041</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello community!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I prepared a custom bootloader prototype for my project, and it works fine. But i've stumbled upon a problem in initialization code of a flashed MQX system. It appears i can't get out of the following waiting loop in __pe_initialize_hardware function (generated cpu.c in bsp code):&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Switch to PEE Mode */&lt;BR /&gt;&amp;nbsp; /* MCG_C1: CLKS=0,FRDIV=3,IREFS=0,IRCLKEN=0,IREFSTEN=0 */&lt;BR /&gt;&amp;nbsp; MCG_C1 = (MCG_C1_CLKS(0x00) | MCG_C1_FRDIV(0x03));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; while((MCG_S &amp;amp; 0x0CU) != 0x0CU) {&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Wait until output of the PLL is selected */&lt;BR /&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems to be waiting infinitely. But when i break the code execution (or make there a breakpoint, it does not matter), MCG_S appears to be in a required state. After this I hit continue and everything works as expected. Can someone shed a light on this behavior and maybe point me to some documentation, or give advice on any additional actions i must perform in my bootloader to avoid this situation?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Nov 2013 09:47:36 GMT</pubDate>
    <dc:creator>mikhailburakov</dc:creator>
    <dc:date>2013-11-25T09:47:36Z</dc:date>
    <item>
      <title>Stuck in __pe_initialize_hardware after booting with custom bootloader</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Stuck-in-pe-initialize-hardware-after-booting-with-custom/m-p/224424#M6041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello community!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I prepared a custom bootloader prototype for my project, and it works fine. But i've stumbled upon a problem in initialization code of a flashed MQX system. It appears i can't get out of the following waiting loop in __pe_initialize_hardware function (generated cpu.c in bsp code):&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Switch to PEE Mode */&lt;BR /&gt;&amp;nbsp; /* MCG_C1: CLKS=0,FRDIV=3,IREFS=0,IRCLKEN=0,IREFSTEN=0 */&lt;BR /&gt;&amp;nbsp; MCG_C1 = (MCG_C1_CLKS(0x00) | MCG_C1_FRDIV(0x03));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; while((MCG_S &amp;amp; 0x0CU) != 0x0CU) {&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Wait until output of the PLL is selected */&lt;BR /&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems to be waiting infinitely. But when i break the code execution (or make there a breakpoint, it does not matter), MCG_S appears to be in a required state. After this I hit continue and everything works as expected. Can someone shed a light on this behavior and maybe point me to some documentation, or give advice on any additional actions i must perform in my bootloader to avoid this situation?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Nov 2013 09:47:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Stuck-in-pe-initialize-hardware-after-booting-with-custom/m-p/224424#M6041</guid>
      <dc:creator>mikhailburakov</dc:creator>
      <dc:date>2013-11-25T09:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Stuck in __pe_initialize_hardware after booting with custom bootloader</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Stuck-in-pe-initialize-hardware-after-booting-with-custom/m-p/224425#M6042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like the problem was with the oscillator configuration. I had to add "OSC_CR = 0" right before branching from the bootloader. This seemed to resolve the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Nov 2013 10:02:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Stuck-in-pe-initialize-hardware-after-booting-with-custom/m-p/224425#M6042</guid>
      <dc:creator>mikhailburakov</dc:creator>
      <dc:date>2013-11-26T10:02:28Z</dc:date>
    </item>
  </channel>
</rss>

