<?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>MPC5xxx中的主题 Re: Erase application from flash</title>
    <link>https://community.nxp.com/t5/MPC5xxx/Erase-application-from-flash/m-p/1521997#M21985</link>
    <description>&lt;P&gt;I'm not really sure what you are doing. Here I have simple piece of code for unlock, erase and program:&lt;/P&gt;
&lt;P&gt;// step1. unlock all blocks (for simplicity)&lt;BR /&gt;C55FMC.LOCK0.R = 0;&lt;BR /&gt;C55FMC.LOCK1.R = 0;&lt;BR /&gt;C55FMC.LOCK2.R = 0;&lt;BR /&gt;C55FMC.LOCK3.R = 0;&lt;/P&gt;
&lt;P&gt;// step2. erase the large block 31 (0x00FC0000 - 0x00FFFFFF)&lt;BR /&gt;C55FMC.MCR.B.ERS = 1;&lt;BR /&gt;C55FMC.SEL2.R = 0x80000000; // select the large block 7&lt;BR /&gt;*(unsigned int*)0x00FC0000 = 0xFFFFFFFF; //interlock write &lt;BR /&gt;C55FMC.MCR.B.EHV = 1;&lt;BR /&gt;while(C55FMC.MCR.B.DONE == 0);&lt;BR /&gt;C55FMC.MCR.B.EHV = 0;&lt;BR /&gt;C55FMC.MCR.B.ERS = 0;&lt;/P&gt;
&lt;P&gt;// step3. program data&lt;BR /&gt;C55FMC.MCR.B.PGM = 1;&lt;BR /&gt;*(unsigned int*)0x00FC0000 = 0xAABBCCDD; //interlock write&lt;BR /&gt;*(unsigned int*)0x00FC0004 = 0x11223344;&lt;BR /&gt;C55FMC.MCR.B.EHV = 1;&lt;BR /&gt;while(C55FMC.MCR.B.DONE == 0);&lt;BR /&gt;C55FMC.MCR.B.EHV = 0;&lt;BR /&gt;C55FMC.MCR.B.PGM = 0;&lt;/P&gt;
&lt;P&gt;Not sure why SPI is mentioned. You can use SPI only to get some command from outside world that someone wants to perform flash operations and your application can execute some code like the code above.&lt;/P&gt;
&lt;P&gt;And again - make sure that data cache is disabled or invalidated to see the correct result.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;</description>
    <pubDate>Wed, 14 Sep 2022 13:18:49 GMT</pubDate>
    <dc:creator>lukaszadrapa</dc:creator>
    <dc:date>2022-09-14T13:18:49Z</dc:date>
    <item>
      <title>Erase application from flash</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Erase-application-from-flash/m-p/1521778#M21979</link>
      <description>&lt;P&gt;I want to erase my application code present from&amp;nbsp;&lt;SPAN&gt;0x00A00000--0x00FFFFFF and since the code for erase was part of the same RWW partition , I tried to write in another partition x009C0000 and erase it but haven't&amp;nbsp;been successful&amp;nbsp;&lt;BR /&gt;I tried erasing using the following commands &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1. Write Enable &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2.Sector Erase command&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. Address which has to be erased &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;using PUSH and POP via DSPIC which is connected to the flash memory&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Anything which I might have missed ? why isnt the erase successful&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 07:36:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Erase-application-from-flash/m-p/1521778#M21979</guid>
      <dc:creator>ikarkala</dc:creator>
      <dc:date>2022-09-14T07:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: Erase application from flash</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Erase-application-from-flash/m-p/1521814#M21980</link>
      <description>&lt;P&gt;Could you specify used MCU, please?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 08:35:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Erase-application-from-flash/m-p/1521814#M21980</guid>
      <dc:creator>davidtosenovjan</dc:creator>
      <dc:date>2022-09-14T08:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Erase application from flash</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Erase-application-from-flash/m-p/1521818#M21981</link>
      <description>&lt;P&gt;MPC5777C&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 08:40:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Erase-application-from-flash/m-p/1521818#M21981</guid>
      <dc:creator>ikarkala</dc:creator>
      <dc:date>2022-09-14T08:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Erase application from flash</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Erase-application-from-flash/m-p/1521897#M21982</link>
      <description>&lt;P&gt;Hi Indira,&lt;/P&gt;
