<?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: using FlexRAM with MCAL EEP in S32K</title>
    <link>https://community.nxp.com/t5/S32K/using-FlexRAM-with-MCAL-EEP/m-p/1222053#M9726</link>
    <description>&lt;P&gt;I would like to see an code example + tresos config of the EEP module working&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jan 2021 17:04:08 GMT</pubDate>
    <dc:creator>riglesias2021</dc:creator>
    <dc:date>2021-01-27T17:04:08Z</dc:date>
    <item>
      <title>using FlexRAM with MCAL EEP</title>
      <link>https://community.nxp.com/t5/S32K/using-FlexRAM-with-MCAL-EEP/m-p/1039721#M6667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to use MCAL EEP module to use the FlexRAM. I am using the S32K118 EVB and S32 Design Studio.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have made the configurations on EB Tresos, and tried to use the module. In my main function I have called the Eep_Init() function and&amp;nbsp;Eep_AC_Callback(),&amp;nbsp;Eep_StartEepromAccessNotif(), and&amp;nbsp;Eep_FinishedEepromAccessNotif() callbacks are entered.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I have set up a timer which calls Eep_Main_Function() at every&amp;nbsp;second or so. I also called the Eep_Write() and&amp;nbsp;Eep_GetJobResult() functions with a button push.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After I call Eep_Write() function and calling the&amp;nbsp;&lt;SPAN&gt;Eep_Main_Function() and waiting for a while, I called&amp;nbsp;Eep_GetJobResult() and it returned&amp;nbsp;MEMIF_JOB_FAILED.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the Integration Manual of the EEP module, it is stated that&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;The Eeprom memory physical sectors that are going to be modified by Eep driver (i.e. erase and write operations) have to be unprotected for a successful operation.&lt;BR /&gt;The FlexNVM memory has to be partitioned for EEPROM emulation.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;and I simply haven't configured these as far as I can tell. Is this the reason? If so, how can I partition the FlexNVM for EEPROM emulation and make sure that the physical sectors are unprotected, using MCAL drivers?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, what&amp;nbsp;are the differences between the EEP module and FLS/FEE modules? Should I use them instead of EEP?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: After Eep_Init(), I checked the status&amp;nbsp;with a timer at 1 second&amp;nbsp;intervals, and it always returns MEMIF_UNINIT. So, I&amp;nbsp;guess&amp;nbsp;my issue is that I haven't configured Eep properly. How can I fix this?&lt;/P&gt;&lt;P&gt;Edit 2: I have looked at the example code provided here:&amp;nbsp;&lt;A href="https://community.nxp.com/docs/DOC-340625"&gt;EXAMPLE: S32K144 EEEPROM usage - No SDK&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;When I call the following function after&amp;nbsp;Mcu_Init(); Mcu_InitClock(); andMcu_SetMode(); I get a Hard Fault error.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;uint8 EEE_Init()&lt;BR /&gt;{&lt;BR /&gt;if ((FTFC-&amp;gt;FCNFG &amp;amp; FTFC_FCNFG_EEERDY_MASK) == 0U)&lt;BR /&gt; {&lt;BR /&gt;volatile int timeout;&lt;BR /&gt; FTFC-&amp;gt;FCCOB[3]=0x80; // Program Partition command&lt;BR /&gt; FTFC-&amp;gt;FCCOB[2]=0x00; // CSEc key size&lt;BR /&gt; FTFC-&amp;gt;FCCOB[1]=0x00; // Security flag extension - User Key verify only disabled&lt;BR /&gt;FTFC-&amp;gt;FCCOB[0]=0x00; // Load data int EEERAM in reset sequence&lt;BR /&gt;FTFC-&amp;gt;FCCOB[7]=0x01; // EEPROM data set size code - 4k&lt;BR /&gt;FTFC-&amp;gt;FCCOB[6]=0x08; // EEPROM backup size - 64k&lt;BR /&gt;FTFC-&amp;gt;FSTAT |= FTFC_FSTAT_CCIF_MASK;&lt;/P&gt;&lt;P&gt;while ((FTFC-&amp;gt;FSTAT &amp;amp; FTFC_FSTAT_CCIF_MASK) == 0U)&lt;BR /&gt; {&lt;BR /&gt; timeout++;&lt;BR /&gt; }&lt;BR /&gt; /*FTFC-&amp;gt;FCCOB[3]=0x81; // Progran command&lt;BR /&gt; FTFC-&amp;gt;FCCOB[2]=0x00; // FlexRAM used as EEEPROM&lt;BR /&gt; FTFC-&amp;gt;FSTAT |= FTFC_FSTAT_CCIF_MASK;&lt;BR /&gt; while ((FTFC-&amp;gt;FSTAT &amp;amp; FTFC_FSTAT_CCIF_MASK) == 0U);&lt;BR /&gt; {&lt;BR /&gt; timeout++;&lt;BR /&gt; }*/&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; return 1;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Further debugging revealed that I get the Hard Fault error at the line&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;FTFC-&amp;gt;FSTAT |= FTFC_FSTAT_CCIF_MASK;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;Edit 3: After the Hard Fault error, I have checked FSTAT-&amp;gt;FPVIOL and it is 0, which I think means there is no violation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;Edit 4: Ok, I have understood my error and fixed the Partitioning part to the code below and it is working fine now. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;However, I still want to know&amp;nbsp;whether it is possible to do this using MCAL drivers or not.&amp;nbsp;Do I have to access&amp;nbsp;the FTFC registers manually to use the EEP driver? Is there something I can use in the MCAL drivers for Partitioning?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;if ((FTFC-&amp;gt;FCNFG &amp;amp; FTFC_FCNFG_EEERDY_MASK) == 0U)&lt;BR /&gt; {&lt;BR /&gt;volatile int timeout;&lt;BR /&gt; FTFC-&amp;gt;FCCOB[3]=0x80; // Program Partition command&lt;BR /&gt; FTFC-&amp;gt;FCCOB[2]=0x00; // CSEc key size&lt;BR /&gt; FTFC-&amp;gt;FCCOB[1]=0x00; // Security flag extension - User Key verify only disabled&lt;BR /&gt;FTFC-&amp;gt;FCCOB[0] |= 0x00; // Load data int EEERAM in reset sequence&lt;BR /&gt;FTFC-&amp;gt;FCCOB[7]=0x03; // EEPROM data set size code - 4k&lt;BR /&gt;FTFC-&amp;gt;FCCOB[6]=0x03; // EEPROM backup size - 32k&lt;BR /&gt;FTFC-&amp;gt;FSTAT |= FTFC_FSTAT_CCIF_MASK;&lt;BR /&gt;while ((FTFC-&amp;gt;FSTAT &amp;amp; FTFC_FSTAT_CCIF_MASK) == 0U)&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;timeout++;&lt;BR /&gt; }&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2020 08:35:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/using-FlexRAM-with-MCAL-EEP/m-p/1039721#M6667</guid>
      <dc:creator>talha_uyar</dc:creator>
      <dc:date>2020-06-01T08:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: using FlexRAM with MCAL EEP</title>
      <link>https://community.nxp.com/t5/S32K/using-FlexRAM-with-MCAL-EEP/m-p/1039722#M6668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;SPAN style="color: #646464; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A _jive_internal="true" class="" data-content-finding="Community" data-userid="358354" data-username="talha.uyar@karel.com.tr" href="https://community.nxp.com/people/talha.uyar@karel.com.tr" style="color: #3d9ce7; background-color: #ffffff; border: 0px; font-weight: 600; text-decoration: none; font-size: 11.9994px;"&gt;Muhammet Uyar&lt;/A&gt;,&lt;BR /&gt; &lt;BR /&gt; I would like to answer your question:&lt;BR /&gt; &lt;STRONG&gt;Is this the reason? If so, how can I partition the FlexNVM for EEPROM emulation and make sure that the physical sectors are unprotected, using MCAL drivers?&lt;/STRONG&gt;&lt;BR /&gt; [Hung] The MCAL driver have 3 module(EEP, FLS, CSEC) share some hardware resources of the FLEXNVM memory so several aspects need to be considered when using them together in the same application. User will need to consider it. So the EEP will not automatic partition the FlexNVM for EEPROM emulation. The MCAL driver also doesn't support partitioning the FlexNVM for EEPROM emulation and make sure that the physical sectors are unprotected. User will need to access FTFC register manually to partition the FlexNVM for EEPROM emulation.&lt;BR /&gt; &lt;BR /&gt; &lt;STRONG&gt;what are the differences between the EEP module and FLS/FEE modules?&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Should I use them instead of EEP?&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt; [Hung] The EEP use the FlexRAM as EEP ROM with Hardware support.&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;The FEE/FLS emulates the EEP ROM uses Flash with software support.( &lt;EM&gt;&lt;SPAN class=""&gt;For the devices without EEPROM memory, the block-erasable (or sector-erasable) flash memory can be used to emulate the EEPROM through EEPROM emulation software&lt;/SPAN&gt; &lt;/EM&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;User can choose EEP or FEE base on the application and hardware.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Hung.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jun 2020 08:26:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/using-FlexRAM-with-MCAL-EEP/m-p/1039722#M6668</guid>
      <dc:creator>hungnguyenphi</dc:creator>
      <dc:date>2020-06-02T08:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: using FlexRAM with MCAL EEP</title>
      <link>https://community.nxp.com/t5/S32K/using-FlexRAM-with-MCAL-EEP/m-p/1221973#M9719</link>
      <description>&lt;P&gt;Hi! Could you share some info/code snippets/docs that you checked out to get EEP module working? I´m using S32K118 and i already partitioned the FlexNVM/FlexRAM, and now i need to get the eeprom working using the EEP module.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!!!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 13:59:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/using-FlexRAM-with-MCAL-EEP/m-p/1221973#M9719</guid>
      <dc:creator>riglesias2021</dc:creator>
      <dc:date>2021-01-27T13:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: using FlexRAM with MCAL EEP</title>
      <link>https://community.nxp.com/t5/S32K/using-FlexRAM-with-MCAL-EEP/m-p/1222053#M9726</link>
      <description>&lt;P&gt;I would like to see an code example + tresos config of the EEP module working&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 17:04:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/using-FlexRAM-with-MCAL-EEP/m-p/1222053#M9726</guid>
      <dc:creator>riglesias2021</dc:creator>
      <dc:date>2021-01-27T17:04:08Z</dc:date>
    </item>
  </channel>
</rss>

