<?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>LPC MicrocontrollersのトピックRe: LPC54618: Hard Fault When entering DeepSleep</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54618-Hard-Fault-When-entering-DeepSleep/m-p/1689334#M53508</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;i have solved the problem. In Order to call POWER_EnterDeepSleep in an mbed-os Program you have to create an mbed::ScopedRamExecutionLock inside the Scope that needs to execute from RAM. Otherwise the execution will cause a Hardfault because of the MemoryProtectionUnit. It might be similarly handled in other Real-Time-Operating-Systems.&lt;/P&gt;&lt;P&gt;This also seems to eliminate all Problems with the Interrupts.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jul 2023 10:23:11 GMT</pubDate>
    <dc:creator>AleemS</dc:creator>
    <dc:date>2023-07-20T10:23:11Z</dc:date>
    <item>
      <title>LPC54618: Hard Fault When entering DeepSleep</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54618-Hard-Fault-When-entering-DeepSleep/m-p/1681307#M53319</link>
      <description>&lt;P&gt;When trying to enter deepsleep mode on the LPC54618 an HardFault occurs. Going through step by step with gdb the instruction&lt;/P&gt;&lt;P&gt;0x200058e0 &amp;lt;+0&amp;gt;: push {r4, r5, r6, r7, lr}&lt;/P&gt;&lt;P&gt;in the function relocMem.8033 causes the HardFault. The Main stack starts at 0x200044a8 and has Size 0x1000. I have tried calling POWER_EnterDeepSleep with arguments uint64_t(-1), 0, and&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;(uint64_t(SYSCON_PDRUNCFG_PDEN_SYSOSC_MASK | SYSCON_PDRUNCFG_PDEN_EEPROM_MASK) &amp;lt;&amp;lt; 32) |&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (SYSCON_PDRUNCFG_PDEN_SRAMX_MASK | SYSCON_PDRUNCFG_PDEN_SRAM0_MASK |&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SYSCON_PDRUNCFG_PDEN_SRAM1_2_3_MASK | SYSCON_PDRUNCFG_PDEN_VD6_MASK), which expands to &lt;SPAN&gt;0x28'2000'E000.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Context:&lt;/P&gt;&lt;P&gt;++ MbedOS Fault Handler ++&lt;/P&gt;&lt;P&gt;FaultType: HardFault&lt;/P&gt;&lt;P&gt;Context:&lt;BR /&gt;R 0: FFFFFFFF&lt;BR /&gt;R 1: FFFFFFFF&lt;BR /&gt;R 2: 00000000&lt;BR /&gt;R 3: 200058E1&lt;BR /&gt;R 4: 20002BC4&lt;BR /&gt;R 5: 00000008&lt;BR /&gt;R 6: 20005474&lt;BR /&gt;R 7: 000084A1&lt;BR /&gt;R 8: 200030C4&lt;BR /&gt;R 9: 00000001&lt;BR /&gt;R 10: 00021744&lt;BR /&gt;R 11: 00000000&lt;BR /&gt;R 12: 200058E0&lt;BR /&gt;SP : 20005438&lt;BR /&gt;LR : 000088A5&lt;BR /&gt;PC : 200058E0&lt;BR /&gt;xPSR : 610F0000&lt;BR /&gt;PSP : 200053D0&lt;BR /&gt;MSP : 20027FC0&lt;BR /&gt;CPUID: 410FC241&lt;BR /&gt;HFSR : 40000000&lt;BR /&gt;MMFSR: 00000001&lt;BR /&gt;BFSR : 00000000&lt;BR /&gt;UFSR : 00000000&lt;BR /&gt;DFSR : 00000000&lt;BR /&gt;AFSR : 00000000&lt;BR /&gt;Mode : Thread&lt;BR /&gt;Priv : Privileged&lt;BR /&gt;Stack: PSP&lt;/P&gt;&lt;P&gt;-- MbedOS Fault Handler --&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;++ MbedOS Error Info ++&lt;BR /&gt;Error Status: 0x80FF013D Code: 317 Module: 255&lt;BR /&gt;Error Message: Fault exception&lt;BR /&gt;Location: 0x200058E0&lt;BR /&gt;Error Value: 0x20005538&lt;BR /&gt;Current Thread: main Id: 0x20004460 Entry: 0x111A1 StackSize: 0x1000 StackMem: 0x200044A8 SP: 0x20005438&lt;BR /&gt;For more info, visit: &lt;A href="https://mbed.com/s/error?error=0x80FF013D" target="_blank"&gt;https://mbed.com/s/error?error=0x80FF013D&lt;/A&gt;&lt;BR /&gt;-- MbedOS Error Info --&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 13:09:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54618-Hard-Fault-When-entering-DeepSleep/m-p/1681307#M53319</guid>
      <dc:creator>AleemS</dc:creator>
      <dc:date>2023-07-04T13:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54618: Hard Fault When entering DeepSleep</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54618-Hard-Fault-When-entering-DeepSleep/m-p/1683847#M53376</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;If you run the power_manager_lpc example directly, do you have any issue?&lt;/P&gt;
