<?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中的主题 Re: K22 FLASH, Question about (re) writing to a longword</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-FLASH-Question-about-re-writing-to-a-longword/m-p/631719#M38043</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Freescale/NXP is intentionally 'tight lipped' about even the EXISTENCE of this unseen ECC, let alone willing to discuss ANYTHING about it.&amp;nbsp; Tools that use this memory as 'proper' program-flash are going to be cleanly erasing and writing 'whole chunks'.&amp;nbsp; It is only us tricksters trying to do things like place 'some rarely updated' parameter-sections in this flash that have to be 'more careful' in usage&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Apr 2017 00:58:44 GMT</pubDate>
    <dc:creator>egoodii</dc:creator>
    <dc:date>2017-04-21T00:58:44Z</dc:date>
    <item>
      <title>K22 FLASH, Question about (re) writing to a longword</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-FLASH-Question-about-re-writing-to-a-longword/m-p/631714#M38038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am attempting to write an easier-to-work-with flash utility and I want to be as efficient as possible when an erase needs to occur (due to how long it takes). &amp;nbsp;I am curious about the following situations:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Situation: The flash sector is previously erased, and a single byte was written into a longword. &amp;nbsp;The other 3 bytes are still erased, and the longword looks like this: &amp;nbsp;(erased) 0xFF 0xFF 0xFF 0xFF -&amp;gt; (programmed) 0x01 0xFF 0xFF 0xFF&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Q1.) If I wanted to program the second byte to 0x02, resulting in 0x01 0x02 0xFF 0xFF, can I program the longword with 0x01 0x02 0xFF 0xFF, or do I have to erase the entire sector to write that single new byte into an already erased byte?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Q2.) If reprogramming the 0x01 in the first byte will overstress the device (which I have seen warnings that say writing a '0' multiple times will overstress the FLASH) then, can I be cheeky and attempt to program 0xFF 0x02 0xFF 0xFF into the already programmed long word? &amp;nbsp;The first byte would be "programmed" to 0xFF (which means that no zeros would be re-programmed), or will this result in some sort of fault (either during programming, or attempting to read the flash)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, and Looking forward to hearing the answers!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 23:24:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-FLASH-Question-about-re-writing-to-a-longword/m-p/631714#M38038</guid>
      <dc:creator>chriskeeser</dc:creator>
      <dc:date>2017-04-20T23:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: K22 FLASH, Question about (re) writing to a longword</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-FLASH-Question-about-re-writing-to-a-longword/m-p/631715#M38039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The reference manual states that you must write a longword whole as one step, and leave it alone from there.&amp;nbsp; You can expect this has a 'little' to do with overstress, but the larger issue is hidden ECC bits written with a longword-write which CANNOT be updated as part of a 'further write'.&amp;nbsp; Access after the 'second write' will net a hard-fault.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 23:36:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-FLASH-Question-about-re-writing-to-a-longword/m-p/631715#M38039</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2017-04-20T23:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: K22 FLASH, Question about (re) writing to a longword</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-FLASH-Question-about-re-writing-to-a-longword/m-p/631716#M38040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the prompt reply! &amp;nbsp;I wonder then, what happens if I "program" a longword with 0xFF 0xFF 0xFF 0xFF, then later "re-program" it with new data? &amp;nbsp;What I am concerned about is, how will I know if a longword has been programmed before if I can't simply check to see if it is 0xFF 0xFF 0xFF 0xFF?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 23:45:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-FLASH-Question-about-re-writing-to-a-longword/m-p/631716#M38040</guid>
      <dc:creator>chriskeeser</dc:creator>
      <dc:date>2017-04-20T23:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: K22 FLASH, Question about (re) writing to a longword</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-FLASH-Question-about-re-writing-to-a-longword/m-p/631717#M38041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suppose it is POSSIBLE that the ECC written with an 'all ones' datablock would ALSO be 'all ones', so that the result is still a 'virgin longword' --- I suppose you can try writing &lt;SPAN style="text-decoration: underline;"&gt;that&lt;/SPAN&gt;, then something else, and see what happens on the readback!&amp;nbsp; Makes me ask though why an 'optimized algorithm' would even TRY to write a longword that matches 'what is already there'...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 23:54:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-FLASH-Question-about-re-writing-to-a-longword/m-p/631717#M38041</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2017-04-20T23:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: K22 FLASH, Question about (re) writing to a longword</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-FLASH-Question-about-re-writing-to-a-longword/m-p/631718#M38042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The question is valid considering that flash could be "programmed" to 0xFF by a less-than-efficient programmer or bootloader that I have no control over. &amp;nbsp;My question on "programming" a long word with 0xFF's was meant to suss out the deeper details.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Apr 2017 00:35:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-FLASH-Question-about-re-writing-to-a-longword/m-p/631718#M38042</guid>
      <dc:creator>chriskeeser</dc:creator>
      <dc:date>2017-04-21T00:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: K22 FLASH, Question about (re) writing to a longword</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-FLASH-Question-about-re-writing-to-a-longword/m-p/631719#M38043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Freescale/NXP is intentionally 'tight lipped' about even the EXISTENCE of this unseen ECC, let alone willing to discuss ANYTHING about it.&amp;nbsp; Tools that use this memory as 'proper' program-flash are going to be cleanly erasing and writing 'whole chunks'.&amp;nbsp; It is only us tricksters trying to do things like place 'some rarely updated' parameter-sections in this flash that have to be 'more careful' in usage&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Apr 2017 00:58:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-FLASH-Question-about-re-writing-to-a-longword/m-p/631719#M38043</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2017-04-21T00:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: K22 FLASH, Question about (re) writing to a longword</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-FLASH-Question-about-re-writing-to-a-longword/m-p/631720#M38044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the insight Earl. &amp;nbsp;I did stumble across some post during my searches that discussed this hidden ECC. &amp;nbsp;I'll just stick to erasing the whole sector if any byte in the long word is not 0xFF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Apr 2017 01:04:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-FLASH-Question-about-re-writing-to-a-longword/m-p/631720#M38044</guid>
      <dc:creator>chriskeeser</dc:creator>
      <dc:date>2017-04-21T01:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: K22 FLASH, Question about (re) writing to a longword</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-FLASH-Question-about-re-writing-to-a-longword/m-p/631721#M38045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It may make sense to do a comparison of the long word being programmed with the long word that is already in the Flash:&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;if (*(unsigned long *)addressToProgram == ulLongWordToProgram) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return; // skip programming since it already matches&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;else {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // program it&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The check is very fast and each time it matches (when 0xffffffff is in the data stream&amp;nbsp; to be written) it saves 50us or so of programming time (maybe making overall programming of data streams faster overall)&lt;/P&gt;&lt;P&gt;The side effect is that you can be absolutely sure than a long word with 0xffffffff &lt;SPAN style="text-decoration: underline;"&gt;has never been programed before&lt;/SPAN&gt;, avoiding any worries about whether programming all ones stresses the Flash in any way or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Professional support for Kinetis: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Findex.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/index.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Remote desktop one-on-one coaching: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fservices.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/services.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Getting started to expert videos: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.youtube.com%2Fresults%3Fsearch_query%3Dutasker%2Bshorts" rel="nofollow" target="_blank"&gt;https://www.youtube.com/results?search_query=utasker+shorts&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Apr 2017 20:01:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-FLASH-Question-about-re-writing-to-a-longword/m-p/631721#M38045</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2017-04-21T20:01:47Z</dc:date>
    </item>
  </channel>
</rss>