&lt;P&gt;what does it mean you "haven't been successful"? Was an exception triggered? Or which error code was returned? Also which SW do you use? Is that SDK RTM 3.0.3? &lt;BR /&gt;Or do you mean that no error code was returned and you just can't see erased flash in your debugger? &lt;BR /&gt;Could you make sure that the data cache is either disabled or invalidated after erase? &lt;BR /&gt;Could you make sure that the blocks are unlocked?&lt;BR /&gt;Could you try to disable all interrupts?&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Lukas&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 10:35:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Erase-application-from-flash/m-p/1521897#M21982</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2022-09-14T10:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: Erase application from flash</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Erase-application-from-flash/m-p/1521915#M21983</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;No error code is returned , I have written the code (it is not &lt;SPAN&gt;SDK RTM 3.0.3&lt;/SPAN&gt;) and using Lauterbach Trace32 debugger , No interrupts occur as well. I have written some data to 0x9c00000 and i am trying to clear it using PUSH and POP commands of DSPIC . Do we need this area to be unblocked ? How do we unblock it ? Do you think the erase can be achieved using SPI ?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 11:05:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Erase-application-from-flash/m-p/1521915#M21983</guid>
      <dc:creator>ikarkala</dc:creator>
      <dc:date>2022-09-14T11:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Erase application from flash</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Erase-application-from-flash/m-p/1521922#M21984</link>
      <description>&lt;P&gt;Sorry missed mentioning by havent been successful i mean the erase isnt happening&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 11:12:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Erase-application-from-flash/m-p/1521922#M21984</guid>
      <dc:creator>ikarkala</dc:creator>
      <dc:date>2022-09-14T11:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: Erase application from flash</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Erase-application-from-flash/m-p/1521997#M21985</link>
      <description>&lt;P&gt;I'm not really sure what you are doing. Here I have simple piece of code for unlock, erase and program:&lt;/P&gt;
&lt;P&gt;// step1. unlock all blocks (for simplicity)&lt;BR /&gt;C55FMC.LOCK0.R = 0;&lt;BR /&gt;C55FMC.LOCK1.R = 0;&lt;BR /&gt;C55FMC.LOCK2.R = 0;&lt;BR /&gt;C55FMC.LOCK3.R = 0;&lt;/P&gt;
&lt;P&gt;// step2. erase the large block 31 (0x00FC0000 - 0x00FFFFFF)&lt;BR /&gt;C55FMC.MCR.B.ERS = 1;&lt;BR /&gt;C55FMC.SEL2.R = 0x80000000; // select the large block 7&lt;BR /&gt;*(unsigned int*)0x00FC0000 = 0xFFFFFFFF; //interlock write &lt;BR /&gt;C55FMC.MCR.B.EHV = 1;&lt;BR /&gt;while(C55FMC.MCR.B.DONE == 0);&lt;BR /&gt;C55FMC.MCR.B.EHV = 0;&lt;BR /&gt;C55FMC.MCR.B.ERS = 0;&lt;/P&gt;
&lt;P&gt;// step3. program data&lt;BR /&gt;C55FMC.MCR.B.PGM = 1;&lt;BR /&gt;*(unsigned int*)0x00FC0000 = 0xAABBCCDD; //interlock write&lt;BR /&gt;*(unsigned int*)0x00FC0004 = 0x11223344;&lt;BR /&gt;C55FMC.MCR.B.EHV = 1;&lt;BR /&gt;while(C55FMC.MCR.B.DONE == 0);&lt;BR /&gt;C55FMC.MCR.B.EHV = 0;&lt;BR /&gt;C55FMC.MCR.B.PGM = 0;&lt;/P&gt;
&lt;P&gt;Not sure why SPI is mentioned. You can use SPI only to get some command from outside world that someone wants to perform flash operations and your application can execute some code like the code above.&lt;/P&gt;
&lt;P&gt;And again - make sure that data cache is disabled or invalidated to see the correct result.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 13:18:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Erase-application-from-flash/m-p/1521997#M21985</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2022-09-14T13:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: Erase application from flash</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Erase-application-from-flash/m-p/1526695#M22034</link>
      <description>Thank you for the prompt response . I got what i needed</description>
      <pubDate>Thu, 22 Sep 2022 10:15:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Erase-application-from-flash/m-p/1526695#M22034</guid>
      <dc:creator>ikarkala</dc:creator>
      <dc:date>2022-09-22T10:15:28Z</dc:date>
    </item>
  </channel>
</rss>

