<?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: K61 Flash Block 0 MGSTAT0 error in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K61-Flash-Block-0-MGSTAT0-error/m-p/548925#M33448</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Update:&lt;/P&gt;&lt;P&gt;I solved the problem using another erase method.&lt;/P&gt;&lt;P&gt;Before I used two erase commands: erase Block 0 and erase Block 1. After this I flashed the new content and got the error flag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I use EraseAllBlock, and flash the new content. With this command everything is fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know a definite reason for this behaviour? I think by the different command, the controler wioll do something like a mass erase, and so perhaps unlock special flags which are neccessary for programming block 0?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be great to know the real reason for this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jul 2016 07:34:57 GMT</pubDate>
    <dc:creator>AnEngineer</dc:creator>
    <dc:date>2016-07-29T07:34:57Z</dc:date>
    <item>
      <title>K61 Flash Block 0 MGSTAT0 error</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K61-Flash-Block-0-MGSTAT0-error/m-p/548924#M33447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I have a Kinetis K61, and used the swap mechanism before successfully.&lt;/P&gt;&lt;P&gt;Because of the need of more than the 512K Flash avaliuable in swap mode, we decided to use a "normal" firmware update. So I get the image via Ethernet, and buffer it to DDRRAM. So fine. I erase Block0 and Block1 using the FlashEraseBlock(&amp;amp;ftfl_cfg_ram, PFLASH_HALF1_BASE, FlashCommandSequence);&lt;/P&gt;&lt;P&gt;Then I program the image to Block 0 using FlashProgramPhrase(&amp;amp;ftfl_cfg_ram, PFLASH_HALF0_BASE, 0x80000, 0x80400000, FlashCommandSequence);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using this, I already get the MGSTAT0 error bit. If I flash the Image (which is actually smaller than 512K) in Block1, there is no error bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The whole mechanism works, if I flash the same image as if the one which already is running on the processor. After the reset everything is fine again. If I flash a modified image, I get the MGSTAT error, and before branching to main after the reset I get a hardfault.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there anythin special to do, that writing to Block0 gives no MGSTAT0 error, and so the processor will start after the reset?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2016 12:23:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K61-Flash-Block-0-MGSTAT0-error/m-p/548924#M33447</guid>
      <dc:creator>AnEngineer</dc:creator>
      <dc:date>2016-07-28T12:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: K61 Flash Block 0 MGSTAT0 error</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K61-Flash-Block-0-MGSTAT0-error/m-p/548925#M33448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Update:&lt;/P&gt;&lt;P&gt;I solved the problem using another erase method.&lt;/P&gt;&lt;P&gt;Before I used two erase commands: erase Block 0 and erase Block 1. After this I flashed the new content and got the error flag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I use EraseAllBlock, and flash the new content. With this command everything is fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know a definite reason for this behaviour? I think by the different command, the controler wioll do something like a mass erase, and so perhaps unlock special flags which are neccessary for programming block 0?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be great to know the real reason for this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2016 07:34:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K61-Flash-Block-0-MGSTAT0-error/m-p/548925#M33448</guid>
      <dc:creator>AnEngineer</dc:creator>
      <dc:date>2016-07-29T07:34:57Z</dc:date>
    </item>
  </channel>
</rss>

