<?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: Find corruption on internal Flash MK22FX512VLH12</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Find-corruption-on-internal-Flash-MK22FX512VLH12/m-p/509208#M32085</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;Corrupted flash (this tends to be valid for second generation parts but not for all) causes a fault exception to be generated when read. It is necessary to erase the sector (or possibly the complete flash) to recover the Flash operation.&lt;/P&gt;&lt;P&gt;To detect the corruption you can use the fault exception itself - read all locations of Flash to see whether it is generated or not and stop further checking once an exception occurs.&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;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 May 2016 22:04:34 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2016-05-09T22:04:34Z</dc:date>
    <item>
      <title>Find corruption on internal Flash MK22FX512VLH12</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Find-corruption-on-internal-Flash-MK22FX512VLH12/m-p/509207#M32084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi community.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I must write data on the internal flash, without disable the interrupts.&lt;/P&gt;&lt;P&gt;But I found this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Interruption of an erase or program command can lead to corruption of the flash contents. Interruptions could include&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reset, loss of power, or a conflict with code running on processor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is, when I read the corrupt data from internal flash, I get a Bus Error.&lt;/P&gt;&lt;P&gt;Is there a way to find corrupt data on the internal flash or a way that no corruption accures?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2016 13:54:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Find-corruption-on-internal-Flash-MK22FX512VLH12/m-p/509207#M32084</guid>
      <dc:creator>ralf1694</dc:creator>
      <dc:date>2016-05-09T13:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Find corruption on internal Flash MK22FX512VLH12</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Find-corruption-on-internal-Flash-MK22FX512VLH12/m-p/509208#M32085</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;Corrupted flash (this tends to be valid for second generation parts but not for all) causes a fault exception to be generated when read. It is necessary to erase the sector (or possibly the complete flash) to recover the Flash operation.&lt;/P&gt;&lt;P&gt;To detect the corruption you can use the fault exception itself - read all locations of Flash to see whether it is generated or not and stop further checking once an exception occurs.&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2016 22:04:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Find-corruption-on-internal-Flash-MK22FX512VLH12/m-p/509208#M32085</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2016-05-09T22:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Find corruption on internal Flash MK22FX512VLH12</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Find-corruption-on-internal-Flash-MK22FX512VLH12/m-p/509209#M32086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Oliver Schmid:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just like Mark suggested, you can use the fault to detect a corrupted flash. There is also the option of using the &lt;STRONG&gt;Program Check&lt;/STRONG&gt; command to compare your expected data vs actual stored data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To avoid flash corruption, it is actually recommended to disable interrupts. You could also copy interrupt vectors to RAM and relocate the interrupt handler codes to a different flash block (not the one being written/erased) or to RAM memory, for all of those interrupts that are likely to trigger while the flash operation is performed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&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>Tue, 10 May 2016 01:00:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Find-corruption-on-internal-Flash-MK22FX512VLH12/m-p/509209#M32086</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2016-05-10T01:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Find corruption on internal Flash MK22FX512VLH12</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Find-corruption-on-internal-Flash-MK22FX512VLH12/m-p/509210#M32087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I implement the Bus Fault ISR and when I read the corrupt data I am in the ISR :smileyhappy:&lt;/P&gt;&lt;P&gt;But I have another question. When my Bus Fault ISR is empty, then I jump back to the read flash command which caused the fault. Then I read the same flash address and jump in the ISR again and after ISR back to the read command. After the 4th or 5th read from the corrupt data, I can read the data from flash and no Bus Fault occurs. Why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to execute the next line of the routine after the Bus Fault ISR jump back?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -read corrupt data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - isr&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -jump back to routine&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -next line to execute is the line after read command which caused the fault&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 14:46:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Find-corruption-on-internal-Flash-MK22FX512VLH12/m-p/509210#M32087</guid>
      <dc:creator>ralf1694</dc:creator>
      <dc:date>2016-05-10T14:46:53Z</dc:date>
    </item>
  </channel>
</rss>

