<?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: S32K312 Flash Driver can not run in RAM in S32K</title>
    <link>https://community.nxp.com/t5/S32K/S32K312-Flash-Driver-can-not-run-in-RAM/m-p/1728758#M27355</link>
    <description>&lt;P&gt;Hi Senlent,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;By assigning different array pointer to&amp;nbsp;&lt;SPAN&gt;g_pFlashDriverAPIRAM,i think it is right&amp;nbsp;g_pFlashDriverAPIRAM have different address in this two situation.If you initialize g_flashDriverRAM1 like&amp;nbsp;g_flashDriverRAM,it also can work normally.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Sep 2023 08:53:18 GMT</pubDate>
    <dc:creator>Leo_99</dc:creator>
    <dc:date>2023-09-25T08:53:18Z</dc:date>
    <item>
      <title>S32K312 Flash Driver can not run in RAM</title>
      <link>https://community.nxp.com/t5/S32K/S32K312-Flash-Driver-can-not-run-in-RAM/m-p/1728421#M27337</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Recently i have made a flash driver and export it as a hex file,i take hexadecimal data in the file into a global array 'g_flashDriverRAM' and change the array&amp;nbsp;g_flashDriverRAM to a function pointer.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Later i excute the function pointer to do erase flash and write flash funtion,it can work well.The flash memory can be modified as i want.However,when i copy the data in&amp;nbsp;g_flashDriverRAM to a new array 'g_flashDriverRAM1' and change it to function pointer to excute,it case a hardfault. I have check that the data in&amp;nbsp;g_flashDriverRAM is same as&amp;nbsp;g_flashDriverRAM1,i can change&amp;nbsp;g_flashDriverRAM to&amp;nbsp; function pointer to excute erasing and writing flash function but can not work when i use&amp;nbsp;g_flashDriverRAM1.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; I also try to copy the data in&amp;nbsp;g_flashDriverRAM to a assigned RAM address and change the assigned RAM address as a function pointer to excute,it also can not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; The main different of&amp;nbsp;g_flashDriverRAM and&amp;nbsp;g_flashDriverRAM1 is that g_flashDriverRAM has initialized when declaration but&amp;nbsp;g_flashDriverRAM1 does not initialize when declaration.I check the map file and found that&amp;nbsp;g_flashDriverRAM is store in .data segment and&amp;nbsp;g_flashDriverRAM1 is store in .bss segment.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Follow figure are some part of my code:&lt;/P&gt;&lt;P&gt;(1)define two array, g_flashDriverRAM is initialized and&amp;nbsp;g_flashDriverRAM1 is not initialized&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Leo_99_0-1695606146338.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/242373i51301CDCF5482B05/image-size/large?v=v2&amp;amp;px=999" role="button" title="Leo_99_0-1695606146338.png" alt="Leo_99_0-1695606146338.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(2)check the map file after compliering,it can be found that&amp;nbsp;g_flashDriverRAM is store in .data segment and&amp;nbsp;g_flashDriverRAM1 is store in .bss segment.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Leo_99_2-1695606293617.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/242375iD5E6EFA997B98A2C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Leo_99_2-1695606293617.png" alt="Leo_99_2-1695606293617.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="Leo_99_3-1695606324984.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/242376i1EFED0F7F4FDFE2B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Leo_99_3-1695606324984.png" alt="Leo_99_3-1695606324984.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(3)change the&amp;nbsp;g_flashDriverRAM to function pointer and excute erasing and writing flash operation,it can work well,however when copy the data in&amp;nbsp;g_flashDriverRAM to&amp;nbsp;g_flashDriverRAM1 and do the same operation,it cause hardfault.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Leo_99_4-1695606597815.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/242379i6E53C2B28009A458/image-size/large?v=v2&amp;amp;px=999" role="button" title="Leo_99_4-1695606597815.png" alt="Leo_99_4-1695606597815.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="Leo_99_5-1695606617814.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/242380i44E968C8B7D3251E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Leo_99_5-1695606617814.png" alt="Leo_99_5-1695606617814.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Is there anything i forget to configure or any fault operation i have made?Can you tell me how to solve this problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and Best Regard,&lt;/P&gt;&lt;P&gt;Leo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 01:52:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K312-Flash-Driver-can-not-run-in-RAM/m-p/1728421#M27337</guid>
      <dc:creator>Leo_99</dc:creator>
      <dc:date>2023-09-25T01:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: S32K312 Flash Driver can not run in RAM</title>
      <link>https://community.nxp.com/t5/S32K/S32K312-Flash-Driver-can-not-run-in-RAM/m-p/1728468#M27343</link>
      <description>&lt;P&gt;&lt;A href="mailto:Hi@Leo_99" target="_blank"&gt;Hi@Leo_99&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;could you please share this project so i can reproduce your problem.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 03:08:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K312-Flash-Driver-can-not-run-in-RAM/m-p/1728468#M27343</guid>
      <dc:creator>Senlent</dc:creator>
      <dc:date>2023-09-25T03:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: S32K312 Flash Driver can not run in RAM</title>
      <link>https://community.nxp.com/t5/S32K/S32K312-Flash-Driver-can-not-run-in-RAM/m-p/1728488#M27344</link>
      <description>&lt;P&gt;Hi Senlent,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; The attachment of this message is my project,you can used it to&amp;nbsp;&lt;SPAN&gt;reproduce the problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;You can use the three line code to operate flash normally.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Leo_99_0-1695612812685.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/242393i828EDA0529356D2F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Leo_99_0-1695612812685.png" alt="Leo_99_0-1695612812685.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;You can use the three line code to reproduce the problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Leo_99_1-1695612909103.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/242394iC94D37D759A2C00D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Leo_99_1-1695612909103.png" alt="Leo_99_1-1695612909103.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 03:41:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K312-Flash-Driver-can-not-run-in-RAM/m-p/1728488#M27344</guid>
      <dc:creator>Leo_99</dc:creator>
      <dc:date>2023-09-25T03:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: S32K312 Flash Driver can not run in RAM</title>
      <link>https://community.nxp.com/t5/S32K/S32K312-Flash-Driver-can-not-run-in-RAM/m-p/1728729#M27353</link>
      <description>&lt;P&gt;&lt;A href="mailto:Hi@Leo_99" target="_blank"&gt;Hi@Leo_99&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In your demo, the address pointed to by g_pFlashDriverAPIRAM is actually different, I think this is why the error occurred.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Senlent_2-1695629970259.png" style="width: 664px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/242474i91D35585535EAF9C/image-dimensions/664x332?v=v2" width="664" height="332" role="button" title="Senlent_2-1695629970259.png" alt="Senlent_2-1695629970259.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="Senlent_3-1695629975066.png" style="width: 666px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/242475iBC3143EDF2034E2F/image-dimensions/666x333?v=v2" width="666" height="333" role="button" title="Senlent_3-1695629975066.png" alt="Senlent_3-1695629975066.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 08:32:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K312-Flash-Driver-can-not-run-in-RAM/m-p/1728729#M27353</guid>
      <dc:creator>Senlent</dc:creator>
      <dc:date>2023-09-25T08:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: S32K312 Flash Driver can not run in RAM</title>
      <link>https://community.nxp.com/t5/S32K/S32K312-Flash-Driver-can-not-run-in-RAM/m-p/1728758#M27355</link>
      <description>&lt;P&gt;Hi Senlent,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;By assigning different array pointer to&amp;nbsp;&lt;SPAN&gt;g_pFlashDriverAPIRAM,i think it is right&amp;nbsp;g_pFlashDriverAPIRAM have different address in this two situation.If you initialize g_flashDriverRAM1 like&amp;nbsp;g_flashDriverRAM,it also can work normally.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 08:53:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K312-Flash-Driver-can-not-run-in-RAM/m-p/1728758#M27355</guid>
      <dc:creator>Leo_99</dc:creator>
      <dc:date>2023-09-25T08:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: S32K312 Flash Driver can not run in RAM</title>
      <link>https://community.nxp.com/t5/S32K/S32K312-Flash-Driver-can-not-run-in-RAM/m-p/1729221#M27374</link>
      <description>&lt;P&gt;&lt;A href="mailto:Hi@Leo_99" target="_blank"&gt;Hi@Leo_99&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;please have a try below methods.&lt;/P&gt;
