<?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: Flash Write Verify error with read margin = normal (KL17/KL27, KSDK v2) in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-Write-Verify-error-with-read-margin-normal-KL17-KL27-KSDK/m-p/623135#M37293</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Xiangjun. &amp;nbsp;Unfortunately that does not help. &amp;nbsp;I had already read those paragraphs in the user manual.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;In summary, the problem I have is that VerifyProgram succeeds if a "User" margin is used, but fails with an access error if "Normal" margin is specified. &amp;nbsp;I have reproduced this behaviour on two separate boards with different processors, so I doubt it is actually a hardware issue. &amp;nbsp;It seems more likely to me to be a software bug in the SDK. &amp;nbsp;Perhaps you could try replicating this with a FRDM-KL27Z board using the above code ?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Nov 2016 07:45:06 GMT</pubDate>
    <dc:creator>geoff_s</dc:creator>
    <dc:date>2016-11-07T07:45:06Z</dc:date>
    <item>
      <title>Flash Write Verify error with read margin = normal (KL17/KL27, KSDK v2)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-Write-Verify-error-with-read-margin-normal-KL17-KL27-KSDK/m-p/623133#M37291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've encountered some unexpected behaviour using KSDK v2 to verify flash writes, with different settings for the read margin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem was first observed with a bare metal board running a KL17Z processor and some custom code, but I've since replicated it using a FRDM-KL27Z and one of the SDK examples, as shown below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Referring to the Flash driver sample code "flash_erase_program_verify" from the SDK v2, it uses the following (line 189) to verify a previous flash write:&lt;/P&gt;&lt;PRE style="text-align: left;"&gt;result = FLASH_VerifyProgram(&amp;amp;flashDriver, destAdrss, sizeof(buffer), buffer, kFLASH_marginValueUser, &amp;amp;failAddr, &amp;amp;failDat);&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above sample runs ok with the read margin set to "kFLASH_marginValueUser". However if the read margin is changed to "kFLASH_marginValueNormal", the verify fails with a return result of "kStatus_FLASH_AccessError". The SDK manual indicates this means "Invalid instruction codes and out-of bounds addresses".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reference manual for the KL27Z (and KL17Z) describes the read margin settings as follows:&lt;BR /&gt;&lt;EM&gt;"Only the 'normal' read level should be employed during normal flash usage. The nonstandard, 'user' and 'factory' margin levels should be employed only in special cases.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;They can be used during special diagnostic routines to gain confidence that the device is not suffering from the end-of-life data loss customary of flash memory devices."&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seemed to me that using a Normal read margin would be more appropriate for our production code, hence we used kFLASH_marginValueNormal during our flash write verifies. I haven't seen anything in the SDK or processor reference manuals which would suggest this should cause an access error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have I overlooked something or misunderstood how the verify command works, or how the read margins should be set ? Is anyone else able to replicate this behaviour ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 10:45:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-Write-Verify-error-with-read-margin-normal-KL17-KL27-KSDK/m-p/623133#M37291</guid>
      <dc:creator>geoff_s</dc:creator>
      <dc:date>2016-11-02T10:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Write Verify error with read margin = normal (KL17/KL27, KSDK v2)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-Write-Verify-error-with-read-margin-normal-KL17-KL27-KSDK/m-p/623134#M37292</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;Regarding the return value of the FLASH_VerifyProgram(), as you know that there are three types of the flash margin value:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; kFLASH_marginValueNormal,&amp;nbsp; /*!&amp;lt; Use the 'normal' read level for 1s.*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; kFLASH_marginValueUser,&amp;nbsp;&amp;nbsp;&amp;nbsp; /*!&amp;lt; Apply the 'User' margin to the normal read-1 level.*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; kFLASH_marginValueFactory,&lt;/P&gt;&lt;P&gt;Different safety margin level input represents different safety level or flash degrading parameter. I copy the part from UM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 'user' and 'factory' levels become, in effect, a minimum safety margin; i.e. if the reads&lt;BR /&gt;pass at the tighter tolerances of the 'user' and 'factory' margins, then the 'normal' reads&lt;BR /&gt;have at least this much safety margin before they experience data loss.&lt;BR /&gt;The 'user' margin is a small delta to the normal read reference level. 'User' margin levels&lt;BR /&gt;can be employed to check that flash memory contents have adequate margin for normal&lt;BR /&gt;level read operations. If unexpected read results are encountered when checking flash&lt;BR /&gt;memory contents at the 'user' margin levels, loss of information might soon occur during&lt;BR /&gt;'normal' readout.&lt;/P&gt;&lt;P&gt;The 'factory' margin is a bigger deviation from the norm, a more stringent read criteria&lt;BR /&gt;that should only be attempted immediately (or very soon) after completion of an erase or&lt;BR /&gt;program command, early in the cycling life. 'Factory' margin levels can be used to check&lt;BR /&gt;that flash memory contents have adequate margin for long-term data retention at the&lt;BR /&gt;normal level setting. If unexpected results are encountered when checking flash memory&lt;BR /&gt;contents at 'factory' margin levels, the flash memory contents should be erased and reprogrammed.&lt;/P&gt;&lt;P&gt;I have admitted that the part in UM is unclear.&lt;/P&gt;&lt;P&gt;Hope it can help you&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Xiangjun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2016 06:23:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-Write-Verify-error-with-read-margin-normal-KL17-KL27-KSDK/m-p/623134#M37292</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2016-11-07T06:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Write Verify error with read margin = normal (KL17/KL27, KSDK v2)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-Write-Verify-error-with-read-margin-normal-KL17-KL27-KSDK/m-p/623135#M37293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Xiangjun. &amp;nbsp;Unfortunately that does not help. &amp;nbsp;I had already read those paragraphs in the user manual.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;In summary, the problem I have is that VerifyProgram succeeds if a "User" margin is used, but fails with an access error if "Normal" margin is specified. &amp;nbsp;I have reproduced this behaviour on two separate boards with different processors, so I doubt it is actually a hardware issue. &amp;nbsp;It seems more likely to me to be a software bug in the SDK. &amp;nbsp;Perhaps you could try replicating this with a FRDM-KL27Z board using the above code ?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2016 07:45:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-Write-Verify-error-with-read-margin-normal-KL17-KL27-KSDK/m-p/623135#M37293</guid>
      <dc:creator>geoff_s</dc:creator>
      <dc:date>2016-11-07T07:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Write Verify error with read margin = normal (KL17/KL27, KSDK v2)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-Write-Verify-error-with-read-margin-normal-KL17-KL27-KSDK/m-p/623136#M37294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P data-darkreader-inline-bgcolor="" data-darkreader-inline-border-bottom="" data-darkreader-inline-border-left="" data-darkreader-inline-border-right="" data-darkreader-inline-border-top="" data-darkreader-inline-color="" style="color: #c1bdb7; background-color: #17181c; border: 0px;"&gt;I have this same problem on a K20DX256VLL7 with flash driver 2.3.1 (in fsl_flash.h).&lt;/P&gt;&lt;P data-darkreader-inline-bgcolor="" data-darkreader-inline-border-bottom="" data-darkreader-inline-border-left="" data-darkreader-inline-border-right="" data-darkreader-inline-border-top="" data-darkreader-inline-color="" style="color: #c1bdb7; background-color: #17181c; border: 0px;"&gt;I have also read the manuals, as geoff_s has, and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN data-darkreader-inline-bgcolor="" data-darkreader-inline-border-bottom="" data-darkreader-inline-border-left="" data-darkreader-inline-border-right="" data-darkreader-inline-border-top="" data-darkreader-inline-color="" style="color: #c1bdb7; background-color: #17181c; border: 0px; font-weight: inherit;"&gt;Xiangjun's answer is not helpful, as it doesn't make sense. How does the User level work but Normal level fail, if we are supposed to use Normal level?&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-darkreader-inline-bgcolor="" data-darkreader-inline-border-bottom="" data-darkreader-inline-border-left="" data-darkreader-inline-border-right="" data-darkreader-inline-border-top="" data-darkreader-inline-color="" style="color: #c1bdb7; background-color: #17181c; border: 0px;"&gt;If anyone has any answers, feel free to reply...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Mar 2019 00:31:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-Write-Verify-error-with-read-margin-normal-KL17-KL27-KSDK/m-p/623136#M37294</guid>
      <dc:creator>collinmoore</dc:creator>
      <dc:date>2019-03-15T00:31:46Z</dc:date>
    </item>
  </channel>
</rss>

