<?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>MPC5xxx中的主题 Re: When MCU enter APP from bootloader for the second time , initialization of clock is abnormal</title>
    <link>https://community.nxp.com/t5/MPC5xxx/When-MCU-enter-APP-from-bootloader-for-the-second-time/m-p/1870371#M25517</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;You mode transition is stuck because you have active some periphery which is supplied by PLL.&lt;/P&gt;
&lt;P&gt;Try to do mode transition to IRC clock and then to your application settings.&lt;/P&gt;
&lt;P&gt;Make sure all peripherals are not clocked by you application clock when you request mode transition.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="petervlna_0-1716362919246.png" style="width: 733px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/280050iF313BEE86112DBDC/image-dimensions/733x445?v=v2" width="733" height="445" role="button" title="petervlna_0-1716362919246.png" alt="petervlna_0-1716362919246.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Peter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 May 2024 07:28:53 GMT</pubDate>
    <dc:creator>petervlna</dc:creator>
    <dc:date>2024-05-22T07:28:53Z</dc:date>
    <item>
      <title>When MCU enter APP from bootloader for the second time , initialization of clock is abnormal</title>
      <link>https://community.nxp.com/t5/MPC5xxx/When-MCU-enter-APP-from-bootloader-for-the-second-time/m-p/1867747#M25496</link>
      <description>&lt;P&gt;There is a requirement is that keep an IO high level when APP jump to the bootloader, so it is not&amp;nbsp;&lt;SPAN&gt;feasibile to enter Bootloader by software reset.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;It is normal for the first time to enter APP from Bootloader.I&amp;nbsp;deinitialize all peripheral such as PIT, SPI before entering bootloader and bootloader will enter APP again. When MCU enter APP from bootloader for the second time, it will stuck at&amp;nbsp;initialzing.&amp;nbsp;I used the library functions offered by IDE. These pictures shows how I find the problem.&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;1.I find it stuck at here.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LuoSi_11-1715927008462.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/279301iD5C9766018FBD732/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LuoSi_11-1715927008462.png" alt="LuoSi_11-1715927008462.png" /&gt;&lt;/span&gt;&lt;/P&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="LuoSi_4-1715926233966.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/279287iF53602A2750215D5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LuoSi_4-1715926233966.png" alt="LuoSi_4-1715926233966.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2.Then stuck at here in picture 1 function&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LuoSi_5-1715926316880.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/279290i2B400A7EC38BB83B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LuoSi_5-1715926316880.png" alt="LuoSi_5-1715926316880.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;3.Then stuck at here in picture 2 function&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LuoSi_6-1715926356787.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/279291iC682A69520D12ADF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LuoSi_6-1715926356787.png" alt="LuoSi_6-1715926356787.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;4.Then stuck at here in picture 3 function&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LuoSi_7-1715926412080.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/279292iA10F2514C1814477/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LuoSi_7-1715926412080.png" alt="LuoSi_7-1715926412080.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;5.And finally I found here. It seems that the cycle is waiting a register status until timeout.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LuoSi_8-1715926471975.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/279293i65B309EF74ACE1A0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LuoSi_8-1715926471975.png" alt="LuoSi_8-1715926471975.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;6.Then&amp;nbsp;I checked the address of this register, and found out what is the cycle wating for.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LuoSi_9-1715926764250.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/279296iCA7BADA4C76EE2A4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LuoSi_9-1715926764250.png" alt="LuoSi_9-1715926764250.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LuoSi_10-1715926813693.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/279297iD1D905456540F46B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LuoSi_10-1715926813693.png" alt="LuoSi_10-1715926813693.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LuoSi_12-1715927014672.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/279302iF50E352EC2C7A117/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LuoSi_12-1715927014672.png" alt="LuoSi_12-1715927014672.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But I dont know why this bit stuck at "Mode transition is on going ". Besides, I tried to reduced the TIMEOUT value in picture 5, then the project will stuck at initializing PIT, or SPI, or the others&amp;nbsp;peripheral.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 06:33:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/When-MCU-enter-APP-from-bootloader-for-the-second-time/m-p/1867747#M25496</guid>
      <dc:creator>LuoSi</dc:creator>
      <dc:date>2024-05-17T06:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: When MCU enter APP from bootloader for the second time , initialization of clock is abnormal</title>
      <link>https://community.nxp.com/t5/MPC5xxx/When-MCU-enter-APP-from-bootloader-for-the-second-time/m-p/1870371#M25517</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;You mode transition is stuck because you have active some periphery which is supplied by PLL.&lt;/P&gt;
