<?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 FLEXNVM_Init()==kStatus_FTFx_PartitionStatusUpdateFailure on KE1xF in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FLEXNVM-Init-kStatus-FTFx-PartitionStatusUpdateFailure-on-KE1xF/m-p/903564#M53106</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there anywhere an example of how to use the FSL SDK library for FlexNVM access?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried just to call FLEXNVM_Init() on my MKE1xF but it returns kStatus_FTFx_PartitionStatusUpdateFailure. It's failing inside ftfx_command_sequence() on kStatus_FTFx_AccessError. If I comment out FTFx_FSTAT_ACCERR_MASK, then FLEXNVM_Init() kinda works (returns kStatus_FTFx_Success), but then FLEXNVM_DflashProgram() doesn't seem to write anything (returns kStatus_FTFx_Success, though), and the memory is just filled with 0xff...&lt;/P&gt;&lt;P&gt;My pseudo-code is something like this:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;flexnvm_config_t flashCfg;&lt;/P&gt;&lt;P&gt;memset(&amp;amp;flashCfg, 0, sizeof(flashCfg));&lt;/P&gt;&lt;P&gt;status_t status = FLEXNVM_Init(&amp;amp;flashCfg);&lt;/P&gt;&lt;P&gt;status = FLEXNVM_DflashErase(&amp;amp;flashCfg, 0x10000000, 2048, kFTFx_ApiEraseKey);&lt;/P&gt;&lt;P&gt;status = FLEXNVM_DflashProgram(&amp;amp;flashCfg, 0x10000000, buffer, 2048);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Also,&lt;/P&gt;&lt;P&gt;FLEXNVM_GetSecurityState() = kFTFx_SecurityStateNotSecure&lt;/P&gt;&lt;P&gt;FLEXNVM_DflashGetProtection() = 0xff (non-protected)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's wrong with it and how to do it right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 May 2019 21:17:26 GMT</pubDate>
    <dc:creator>omalay</dc:creator>
    <dc:date>2019-05-07T21:17:26Z</dc:date>
    <item>
      <title>FLEXNVM_Init()==kStatus_FTFx_PartitionStatusUpdateFailure on KE1xF</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FLEXNVM-Init-kStatus-FTFx-PartitionStatusUpdateFailure-on-KE1xF/m-p/903564#M53106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there anywhere an example of how to use the FSL SDK library for FlexNVM access?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried just to call FLEXNVM_Init() on my MKE1xF but it returns kStatus_FTFx_PartitionStatusUpdateFailure. It's failing inside ftfx_command_sequence() on kStatus_FTFx_AccessError. If I comment out FTFx_FSTAT_ACCERR_MASK, then FLEXNVM_Init() kinda works (returns kStatus_FTFx_Success), but then FLEXNVM_DflashProgram() doesn't seem to write anything (returns kStatus_FTFx_Success, though), and the memory is just filled with 0xff...&lt;/P&gt;&lt;P&gt;My pseudo-code is something like this:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;flexnvm_config_t flashCfg;&lt;/P&gt;&lt;P&gt;memset(&amp;amp;flashCfg, 0, sizeof(flashCfg));&lt;/P&gt;&lt;P&gt;status_t status = FLEXNVM_Init(&amp;amp;flashCfg);&lt;/P&gt;&lt;P&gt;status = FLEXNVM_DflashErase(&amp;amp;flashCfg, 0x10000000, 2048, kFTFx_ApiEraseKey);&lt;/P&gt;&lt;P&gt;status = FLEXNVM_DflashProgram(&amp;amp;flashCfg, 0x10000000, buffer, 2048);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Also,&lt;/P&gt;&lt;P&gt;FLEXNVM_GetSecurityState() = kFTFx_SecurityStateNotSecure&lt;/P&gt;&lt;P&gt;FLEXNVM_DflashGetProtection() = 0xff (non-protected)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's wrong with it and how to do it right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2019 21:17:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FLEXNVM-Init-kStatus-FTFx-PartitionStatusUpdateFailure-on-KE1xF/m-p/903564#M53106</guid>
      <dc:creator>omalay</dc:creator>
      <dc:date>2019-05-07T21:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: FLEXNVM_Init()==kStatus_FTFx_PartitionStatusUpdateFailure on KE1xF</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FLEXNVM-Init-kStatus-FTFx-PartitionStatusUpdateFailure-on-KE1xF/m-p/903565#M53107</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="336799" data-username="omalay" href="https://community.nxp.com/people/omalay"&gt;Basil Omalay&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Please tell me which SDK project you are using in the :SDK_2.5.0_TWR-KE18F\boards\twrke18f\driver_examples\flash&lt;/P&gt;&lt;P&gt;&amp;nbsp; You also can try do the mass erase at first before your run the flash code.&lt;/P&gt;&lt;P&gt;&amp;nbsp; About the mass erase, you can use the JLINK commander with JLINK debugger, input: unlock kinetis&lt;/P&gt;&lt;P&gt;&amp;nbsp; Just do the mass erase at first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;Any updated information from your side, please kindly let me know.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&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&gt;&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>Wed, 08 May 2019 05:52:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FLEXNVM-Init-kStatus-FTFx-PartitionStatusUpdateFailure-on-KE1xF/m-p/903565#M53107</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2019-05-08T05:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: FLEXNVM_Init()==kStatus_FTFx_PartitionStatusUpdateFailure on KE1xF</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FLEXNVM-Init-kStatus-FTFx-PartitionStatusUpdateFailure-on-KE1xF/m-p/903566#M53108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;kerryzhou wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Please tell me which SDK project you are using in the :SDK_2.5.0_TWR-KE18F\boards\twrke18f\driver_examples\flash&lt;/P&gt;&lt;P&gt;&amp;nbsp; You also can try do the mass erase at first before your run the flash code.&lt;/P&gt;&lt;P&gt;&amp;nbsp; About the mass erase, you can use the JLINK commander with JLINK debugger, input: unlock kinetis&lt;/P&gt;&lt;P&gt;&amp;nbsp; Just do the mass erase at first.&lt;/P&gt;&amp;nbsp;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Thank you for your answer! I have my own custom project &amp;amp; board based on files from SDK_2.5.0_TWR-KE18F.&lt;/P&gt;&lt;P&gt;I suspect that the problem is that I'm using HSRUN mode. It's mentioned in the manual:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;The user has no access to the Flash command set when the MCU is in HSRUN mode.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;Attempts to launch an FTFE command in HSRUN mode will be trapped with the ACCERR flag being set.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Is it true that I cannot write to FlashNVM at full-speed 168 MHz? Should I first switch to the RUN mode @ 120 MHz, then write to the nvm-flash and then switch back to HSRUN?&lt;/P&gt;&lt;P&gt;Does the SDK have some high-level handy code or examples to easily swich on-the-fly between clock configurations?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 May 2019 15:49:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FLEXNVM-Init-kStatus-FTFx-PartitionStatusUpdateFailure-on-KE1xF/m-p/903566#M53108</guid>
      <dc:creator>omalay</dc:creator>
      <dc:date>2019-05-08T15:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: FLEXNVM_Init()==kStatus_FTFx_PartitionStatusUpdateFailure on KE1xF</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FLEXNVM-Init-kStatus-FTFx-PartitionStatusUpdateFailure-on-KE1xF/m-p/903567#M53109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Basil Omalay,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Thanks a lot for your updated information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Yes, the HSRUN mode is the root problem, just as the reference manual wrote.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; You need to change the clock mode to RUN mode.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; About the RUN mode configuration, you can refer to the SDK sample code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/71904iB6414EF195408F40/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;If you still have question about it, 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>Thu, 09 May 2019 02:13:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FLEXNVM-Init-kStatus-FTFx-PartitionStatusUpdateFailure-on-KE1xF/m-p/903567#M53109</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2019-05-09T02:13:59Z</dc:date>
    </item>
  </channel>
</rss>

