<?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 Execution code in ram in S32K</title>
    <link>https://community.nxp.com/t5/S32K/Execution-code-in-ram/m-p/1002615#M5963</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, for my eeprom driver designing, i copyed the code from flash to ram,but jump to code in ram, it cause&amp;nbsp;"HardFault" exception. is there any configuration that must be set&amp;nbsp;m&lt;SPAN style="color: #333333; background-color: #fcfcfc;"&gt;anually?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #fcfcfc;"&gt;//static Std_ReturnType Eep_EnEepRam(void)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #fcfcfc;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #fcfcfc;"&gt; FTFC_FCCOB0 = 0x81; /* SETRAM */&lt;BR /&gt; FTFC_FCCOB1 = 0x00; /* FlexRAM available for emulated EEPROM */&lt;BR /&gt; FTFC_FSTAT |= 0x80; /* Launch command */&lt;BR /&gt; while (FTFC_FSTAT &amp;amp; 0x80) {}&lt;BR /&gt; return FTFC_FSTAT == 0? E_OK: E_NOT_OK;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;//void Eep_Init(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;const uint8* EnEepFun;&lt;BR /&gt; uint8* LoadRam = (void*)0x1FFFF000;&lt;BR /&gt; uint32 Depart;&lt;/P&gt;&lt;P&gt;Depart = (SIM_FCFG1 &amp;amp; 0xF000) &amp;gt;&amp;gt; 12;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; if (Depart == 3 || Depart == 4 || Depart == 8 || Depart == 10 || Depart == 11)&lt;BR /&gt; {&lt;BR /&gt; EepRamEnabled = TRUE;&lt;BR /&gt; return;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EnEepFun = (const void*)Eep_EnEepRam;&lt;/P&gt;&lt;P&gt;(void)memcpy(LoadRam, EnEepFun, 20);&lt;BR /&gt; if (((Std_ReturnType(*)(void))LoadRam)() == STD_OK)&lt;BR /&gt; {&lt;BR /&gt; EepRamEnabled = TRUE;&lt;BR /&gt; return;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 25 Jan 2020 17:32:45 GMT</pubDate>
    <dc:creator>markulhu</dc:creator>
    <dc:date>2020-01-25T17:32:45Z</dc:date>
    <item>
      <title>Execution code in ram</title>
      <link>https://community.nxp.com/t5/S32K/Execution-code-in-ram/m-p/1002615#M5963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, for my eeprom driver designing, i copyed the code from flash to ram,but jump to code in ram, it cause&amp;nbsp;"HardFault" exception. is there any configuration that must be set&amp;nbsp;m&lt;SPAN style="color: #333333; background-color: #fcfcfc;"&gt;anually?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #fcfcfc;"&gt;//static Std_ReturnType Eep_EnEepRam(void)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #fcfcfc;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #fcfcfc;"&gt; FTFC_FCCOB0 = 0x81; /* SETRAM */&lt;BR /&gt; FTFC_FCCOB1 = 0x00; /* FlexRAM available for emulated EEPROM */&lt;BR /&gt; FTFC_FSTAT |= 0x80; /* Launch command */&lt;BR /&gt; while (FTFC_FSTAT &amp;amp; 0x80) {}&lt;BR /&gt; return FTFC_FSTAT == 0? E_OK: E_NOT_OK;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;//void Eep_Init(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;const uint8* EnEepFun;&lt;BR /&gt; uint8* LoadRam = (void*)0x1FFFF000;&lt;BR /&gt; uint32 Depart;&lt;/P&gt;&lt;P&gt;Depart = (SIM_FCFG1 &amp;amp; 0xF000) &amp;gt;&amp;gt; 12;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; if (Depart == 3 || Depart == 4 || Depart == 8 || Depart == 10 || Depart == 11)&lt;BR /&gt; {&lt;BR /&gt; EepRamEnabled = TRUE;&lt;BR /&gt; return;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EnEepFun = (const void*)Eep_EnEepRam;&lt;/P&gt;&lt;P&gt;(void)memcpy(LoadRam, EnEepFun, 20);&lt;BR /&gt; if (((Std_ReturnType(*)(void))LoadRam)() == STD_OK)&lt;BR /&gt; {&lt;BR /&gt; EepRamEnabled = TRUE;&lt;BR /&gt; return;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jan 2020 17:32:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Execution-code-in-ram/m-p/1002615#M5963</guid>
      <dc:creator>markulhu</dc:creator>
      <dc:date>2020-01-25T17:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Execution code in ram</title>
      <link>https://community.nxp.com/t5/S32K/Execution-code-in-ram/m-p/1002616#M5964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Steven,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use code below to place the function into the RAM and after that just use the name of the function to call.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;__attribute__ ((section(".code_ram"))) // place the code below into .code_ram section&lt;BR /&gt;void YourFunction(void);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you can check the S32_SBC[CFSR] register. For more details, please, look at the Cortex-M4 Devices Generic User Guide,&amp;nbsp;chapter 4.3.10:&amp;nbsp;&lt;A class="link-titled" href="http://infocenter.arm.com/help/topic/com.arm.doc.dui0553b/DUI0553.pdf" title="http://infocenter.arm.com/help/topic/com.arm.doc.dui0553b/DUI0553.pdf"&gt;http://infocenter.arm.com/help/topic/com.arm.doc.dui0553b/DUI0553.pdf&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume that you use S32K14x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Diana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jan 2020 14:56:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Execution-code-in-ram/m-p/1002616#M5964</guid>
      <dc:creator>dianabatrlova</dc:creator>
      <dc:date>2020-01-27T14:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Execution code in ram</title>
      <link>https://community.nxp.com/t5/S32K/Execution-code-in-ram/m-p/1002617#M5965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Diana,thanks for your advice!&amp;nbsp; i have located the reason ,that&amp;nbsp; because the lowest bit of PC of&amp;nbsp;thumb code must be 1. so i changed&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;LoadRam's value from&amp;nbsp;&lt;SPAN&gt;0x1FFFF000 to&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;0x1FFFF001,&amp;nbsp; it seems running ok.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; "&gt;thank you for your help again!&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 05:49:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Execution-code-in-ram/m-p/1002617#M5965</guid>
      <dc:creator>markulhu</dc:creator>
      <dc:date>2020-01-30T05:49:48Z</dc:date>
    </item>
  </channel>
</rss>

