<?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>Kinetis Microcontrollers中的主题 How to set up MK10DXxxx flexNVM EEEPROM</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-set-up-MK10DXxxx-flexNVM-EEEPROM/m-p/962365#M55046</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am working on a project where I would like to use the flexNVM on a MK10DX128VLH7 as flex EEEPROM.&lt;/P&gt;&lt;P&gt;I am testing with the code below on a K20 Tower board, which has a PK20DX256VLL7, also with 32KB of flexNVM that can be used for EEEPROM. My steps are as follows:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;status_t ret = FLASH_Init(&amp;amp;flashConfig); // This returns kStatus_success&lt;/P&gt;&lt;P&gt;uint32_t currentEESize;&lt;/P&gt;&lt;P&gt;ret = FLASH_GetProperty(&amp;amp;flashConfig,kFLASH_PropertyEepromTotalSize, &amp;amp;currentEESize); // Returns kStatus_success&lt;/P&gt;&lt;P&gt;uint32_t currentDflashSize;&lt;/P&gt;&lt;P&gt;ret =&amp;nbsp;FLASH_GetProperty(&amp;amp;flashConfig, kFLASH_PropertyDflashTotalSize, &amp;amp;currentDflashSize); // Returns kStatus_success&lt;/P&gt;&lt;P&gt;// Now, currentEESize==0 and currentDflashSize==32768, and I want to change that.&lt;/P&gt;&lt;P&gt;// First, I read SIM-&amp;gt;FCFG1, which should tell me the total flexNVM size and EEPROM size.&lt;/P&gt;&lt;P&gt;uint32_t fcfg1 = SIM-&amp;gt;FCFG1;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Here, fcfg1 =&amp;nbsp;0xff03_0f00, which I decode as follows:&lt;/P&gt;&lt;P&gt;NVMSIZE = 0xF, which is not defined in the reference manual&lt;/P&gt;&lt;P&gt;PFSIZE = 0xF, which is not defined in the reference manual&lt;/P&gt;&lt;P&gt;EESIZE = 0x3, which is the code for 2KB (the desired size I want).&lt;/P&gt;&lt;P&gt;DEPART = 0xF, which the FlexNVM Partition code section says means Reserved (32KB data flash, no EEPROM)&lt;/P&gt;&lt;P&gt;Next, I attempt to program the partition:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;uint32_t eepromDataSizeCode = 0x3;&lt;/P&gt;&lt;P&gt;uint32_t flexnvmPartitionCode = 0x3;&lt;/P&gt;&lt;P&gt;ret = FLASH_ProgramPartition(&amp;amp;m_flashConfig, kFLASH_PartitionFlexramLoadOptionLoadedWithValidEepromData, eepromDataSizeCode, flexnvmPartitionCode);&lt;/P&gt;&lt;P&gt;------------------------------------------------------------&lt;/P&gt;&lt;P&gt;This returns error 103, which maps to&amp;nbsp;kStatus_FLASH_AccessError&lt;/P&gt;&lt;P&gt;The following driver code is hit, in flash_command_sequence(&amp;amp;flashConfig); :&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; /* checking access error */&lt;BR /&gt; if (registerValue &amp;amp; FTFx_FSTAT_ACCERR_MASK)&lt;BR /&gt; {&lt;BR /&gt; return kStatus_FLASH_AccessError;&lt;BR /&gt; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I don't know why this happens, and I have tried triggering a mass erase at this point, in code. When I reflash my firmware and debug, the same thing happens.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How do I get the flexNVM set up as EEEPROM? I'd love any input/sugggestions/sample code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Collin&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Jun 2019 23:22:48 GMT</pubDate>
    <dc:creator>collinmoore</dc:creator>
    <dc:date>2019-06-07T23:22:48Z</dc:date>
    <item>
      <title>How to set up MK10DXxxx flexNVM EEEPROM</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-set-up-MK10DXxxx-flexNVM-EEEPROM/m-p/962365#M55046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am working on a project where I would like to use the flexNVM on a MK10DX128VLH7 as flex EEEPROM.&lt;/P&gt;&lt;P&gt;I am testing with the code below on a K20 Tower board, which has a PK20DX256VLL7, also with 32KB of flexNVM that can be used for EEEPROM. My steps are as follows:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;status_t ret = FLASH_Init(&amp;amp;flashConfig); // This returns kStatus_success&lt;/P&gt;&lt;P&gt;uint32_t currentEESize;&lt;/P&gt;&lt;P&gt;ret = FLASH_GetProperty(&amp;amp;flashConfig,kFLASH_PropertyEepromTotalSize, &amp;amp;currentEESize); // Returns kStatus_success&lt;/P&gt;&lt;P&gt;uint32_t currentDflashSize;&lt;/P&gt;&lt;P&gt;ret =&amp;nbsp;FLASH_GetProperty(&amp;amp;flashConfig, kFLASH_PropertyDflashTotalSize, &amp;amp;currentDflashSize); // Returns kStatus_success&lt;/P&gt;&lt;P&gt;// Now, currentEESize==0 and currentDflashSize==32768, and I want to change that.&lt;/P&gt;&lt;P&gt;// First, I read SIM-&amp;gt;FCFG1, which should tell me the total flexNVM size and EEPROM size.&lt;/P&gt;&lt;P&gt;uint32_t fcfg1 = SIM-&amp;gt;FCFG1;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Here, fcfg1 =&amp;nbsp;0xff03_0f00, which I decode as follows:&lt;/P&gt;&lt;P&gt;NVMSIZE = 0xF, which is not defined in the reference manual&lt;/P&gt;&lt;P&gt;PFSIZE = 0xF, which is not defined in the reference manual&lt;/P&gt;&lt;P&gt;EESIZE = 0x3, which is the code for 2KB (the desired size I want).&lt;/P&gt;&lt;P&gt;DEPART = 0xF, which the FlexNVM Partition code section says means Reserved (32KB data flash, no EEPROM)&lt;/P&gt;&lt;P&gt;Next, I attempt to program the partition:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;uint32_t eepromDataSizeCode = 0x3;&lt;/P&gt;&lt;P&gt;uint32_t flexnvmPartitionCode = 0x3;&lt;/P&gt;&lt;P&gt;ret = FLASH_ProgramPartition(&amp;amp;m_flashConfig, kFLASH_PartitionFlexramLoadOptionLoadedWithValidEepromData, eepromDataSizeCode, flexnvmPartitionCode);&lt;/P&gt;&lt;P&gt;------------------------------------------------------------&lt;/P&gt;&lt;P&gt;This returns error 103, which maps to&amp;nbsp;kStatus_FLASH_AccessError&lt;/P&gt;&lt;P&gt;The following driver code is hit, in flash_command_sequence(&amp;amp;flashConfig); :&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; /* checking access error */&lt;BR /&gt; if (registerValue &amp;amp; FTFx_FSTAT_ACCERR_MASK)&lt;BR /&gt; {&lt;BR /&gt; return kStatus_FLASH_AccessError;&lt;BR /&gt; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I don't know why this happens, and I have tried triggering a mass erase at this point, in code. When I reflash my firmware and debug, the same thing happens.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How do I get the flexNVM set up as EEEPROM? I'd love any input/sugggestions/sample code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Collin&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jun 2019 23:22:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-set-up-MK10DXxxx-flexNVM-EEEPROM/m-p/962365#M55046</guid>
      <dc:creator>collinmoore</dc:creator>
      <dc:date>2019-06-07T23:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up MK10DXxxx flexNVM EEEPROM</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-set-up-MK10DXxxx-flexNVM-EEEPROM/m-p/962366#M55047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN class=""&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" data-avatarid="-1" data-content-finding="Community" data-userid="329391" data-username="collinmoore" href="https://community.nxp.com/people/collinmoore"&gt;Collin Moore&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Please check my attached simple code, you can try that code, whether it works OK on your side or not?&lt;/P&gt;&lt;P&gt;&amp;nbsp; If you still have question about it,&amp;nbsp; please kindly let me know.&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jun 2019 11:49:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-set-up-MK10DXxxx-flexNVM-EEEPROM/m-p/962366#M55047</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2019-06-10T11:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up MK10DXxxx flexNVM EEEPROM</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-set-up-MK10DXxxx-flexNVM-EEEPROM/m-p/962367#M55048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, line 56&lt;/P&gt;&lt;P&gt;if ( partition_flash( 0X33, 0X02) )//0X03&lt;/P&gt;&lt;P&gt;helped me see my error. The code below works.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;uint32_t eepromDataSizeCode = &lt;STRONG&gt;0x33&lt;/STRONG&gt;; // Set bits 5:4, bits 3:0 are eeesize code&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;uint32_t flexnvmPartitionCode = 0x03;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;ret = FLASH_ProgramPartition(&amp;amp;m_flashConfig, kFLASH_PartitionFlexramLoadOptionLoadedWithValidEepromData, eepromDataSizeCode, flexnvmPartitionCode);&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jun 2019 17:12:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-set-up-MK10DXxxx-flexNVM-EEEPROM/m-p/962367#M55048</guid>
      <dc:creator>collinmoore</dc:creator>
      <dc:date>2019-06-10T17:12:30Z</dc:date>
    </item>
  </channel>
</rss>

