<?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: Minimum Code for K22FX EEPROM initialization in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Minimum-Code-for-K22FX-EEPROM-initialization/m-p/422289#M2188</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Randy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In general launching a flash command involves 3 steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1-&lt;/STRONG&gt; Filling the &lt;STRONG&gt;FCCOBx&lt;/STRONG&gt; registers with the required parameters.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2-&lt;/STRONG&gt; Clearing the &lt;STRONG&gt;CCIF&lt;/STRONG&gt; flag to trigger the command.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3-&lt;/STRONG&gt; Waiting for &lt;STRONG&gt;CCIF&lt;/STRONG&gt; to be set again, indicating the command completion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;C90TFS&lt;/STRONG&gt; abstracts all of that from the user, but in particular the steps &lt;STRONG&gt;(2)&lt;/STRONG&gt; and &lt;STRONG&gt;(3)&lt;/STRONG&gt; are in the &lt;STRONG&gt;FlashCommandSequence&lt;/STRONG&gt; function. The code of that function needs to be executed from RAM in most cases, that's where &lt;STRONG&gt;RelocateFunction()&lt;/STRONG&gt; copies or clones the function to a space in RAM and returns a pointer to the copied function in RAM. That is the pointer you have to use as a parameter in the APIs. You can see all of this in the code I pasted to my first response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this is not very confusing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Jorge Gonzalez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Sep 2015 21:32:29 GMT</pubDate>
    <dc:creator>Jorge_Gonzalez</dc:creator>
    <dc:date>2015-09-10T21:32:29Z</dc:date>
    <item>
      <title>Minimum Code for K22FX EEPROM initialization</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Minimum-Code-for-K22FX-EEPROM-initialization/m-p/422286#M2185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am working with the C90TFS driver to initialize the EEPROM settings on a K22FX processor.&lt;/P&gt;&lt;P&gt;It looks like I can use DEFlashPartition() to accomplish this, but the documentation isn't clear what should be passed in for the pFlashCommandSequence parameter.&lt;/P&gt;&lt;P&gt;Does anyone have example code or advice on what to do?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also - I understand that this should only be done once so I plan on using the following logic&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get Current EEPROM config&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If EEPROM not initialized&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Initialize EEPROM&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;P&gt;Randy Hermes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Sep 2015 22:06:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Minimum-Code-for-K22FX-EEPROM-initialization/m-p/422286#M2185</guid>
      <dc:creator>randyhermes</dc:creator>
      <dc:date>2015-09-02T22:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Minimum Code for K22FX EEPROM initialization</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Minimum-Code-for-K22FX-EEPROM-initialization/m-p/422287#M2186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Randy Hermes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached there are 3 files I took from the C90TFS standalone installation (not the one that comes with KSDK). Those files are an example for the K21FX512xxx10. The example demonstrates several uses of the Flash driver (erase, program, checksum, read resource, etc) but you may use the FlexNVM part and refer to the use of &lt;STRONG&gt;DEFlashPartition()&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code will respond to your questions as next:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- The parameter &lt;STRONG&gt;pFlashCommandSequence&lt;/STRONG&gt; is a function pointer. In the example the pointer used is called &lt;STRONG&gt;g_FlashLaunchCommand&lt;/STRONG&gt; and it's the result of calling &lt;STRONG&gt;RelocateFunction()&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;- The partition should only be done once. In the example project there is a check for partition as next:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14418550732082732 jive_text_macro" data-renderedposition="240.35000610351562_8_1050_64" jivemacro_uid="_14418550732082732"&gt;&lt;P&gt;if (0x0U == flashSSDConfig.EEEBlockSize)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also for your reference there is a user manual for the &lt;STRONG&gt;C90TFS&lt;/STRONG&gt; driver in KSDK installation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\Freescale\KSDK_1.2.0\platform\drivers\src\flash\C90TFS\FSL_eNVM_FTFx_UM.pdf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps. Let me know if you have any questions.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards!,&lt;BR /&gt;Jorge Gonzalez&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Sep 2015 03:20:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Minimum-Code-for-K22FX-EEPROM-initialization/m-p/422287#M2186</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-09-10T03:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Minimum Code for K22FX EEPROM initialization</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Minimum-Code-for-K22FX-EEPROM-initialization/m-p/422288#M2187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Jorge,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I actually have something working now.&amp;nbsp; The code is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="EEPROM.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/55762i6C7551E844DAF0A5/image-size/large?v=v2&amp;amp;px=999" role="button" title="EEPROM.png" alt="EEPROM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This works fine, will only set the partition once and using the C90TFS FlashCommandSequence seems to work fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would still be nice to have a better description of what pFlashCommandSequence is supposed to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Randy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Sep 2015 16:47:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Minimum-Code-for-K22FX-EEPROM-initialization/m-p/422288#M2187</guid>
      <dc:creator>randyhermes</dc:creator>
      <dc:date>2015-09-10T16:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Minimum Code for K22FX EEPROM initialization</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Minimum-Code-for-K22FX-EEPROM-initialization/m-p/422289#M2188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Randy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In general launching a flash command involves 3 steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1-&lt;/STRONG&gt; Filling the &lt;STRONG&gt;FCCOBx&lt;/STRONG&gt; registers with the required parameters.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2-&lt;/STRONG&gt; Clearing the &lt;STRONG&gt;CCIF&lt;/STRONG&gt; flag to trigger the command.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3-&lt;/STRONG&gt; Waiting for &lt;STRONG&gt;CCIF&lt;/STRONG&gt; to be set again, indicating the command completion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;C90TFS&lt;/STRONG&gt; abstracts all of that from the user, but in particular the steps &lt;STRONG&gt;(2)&lt;/STRONG&gt; and &lt;STRONG&gt;(3)&lt;/STRONG&gt; are in the &lt;STRONG&gt;FlashCommandSequence&lt;/STRONG&gt; function. The code of that function needs to be executed from RAM in most cases, that's where &lt;STRONG&gt;RelocateFunction()&lt;/STRONG&gt; copies or clones the function to a space in RAM and returns a pointer to the copied function in RAM. That is the pointer you have to use as a parameter in the APIs. You can see all of this in the code I pasted to my first response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this is not very confusing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Jorge Gonzalez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Sep 2015 21:32:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Minimum-Code-for-K22FX-EEPROM-initialization/m-p/422289#M2188</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-09-10T21:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Minimum Code for K22FX EEPROM initialization</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Minimum-Code-for-K22FX-EEPROM-initialization/m-p/422290#M2189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again Jorge,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You actually cleared this up for me, now I understand what the pFlashCommandSequence param is for.&lt;/P&gt;&lt;P&gt;It would be nice if this explanation made it into the rev of the C90TFS doc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will also save me some frustration if I ending using the drivers for writes to FLASH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take care&lt;/P&gt;&lt;P&gt;Randy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Sep 2015 22:20:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Minimum-Code-for-K22FX-EEPROM-initialization/m-p/422290#M2189</guid>
      <dc:creator>randyhermes</dc:creator>
      <dc:date>2015-09-10T22:20:09Z</dc:date>
    </item>
  </channel>
</rss>

