<?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: LPC54628 MemFault not raised when calling function via pointer</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54628-MemFault-not-raised-when-calling-function-via-pointer/m-p/1255894#M44503</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;It looks like setting correct TEX bits inside&amp;nbsp;MPU-&amp;gt;RASR register does the job. I have to study it further but basically it seems that everything works as expected. I'm marking your answer as a solution and going to invastigate it more deeply.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Apr 2021 14:53:43 GMT</pubDate>
    <dc:creator>mateuszkiełbasa</dc:creator>
    <dc:date>2021-04-01T14:53:43Z</dc:date>
    <item>
      <title>LPC54628 MemFault not raised when calling function via pointer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54628-MemFault-not-raised-when-calling-function-via-pointer/m-p/1254346#M44475</link>
      <description>&lt;P&gt;Hello, I'm working on NXP LPC54628 development board (ARM Cortex M4) and trying to configure MPU in a way that execute never (XN) flag is enabled on internal SRAM. I configured MPU and trying to call function from SRAM, e.g.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;__RAMFUNC(SRAM_UPPER) static void function_to_be_executed(void)&lt;/P&gt;&lt;P&gt;{&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; /* do some nasty things here */&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;At this point everything works like a charm - MemFault is generated. But trying to call this function via pointer, e.g.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;typedef void(*func)(void);&lt;/P&gt;&lt;P&gt;func f = function_to_be_executed;&lt;/P&gt;&lt;P&gt;f();&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;seems not to generate any exception. Is it normal? Am I missing something? From my POV in this case exception should also be generated,&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 15:30:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54628-MemFault-not-raised-when-calling-function-via-pointer/m-p/1254346#M44475</guid>
      <dc:creator>mateuszkiełbasa</dc:creator>
      <dc:date>2021-03-30T15:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54628 MemFault not raised when calling function via pointer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54628-MemFault-not-raised-when-calling-function-via-pointer/m-p/1254641#M44478</link>
      <description>&lt;P&gt;Hi, &lt;SPAN&gt;&lt;A href="https://community.nxp.com/t5/user/viewprofilepage/user-id/159850" target="_blank"&gt;mateusz&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regarding your question, I think the MPU functions no matter if you call it as a function as as a function pointer.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As you know that there is a backup or mirror in flash space for the void function_to_be_executed(void), pls check if the pointer f [which is defined as func f = function_to_be_executed] is located in flash address range or RAM range.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;BR&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Xiangjun Rong&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 03:32:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54628-MemFault-not-raised-when-calling-function-via-pointer/m-p/1254641#M44478</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2021-03-31T03:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54628 MemFault not raised when calling function via pointer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54628-MemFault-not-raised-when-calling-function-via-pointer/m-p/1255033#M44486</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;According to debugger the function is actually running from SRAM. I've also tried to do second trial and moved the function to external flash (BOARD_SDRAM) via __TEXT() macro and result is the same... I mean running the function explicitly generates MemFault exception, but running the function via pointer doesn't.&amp;nbsp;&lt;LI-EMOJI id="lia_disappointed-face" title=":disappointed_face:"&gt;&lt;/LI-EMOJI&gt; That is really weird. How is it possible? I don't think there is MPU setting for that - it should simply work as is...&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 15:52:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54628-MemFault-not-raised-when-calling-function-via-pointer/m-p/1255033#M44486</guid>
      <dc:creator>mateuszkiełbasa</dc:creator>
      <dc:date>2021-03-31T15:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54628 MemFault not raised when calling function via pointer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54628-MemFault-not-raised-when-calling-function-via-pointer/m-p/1255456#M44488</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Regarding your question that the calling function can trigger MemManage Fault after MPU initialization, but calling function pointer can NOT trigger MemManage Fault, it is abnormal.&lt;/P&gt;
&lt;P&gt;How about consulting ARM support? I have searched on google, no clue.&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 03:23:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54628-MemFault-not-raised-when-calling-function-via-pointer/m-p/1255456#M44488</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2021-04-01T03:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54628 MemFault not raised when calling function via pointer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54628-MemFault-not-raised-when-calling-function-via-pointer/m-p/1255894#M44503</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;It looks like setting correct TEX bits inside&amp;nbsp;MPU-&amp;gt;RASR register does the job. I have to study it further but basically it seems that everything works as expected. I'm marking your answer as a solution and going to invastigate it more deeply.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 14:53:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54628-MemFault-not-raised-when-calling-function-via-pointer/m-p/1255894#M44503</guid>
      <dc:creator>mateuszkiełbasa</dc:creator>
      <dc:date>2021-04-01T14:53:43Z</dc:date>
    </item>
  </channel>
</rss>

