<?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: LPC546xx: .noinit doesn't work as expected in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546xx-noinit-doesn-t-work-as-expected/m-p/1438726#M48409</link>
    <description>&lt;P&gt;Sorry, yes, too many different targets here &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;I meant:&lt;/P&gt;&lt;P&gt;RTC-&amp;gt;GPREG[7] != 0xDEADBEEF&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Apr 2022 08:04:48 GMT</pubDate>
    <dc:creator>carstengroen</dc:creator>
    <dc:date>2022-04-05T08:04:48Z</dc:date>
    <item>
      <title>LPC546xx: .noinit doesn't work as expected</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546xx-noinit-doesn-t-work-as-expected/m-p/1438408#M48404</link>
      <description>&lt;P&gt;I'm writing a second bootloader and I'd like to use a magic number to decide if staying in bootloader or running application. Something similar to this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#include &amp;lt;cr_section_macros.h&amp;gt;
#define START_APPLICATION_MAGIC			0x4C514400
static __NOINIT_DEF uint32_t start_application;

if (start_application == START_APPLICATION_MAGIG) {
  run_application();
} else {
  /* Stay in the bootloader and waits for new application image
   * to write in the Flash. After... */
  start_application = START_APPLICATION_MAGIC;
  NVIC_SystemReset();
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of course, start_application variable shouldn't be zeroed at reset and during startup code. I already used this tecnique in other applications.&lt;/P&gt;&lt;P&gt;Now, the linker puts start_application at address 0x2000149C and it is marked as .noinit in the map file. However it doesn't work.&lt;/P&gt;&lt;P&gt;If I put a break point on NVIC_SystemReset() instruction, I can see the magic number in start_application variable. When I proceed I stop the execution with another breakpoint in ResetISR(), before initializing bss and data sections. Now I see 0 at address&amp;nbsp;0x2000149C.&lt;/P&gt;&lt;P&gt;I tried to investigate deeper and I noticed all the address starting from 0x20001000 are zero at startup, while previous addresses (4kB) maintain values before reset.&lt;/P&gt;&lt;P&gt;Why this behaviour? I can't understand. The only reason for this could reside in the bootloader in ROM that should always start. However I don't know how much SRAM it uses and where.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 14:29:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546xx-noinit-doesn-t-work-as-expected/m-p/1438408#M48404</guid>
      <dc:creator>giusloq</dc:creator>
      <dc:date>2022-04-04T14:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546xx: .noinit doesn't work as expected</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546xx-noinit-doesn-t-work-as-expected/m-p/1438455#M48405</link>
      <description>&lt;P&gt;Not that it in any way is an answer to your problem...&lt;/P&gt;&lt;P&gt;On the LPC54x I use the&lt;STRIKE&gt; RTCC RET&lt;/STRIKE&gt; RTC-&amp;gt;GPREG registers for stuff like that (also when activating bootloader etc)&lt;/P&gt;&lt;P&gt;&lt;STRIKE&gt;RTCC-&amp;gt;RET[31].REG != 0xDEADBEEF&lt;/STRIKE&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Correction, its&amp;nbsp;RTC-&amp;gt;GPREG[]&lt;/P&gt;&lt;P&gt;You just need to initialize the RTC before accessing the registers.&lt;/P&gt;&lt;P&gt;As I said, not a solution for your problem, just another way of solving the job &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 08:00:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546xx-noinit-doesn-t-work-as-expected/m-p/1438455#M48405</guid>
      <dc:creator>carstengroen</dc:creator>
      <dc:date>2022-04-05T08:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546xx: .noinit doesn't work as expected</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546xx-noinit-doesn-t-work-as-expected/m-p/1438720#M48408</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;On the LPC54x I use the RTCC RET registers for stuff like that (also when activating bootloader etc)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Do you mean GPREGx, general purpose register, don't you? Because I can't see RET registers.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is LPC54x a different MCU than LPC546xx?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 07:46:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546xx-noinit-doesn-t-work-as-expected/m-p/1438720#M48408</guid>
      <dc:creator>giusloq</dc:creator>
      <dc:date>2022-04-05T07:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546xx: .noinit doesn't work as expected</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546xx-noinit-doesn-t-work-as-expected/m-p/1438726#M48409</link>
      <description>&lt;P&gt;Sorry, yes, too many different targets here &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;I meant:&lt;/P&gt;&lt;P&gt;RTC-&amp;gt;GPREG[7] != 0xDEADBEEF&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 08:04:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546xx-noinit-doesn-t-work-as-expected/m-p/1438726#M48409</guid>
      <dc:creator>carstengroen</dc:creator>
      <dc:date>2022-04-05T08:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546xx: .noinit doesn't work as expected</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546xx-noinit-doesn-t-work-as-expected/m-p/1440270#M48428</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;giusloq,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Check your startup file, maybe fill zero with uninitalized data, for example MCXUpresso IDE:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Alice_Yang_0-1649313198919.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/176163i028A4E5A0A45E74C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Alice_Yang_0-1649313198919.png" alt="Alice_Yang_0-1649313198919.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Alice&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 06:33:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546xx-noinit-doesn-t-work-as-expected/m-p/1440270#M48428</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2022-04-07T06:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546xx: .noinit doesn't work as expected</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546xx-noinit-doesn-t-work-as-expected/m-p/1440308#M48429</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Check your startup file, maybe fill zero with uninitalized data&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;I&amp;nbsp; put a breakpoint at the beginning of ResetISR(), &lt;STRONG&gt;before&lt;/STRONG&gt; initializing bss and data sections.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Even at this point, the variable that was initialized with a magic number before the reset appears again to zero.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I suspect it's a behaviour of ROM bootloader. Do you know if the ROM bootloader uses SRAM? If yes, which part of SRAM are touched by bootloader?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 07:07:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546xx-noinit-doesn-t-work-as-expected/m-p/1440308#M48429</guid>
      <dc:creator>giusloq</dc:creator>
      <dc:date>2022-04-07T07:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546xx: .noinit doesn't work as expected</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546xx-noinit-doesn-t-work-as-expected/m-p/1441184#M48454</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello &lt;SPAN class="UserName lia-user-name lia-user-rank-Contributor-III lia-component-message-view-widget-author-username"&gt;&lt;A id="link_12" class="lia-link-navigation lia-page-link lia-user-name-link" style="color: #333f48;" href="https://community.nxp.com/t5/user/viewprofilepage/user-id/160419" target="_self" aria-label="View Profile of giusloq"&gt;&lt;SPAN class=""&gt;giusloq,&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-Contributor-III lia-component-message-view-widget-author-username"&gt;&lt;SPAN class=""&gt;Enter ISP mode, then use blhsot command "get-property 12":&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The ROM reserved regions can be obtained from the blhost command "get-property 12".&lt;/P&gt;
&lt;P&gt;Below picture is or lpc55xx:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Alice_Yang_0-1649409632104.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/176361iF8795EAC0C31A498/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Alice_Yang_0-1649409632104.png" alt="Alice_Yang_0-1649409632104.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Alice&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 09:20:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546xx-noinit-doesn-t-work-as-expected/m-p/1441184#M48454</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2022-04-08T09:20:59Z</dc:date>
    </item>
  </channel>
</rss>

