<?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 not erasing in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-not-erasing/m-p/165006#M5352</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks kef!! I've corrected that!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Oct 2012 12:15:49 GMT</pubDate>
    <dc:creator>sebasira</dc:creator>
    <dc:date>2012-10-16T12:15:49Z</dc:date>
    <item>
      <title>Flash not erasing</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-not-erasing/m-p/164997#M5343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, everydoby!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After correcting some problems relating to FLASH clock, we're now having a problem... The first time (after downloading the code) the flash is not erased, all the other times it works perfectly fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We're working with HCS12 and CW4.6&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If someone could take a look at that, it would be very helpful. We're stuck here!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance, best regards!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2012 21:30:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-not-erasing/m-p/164997#M5343</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2012-05-21T21:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Flash not erasing</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-not-erasing/m-p/164998#M5344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can anyone explain me why if I change the previous project .ini file for this one (attached) then the flash erase works perfectly fine??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks to you all!! It's driving me crazy!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2012 03:04:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-not-erasing/m-p/164998#M5344</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2012-05-22T03:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: Flash not erasing</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-not-erasing/m-p/164999#M5345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can only guess:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Maybe this is an old project which you have ported to newer versions of Codewarrior? The .CMD files were used in earlier versions, I believe they are obsolete nowadays. Have you tried to create a completely new project, then add the source files (and .PRM file) to that project?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Maybe you have the wrong derivate specified somehow. The different S12 derivates have somewhat different flash. Have you tried to program the MCU with Cyclone Pro stand-alone, by creating a load file out of the binaries? (.s19 / .phy)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2012 14:03:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-not-erasing/m-p/164999#M5345</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2012-05-22T14:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Flash not erasing</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-not-erasing/m-p/165000#M5346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;*.ini file can't affect execution of your code. Probably you missed the fact that by default CW debugger caches contents of read only memories! Flash erase may work, but you won't see it via memory component, unless you edit debugger memory map to make flash updated from device memory.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2012 00:14:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-not-erasing/m-p/165000#M5346</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2012-05-23T00:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: Flash not erasing</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-not-erasing/m-p/165001#M5347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lundin:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;- Maybe this is an old project which you have ported to newer versions of Codewarrior? The .CMD files were used in earlier versions, I believe they are obsolete nowadays. Have you tried to create a completely new project, then add the source files (and .PRM file) to that project?&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I have already made a new project (severals) and I keep having the same problem. But when I change the .ini file flash is erase and written&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;- Maybe you have the wrong derivate specified somehow. The different S12 derivates have somewhat different flash. Have you tried to program the MCU with Cyclone Pro stand-alone, by creating a load file out of the binaries? (.s19 / .phy)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The derivate is ok, the MCU is MC9S12A256B and that's what I choose in the project wizard. I haven't try your suggestion of loading&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kef:&lt;/P&gt;&lt;P&gt;What you say was my first guess.... But I dismissed that when I realize that flash routine was throwing the error "FLASH_NOT_ERASED" when try to progam it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;EDIT:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;I forgot to say that the error was trown &lt;STRONG&gt;only&lt;/STRONG&gt;&amp;nbsp;the first time I run it, after downloading the code... All the following times I run it (previously reset) the flash is erased and written. No error is trown and I can see the values written in the memory component&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2012 19:51:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-not-erasing/m-p/165001#M5347</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2012-05-23T19:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Flash not erasing</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-not-erasing/m-p/165002#M5348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know this is old, but this same problem happened again to me... I was so angry!!! So I decided to figure out why the same project erase the flash when loaded with a certain .ini file and won't erase it if I use another. I copy line by line from one ini file to the other, until the error was gone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So this line is the problem:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DMM_MCUID03CA_MODULE0=Default£memory£block 0x0 0x10000 100 5 0 1 1 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this line is missing in my ini file, then it won't erase flash&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;why????&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working with&amp;nbsp;&lt;STRONG&gt;MC9S12A256B&amp;nbsp;&lt;/STRONG&gt;and &lt;STRONG&gt;CW4.6&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll attach a file with this line and the same without it. Just in case is not really that an it's related to something else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope someone can explain this to me! Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2012 01:21:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-not-erasing/m-p/165002#M5348</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2012-08-23T01:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Flash not erasing</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-not-erasing/m-p/165003#M5349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CW5.1 ini doesn't have such DMM... string, but instead it has&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MCUId=XXX&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NV_PARAMETER_FILE=C:\Freescale\CWS12v5.1\prog\FPP\mcuXXXX.fpp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;, where&amp;nbsp;XXX defines selected derivative. Derivative can be changed via multilink menu. Maybe you got ini file from CW5 project?&lt;/P&gt;&lt;P&gt;Is there Select Derivative... menu under USB Multilink menu in debugger? If so, then it may help if you select derivative here. Also try changing derivative to some other derivative, and then back to your derivative. It may fix ini file without the need to edit it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2012 13:27:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-not-erasing/m-p/165003#M5349</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2012-08-23T13:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: Flash not erasing</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-not-erasing/m-p/165004#M5350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello kef! Thank you for your reply&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My .ini file also have those lines you mentioned. Same in both, the ini file that erase the flash and the one that does not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MCUId=0x3CA&lt;/P&gt;&lt;P&gt;NV_PARAMETER_FILE=D:\Archivos de programa\Freescale\Codewarrior for HC12 V4.6\prog\FPP\mcu03CA.fpp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What drives me crazy is why would INI FILE has anything to do with flash erasing? Because as said in a post above is not a matter of visualization in the debugger, the flash routine does throw&amp;nbsp;the error FLASH_NOT_ERASED when trying to re-progamm it (after the erase that somehow didn't work)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2012 18:14:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-not-erasing/m-p/165004#M5350</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2012-08-23T18:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: Flash not erasing</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-not-erasing/m-p/165005#M5351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, I thought you have problem flashing code to target. I don't know why (yet), but is it your latest flash.c version? Because I see obvious bug in FLASH_ini16MHz().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;FCLKDIV_FDIV = 0x09;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // 0b001001 valor sugerido para 16MHz en DataSheet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FCLKDIV_PRDIV8 = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Habilito divisor x8 sugerido para 16MHz en DataSheet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can't do these steps in separate writes. FCLKDIV is write once register in normal modes. This code may work OK with debugger and FCLKDIV may read as 0xC9, but without debugger, in normal mode only FDIV bits will be set and FCLKDIV will read as 0x89, which is bad.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2012 19:43:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-not-erasing/m-p/165005#M5351</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2012-08-23T19:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Flash not erasing</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-not-erasing/m-p/165006#M5352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks kef!! I've corrected that!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2012 12:15:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-not-erasing/m-p/165006#M5352</guid>
      <dc:creator>sebasira</dc:creator>
      <dc:date>2012-10-16T12:15:49Z</dc:date>
    </item>
  </channel>
</rss>