&lt;P&gt;1.change pointer to same with g_flashDrvierRAM&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;g_pFlashDriverAPIRAM = (tFlashDriverAPIInfo *)g_flashDriverRAM1;
g_pFlashDriverAPIRAM-&amp;gt;pfFLASH_DRV_EraseSector = (tpfFLASH_DRV_EraseSector) ((uint32)g_flashDriverRAM1-1+(uint32)(g_pFlashDriverAPIRAM-&amp;gt;pfFLASH_DRV_EraseSector));
g_pFlashDriverAPIRAM-&amp;gt;pfFLASH_DRV_Program = (tpfFLASH_DRV_Program) ((uint32)g_flashDriverRAM1-1+(uint32)(g_pFlashDriverAPIRAM-&amp;gt;pfFLASH_DRV_Program));&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Senlent_2-1695690029991.png" style="width: 720px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/242608iC735C669E324A324/image-dimensions/720x71?v=v2" width="720" height="71" role="button" title="Senlent_2-1695690029991.png" alt="Senlent_2-1695690029991.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;2. try set g_flashDriverRAM to .data sector.&lt;/P&gt;
&lt;P&gt;Define any initial value, which will allocate g_flashDriverRAM to the .data section&lt;/P&gt;
&lt;P&gt;uint8_t g_flashDriverRAM1[1424] = {0,1,2,3,4};&lt;/P&gt;
&lt;P&gt;I have tested the above two methods, but for some reason they are not successful every time.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 01:05:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K312-Flash-Driver-can-not-run-in-RAM/m-p/1729221#M27374</guid>
      <dc:creator>Senlent</dc:creator>
      <dc:date>2023-09-26T01:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: S32K312 Flash Driver can not run in RAM</title>
      <link>https://community.nxp.com/t5/S32K/S32K312-Flash-Driver-can-not-run-in-RAM/m-p/2015790#M44358</link>
      <description>你好，请问这个问题怎么解决喃？我也遇到同样的问题，函数不能复制到RAM中执行。&lt;BR /&gt;Hello, may I ask how to solve this problem? I am also having the same problem where functions cannot be copied to RAM for execut</description>
      <pubDate>Wed, 18 Dec 2024 05:25:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K312-Flash-Driver-can-not-run-in-RAM/m-p/2015790#M44358</guid>
      <dc:creator>Lizijunasdasd</dc:creator>
      <dc:date>2024-12-18T05:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: S32K312 Flash Driver can not run in RAM</title>
      <link>https://community.nxp.com/t5/S32K/S32K312-Flash-Driver-can-not-run-in-RAM/m-p/2015801#M44360</link>
      <description>&lt;P&gt;&lt;SPAN&gt;你好，请问这个问题怎么解决喃？我也遇到同样的问题，函数不能复制到RAM中执行。&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello, may I ask how to solve this problem? I am also having the same problem where functions cannot be copied to RAM for execut&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 05:39:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K312-Flash-Driver-can-not-run-in-RAM/m-p/2015801#M44360</guid>
      <dc:creator>Lizijunasdasd</dc:creator>
      <dc:date>2024-12-18T05:39:14Z</dc:date>
    </item>
  </channel>
</rss>