&lt;P&gt;This is the code in above example when you enter deep sleep:&lt;/P&gt;
&lt;P&gt;#define APP_EXCLUDE_FROM_DEEPSLEEP \&lt;BR /&gt;(SYSCON_PDRUNCFG_PDEN_SRAMX_MASK | SYSCON_PDRUNCFG_PDEN_SRAM0_MASK | SYSCON_PDRUNCFG_PDEN_SRAM1_2_3_MASK)&lt;/P&gt;
&lt;P&gt;case kPmu_Deep_Sleep: /* Enter deep sleep mode. */&lt;BR /&gt;&lt;BR /&gt;POWER_EnterDeepSleep(APP_EXCLUDE_FROM_DEEPSLEEP);&lt;BR /&gt;&lt;BR /&gt;break;&lt;/P&gt;
&lt;P&gt;Pls have a try&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 09:16:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54618-Hard-Fault-When-entering-DeepSleep/m-p/1683847#M53376</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2023-07-07T09:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54618: Hard Fault When entering DeepSleep</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54618-Hard-Fault-When-entering-DeepSleep/m-p/1686571#M53455</link>
      <description>&lt;P&gt;Unfortunately it still HardFaults just at another address (due to the build being a different one) but the same instruction. Running the underlying function DeepSleepReloc directly does not cause a hard fault.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 11:04:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54618-Hard-Fault-When-entering-DeepSleep/m-p/1686571#M53455</guid>
      <dc:creator>AleemS</dc:creator>
      <dc:date>2023-07-12T11:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54618: Hard Fault When entering DeepSleep</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54618-Hard-Fault-When-entering-DeepSleep/m-p/1687006#M53461</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;As the following figure of LPC546xx memory map, the address 0x2000_xxxx are SRAM, for the error code:0x200058e0 &amp;lt;+0&amp;gt;: push {r4, r5, r6, r7, lr}, it appears that you allocate/execute the code in SRAM instead of Flash, while you allocate main stack in address 0x200044a8, as you see the code address(0x200058e0) and stack address(0x200044a8) are approaching, I guess that the code is overlapped with stack, that is why you get the hard-fault error, but it is only guess.&lt;/P&gt;
&lt;P&gt;Pls try to allocate the application code in flash instead of SRAM or the other SRAM address and have a try.&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xiangjun_rong_0-1689216085869.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/232044iADA33E20A6AE6883/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xiangjun_rong_0-1689216085869.png" alt="xiangjun_rong_0-1689216085869.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 02:49:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54618-Hard-Fault-When-entering-DeepSleep/m-p/1687006#M53461</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2023-07-13T02:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54618: Hard Fault When entering DeepSleep</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54618-Hard-Fault-When-entering-DeepSleep/m-p/1687272#M53469</link>
      <description>&lt;P&gt;Is it possible, that calling the function directly from flash, corrupts the system state and makes interrupts impossible?&lt;/P&gt;&lt;P&gt;Because after calling the function from Flash i cannot cause the chip to wake up from deepsleep.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 07:42:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54618-Hard-Fault-When-entering-DeepSleep/m-p/1687272#M53469</guid>
      <dc:creator>AleemS</dc:creator>
      <dc:date>2023-07-13T07:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54618: Hard Fault When entering DeepSleep</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54618-Hard-Fault-When-entering-DeepSleep/m-p/1689204#M53506</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;As you know that the LPC546xx uses interrupt mechanism to wake-up the processor from deep-sleep state, so you have to set up the ISR of the waking-up&amp;nbsp; source. I suggest you run all the code in flash.&lt;/P&gt;
&lt;P&gt;Anyway, in SDK, NXP provides power_manager_lpc example, which is fully tested,&amp;nbsp; If you run the power_manager_lpc example directly, do you have any issue?&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 08:44:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54618-Hard-Fault-When-entering-DeepSleep/m-p/1689204#M53506</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2023-07-20T08:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54618: Hard Fault When entering DeepSleep</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54618-Hard-Fault-When-entering-DeepSleep/m-p/1689334#M53508</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;i have solved the problem. In Order to call POWER_EnterDeepSleep in an mbed-os Program you have to create an mbed::ScopedRamExecutionLock inside the Scope that needs to execute from RAM. Otherwise the execution will cause a Hardfault because of the MemoryProtectionUnit. It might be similarly handled in other Real-Time-Operating-Systems.&lt;/P&gt;&lt;P&gt;This also seems to eliminate all Problems with the Interrupts.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 10:23:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54618-Hard-Fault-When-entering-DeepSleep/m-p/1689334#M53508</guid>
      <dc:creator>AleemS</dc:creator>
      <dc:date>2023-07-20T10:23:11Z</dc:date>
    </item>
  </channel>
</rss>