&lt;P&gt;Try to do mode transition to IRC clock and then to your application settings.&lt;/P&gt;
&lt;P&gt;Make sure all peripherals are not clocked by you application clock when you request mode transition.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="petervlna_0-1716362919246.png" style="width: 733px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/280050iF313BEE86112DBDC/image-dimensions/733x445?v=v2" width="733" height="445" role="button" title="petervlna_0-1716362919246.png" alt="petervlna_0-1716362919246.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Peter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 07:28:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/When-MCU-enter-APP-from-bootloader-for-the-second-time/m-p/1870371#M25517</guid>
      <dc:creator>petervlna</dc:creator>
      <dc:date>2024-05-22T07:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: When MCU enter APP from bootloader for the second time , initialization of clock is abnormal</title>
      <link>https://community.nxp.com/t5/MPC5xxx/When-MCU-enter-APP-from-bootloader-for-the-second-time/m-p/1875786#M25540</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I've tried as you said.I reset MC_RUN_PC_n, MC_LP_PC_n and ME_PCTL_n before&amp;nbsp;&lt;SPAN&gt;requesting mode transition but &amp;nbsp;mode transition is still stuck.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LuoSi_0-1716854905897.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/281031i40BFC046018949E0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LuoSi_0-1716854905897.png" alt="LuoSi_0-1716854905897.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A register called&amp;nbsp;MC_ME_DMTS as the picture below can see what state is currently. The value is the picture below when the stuck happen. But it is not clear to me that how to find the cause of stuck. Could you help me analyze it?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LuoSi_2-1716855424520.png" style="width: 438px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/281033iA33121CAC74E2649/image-dimensions/438x20?v=v2" width="438" height="20" role="button" title="LuoSi_2-1716855424520.png" alt="LuoSi_2-1716855424520.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LuoSi_3-1716855523065.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/281034i8D9510EE2FE80B7E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LuoSi_3-1716855523065.png" alt="LuoSi_3-1716855523065.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 00:22:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/When-MCU-enter-APP-from-bootloader-for-the-second-time/m-p/1875786#M25540</guid>
      <dc:creator>LuoSi</dc:creator>
      <dc:date>2024-05-28T00:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: When MCU enter APP from bootloader for the second time , initialization of clock is abnormal</title>
      <link>https://community.nxp.com/t5/MPC5xxx/When-MCU-enter-APP-from-bootloader-for-the-second-time/m-p/1875990#M25541</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;OK, so I expect you still have some peripheral active which is sourcing the clock like CAN or PWM.&lt;/P&gt;&lt;P&gt;Gate clocks to those, usually the peripherals have in control register freeze bit so similar.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 06:36:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/When-MCU-enter-APP-from-bootloader-for-the-second-time/m-p/1875990#M25541</guid>
      <dc:creator>petervlna</dc:creator>
      <dc:date>2024-05-28T06:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: When MCU enter APP from bootloader for the second time , initialization of clock is abnormal</title>
      <link>https://community.nxp.com/t5/MPC5xxx/When-MCU-enter-APP-from-bootloader-for-the-second-time/m-p/1878842#M25556</link>
      <description>&lt;P&gt;When dealing with a requirement to keep an IO high level while transitioning from an application (APP) to a bootloader, it is crucial to manage the peripheral states and initialization sequences carefully. Here are some steps and considerations to address the issue where the MCU gets stuck during the second entry into the APP from the bootloader:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Peripheral Deinitialization&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Ensure that all peripherals are properly deinitialized before jumping to the bootloader. This includes disabling interrupts and resetting peripheral registers to their default states.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Memory and Stack Management&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Verify that the stack and heap are correctly managed during the transition. Any stack corruption or improper memory allocation can cause the MCU to get stuck.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Bootloader and Application Separation&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Make sure that the bootloader and application code are well separated in memory and that the vector table is correctly set up when transitioning between them.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Hardware Initialization&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;During the second entry into the APP, ensure that all hardware components are re-initialized correctly. Sometimes peripherals may require a complete reset to work properly after being used by the bootloader.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Debugging&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Use debugging tools to step through the code and identify where the initialization process gets stuck. Implement a functional Hard Fault Handler to catch any faults and provide more information about the failure&lt;A href="https://www.myaccountaccess.run/" target="_self"&gt;.&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Library Functions&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If you are using library functions provided by the IDE, ensure they are compatible with your bootloader and application setup. Sometimes, custom initialization routines may be necessary.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;For more detailed troubleshooting, you can refer to community discussions on similar issues. For example, a user on the NXP community faced a similar problem where the MCU got stuck during initialization when entering the APP from the bootloader for the second time (&lt;A href="https://community.nxp.com/t5/MPC5xxx/When-MCU-enter-APP-from-bootloader-for-the-second-time/td-p/1867747/jump-to/first-unread-message" target="_blank" rel="noopener"&gt;source&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;By carefully managing peripheral states, memory, and initialization sequences, you can ensure a smooth transition between the bootloader and application, even with the requirement to keep an IO high level.&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2024 09:04:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/When-MCU-enter-APP-from-bootloader-for-the-second-time/m-p/1878842#M25556</guid>
      <dc:creator>davidaccess</dc:creator>
      <dc:date>2024-05-31T09:04:52Z</dc:date>
    </item>
  </channel>
</rss>

