<?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: QT4 security bytes being erased in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126512#M1104</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I'm so far unable to get my own ERARNGE function to do anything. I've started comparing my code (grabbed right from AN1831 with a few modifications for working with the CW5 include files) to &lt;A href="http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&amp;amp;message.id=3298#M3298" target="_blank"&gt;Big Mac's attached sample code&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;One noticeable difference is in his line 424 of ROM_CODE.asm:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="Courier New"&gt;BRCLR 6,CTRLBYT,*+5 ; Skip next if no mass erase&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;and my comparable line:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="Courier New"&gt;BRCLR mFLCR_MASS,aCTRLBYT,AMBS&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;The value of mFLCR_MASS is defined in MC68HC908QT4.inc as:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="Courier New"&gt;mFLCR_MASS: equ %00000100&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;That's $04, not 6, as in Big Mac's code. This all boils down to what is meant by "MASSBIT". In the original AN1831 code:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="Courier New"&gt;BRCLR MASSBIT,CTRLBYT,AMBS&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;Freescale uses "MASSBIT" and of course never defines what that is anywhere. But it seems obvious to me that they are referring to the mask for the MASS bit.&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Nov 2006 04:03:07 GMT</pubDate>
    <dc:creator>irob</dc:creator>
    <dc:date>2006-11-02T04:03:07Z</dc:date>
    <item>
      <title>QT4 security bytes being erased</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126487#M1079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm a FreeGeeks refugee, so I'm here now posting on Freescale's forums. Curiously absent in the forum imports is my lengthy thread on &lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Ffreegeeks.net%2Fmodules.php%3Fname%3DForums%26file%3Dviewtopic%26t%3D500%26postdays%3D0%26postorder%3Dasc%26start%3D0" rel="nofollow" target="_blank"&gt;security byte erasure. Have a look at the FreeGeeks archives for reference&lt;/A&gt;&lt;SPAN&gt;. There are a bunch of good replies/theories that didn't pan out for me. I'm posting a modified version of that original with all the latest findings:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I'm using both QT2 and QT4 MCU on one common gerber design. My original firmware was designed for the QT2. Newer firmward utilizes the ROM-resident flash programming routines and as a result only fits in the QT4. Same fab is shared between firmware versions.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Symptom:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Under certain environmental conditions, target board fails a standard test. It was discovered that under these conditions, the jump vectors were being erased. As such, since the reset vector was reset to FF, the MCU was attempting to enter monitor mode and thus never executing user code. Curiously, the user code is NEVER affected, only the jump vectors.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Observations:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;1) These failures almost seem ESD related. In isolated tests, we've been able to duplicate the failures by simply walking around and then touching the target.&lt;BR /&gt;&lt;BR /&gt;2) The failures are only resident in my new firmware version (which uses the ROM-resident flash programming routines for memory storage).&lt;BR /&gt;&lt;BR /&gt;3) If I load up these same QT4 targets with old firmware (non ROM-resident utilizing versions), I've never witnessed a failure.&lt;BR /&gt;&lt;BR /&gt;4) Even after programming the flash block protect register (FLBPR @ $FFBE) this problem persists, which should be impossible.&lt;BR /&gt;&lt;BR /&gt;5) &lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.freescale.com%2Ffiles%2Fmicrocontrollers%2Fdoc%2Ferrata%2FMSE908QY4_3L69J.pdf" rel="nofollow" target="_blank"&gt;There is a mask set errata published for the QY4&lt;/A&gt; in which there's a section headed "Page Erase Can Cause Unexpected Erase of a Another FLASH Page". That's a very close theory, but there are some holes:&lt;BR /&gt;&lt;BR /&gt;a) my mask sets are quite newer than those published in the errata&lt;BR /&gt;b) I'm not using interrupts&lt;BR /&gt;c) I'm resetting the COP often.&lt;BR /&gt;&lt;BR /&gt;Any thoughts?&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2006 10:48:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126487#M1079</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2006-02-16T10:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: QT4 security bytes being erased</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126488#M1080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi iRob,&lt;/P&gt;&lt;P&gt;Please don't see anything suspicious here, no newer post from Freegeeks was copied over... &lt;EM&gt;Mea Culpa&lt;/EM&gt; if it's an older one because I was contacted to select quite a few posts as I was Mod on Freegeeks.net and I'm certainly no perfect.&lt;/P&gt;&lt;P&gt;Also when you read Yahoo forums, some contributors are&amp;nbsp;really &lt;STRONG&gt;virulent&lt;/STRONG&gt; against Freescale for having copied posts, so maybe they stopped. Only time will tell !&lt;/P&gt;&lt;P&gt;But let's continue on your subject &lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt; Coz I don't want people to be afraid to post here or think a Mod will cut stuff out.&amp;nbsp;If it happens&amp;nbsp;I'll just give my Mod's cap back to the Admins.&lt;/P&gt;&lt;P&gt;The FBLPR is checked before Flash operation. As far as I know, even on devices touched by the Erratum, you wouldn't see the problem with FBLPR programmed to protect the vector page.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Which masks are you using ?&lt;/LI&gt;&lt;LI&gt;Do you know if the rest is still stored in memory ?&lt;/LI&gt;&lt;LI&gt;Do you see that because&amp;nbsp;the applications is going stupid OR only when you put the programmer back on ?&lt;/LI&gt;&lt;LI&gt;Which programmer are you using ?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;My idea behind the 3 is that&amp;nbsp;I've seen the newer QY are not behaving the same with security and maybe the programmer doesn't understand. In most of HC08, when the Security Fails, Flash memory will read as 0xAD. However in some QY, it read 0x00.&lt;BR /&gt;I did cause trouble to my Multilink because it was always taking back the 0x000000000 after a failure because it thought it was OK. An update of the drivers cleared it out.&lt;/P&gt;&lt;P&gt;Cheers,&lt;BR /&gt;Alban.&lt;/P&gt;&lt;P&gt;Message Edited by Alban on &lt;SPAN class="date_text"&gt;02-16-2006&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;09:32 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2006 17:29:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126488#M1080</guid>
      <dc:creator>Alban</dc:creator>
      <dc:date>2006-02-16T17:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: QT4 security bytes being erased</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126489#M1081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;Which masks are you using ?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;Most of my MCUs are RMAE515. The errata mask set is: 3L69J. Not sure how those correlate, but most of my MCUs were produced the 15th week of 2005. Very recent.&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;&lt;/EM&gt;&lt;BLOCKQUOTE&gt;Do you know if the rest is still stored in memory ?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;Do you mean, is the rest of my program code still intact, even after a failure? Yes, that is always the case. Only security bytes are erased.&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;&lt;/EM&gt;&lt;BLOCKQUOTE&gt;Do you see that because the applications is going stupid OR only when you put the programmer back on ?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;The former. I know this because in my application, it's very obvious when a failure happens. I have an I2C peripheral that suddenly stops getting communication from the MCU. This is the symptom. I then check it on the programmer and verify that the code is intact, but security bytes are all erased to 0xFF.&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;&lt;/EM&gt;&lt;BLOCKQUOTE&gt;Which programmer are you using ?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;The P&amp;amp;E Cyclone Pro. I already issued a service request to P&amp;amp;E about all this. They basically told me it's Freescale's problem. I've got an open SR with Freescale. They want more data.&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;&lt;/EM&gt;&lt;BLOCKQUOTE&gt;In most of HC08, when the Security Fails, Flash memory will read as 0xAD. However in some QY, it read 0x00.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;Understand that when I first inspect a failed board with the Cyclone, security check fails. That's the first confirmation that the symptoms are the same. I then change the security check to all 8 bytes 0xFF (the erased state) and I can enter monitor mode and verify the rest of the user program.&lt;BR /&gt;&lt;BR /&gt;Do you think this is an programming algorithm problem?&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2006 02:39:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126489#M1081</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2006-02-17T02:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: QT4 security bytes being erased</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126490#M1082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Comic Sans MS"&gt;iRob,&lt;/FONT&gt;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT face="Comic Sans MS"&gt;I don't know what this RMAE515 means. Never seen tis before. Thanks for mask.&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="Comic Sans MS"&gt;Yes, I meant that &lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="Comic Sans MS"&gt;Good, so we can eliminate the programmer as being responsible !&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="Comic Sans MS"&gt;Good stuff, I'm pleased with it, even if I don't use it often now I have the FSICE (new MMDS).&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;FONT face="Comic Sans MS"&gt;I have two ideas just now coming to my mind... &lt;EM&gt;FBPR&lt;/EM&gt; = Flash Block Protection Register &lt;STRONG&gt;&lt;/STRONG&gt;+ &lt;EM&gt;FPR&lt;/EM&gt; = Flash Programming Routines &lt;IMG alt=":smileyindifferent:" class="emoticon emoticon-smileyindifferent" id="smileyindifferent" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-indifferent.gif" title="Smiley Indifferent" /&gt;&amp;nbsp; and how they're used in the soft &lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;BR /&gt;Indeed, it looks like there is something weird with the programming.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Comic Sans MS"&gt;&lt;STRONG&gt;Do you erase and then program ?&lt;/STRONG&gt;&lt;BR /&gt;Yes, it could be from one or the other. If no, which one ?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Comic Sans MS"&gt;&lt;STRONG&gt;Can you post the line&amp;nbsp;of your S-Record showing which value is programmed in the &lt;EM&gt;FBPR (Flash Block Protection Register) @ 0xFFBE?&lt;/EM&gt;&lt;BR /&gt;&lt;/STRONG&gt;Even the buit-in flash programming routines are not supposed to override this protection, they are just in ROM to save user Flash space.&lt;BR /&gt;By making sure the FBPR is programmed to&amp;nbsp;protect the vector page when using the Cyclone Pro, it will confirm if the FBPR function is OK.&lt;BR /&gt;If you program the FBPR in your soft, we can't really believe it as the vector page is erased and the FPR can be to be blamed. If you see what I mean.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Comic Sans MS"&gt;&lt;STRONG&gt;If you can easily and quickly reproduce the fault:&lt;BR /&gt;&lt;/STRONG&gt;Can you please tell us if the vector erase happens because of the Erase Range or Program Range routine? To learn this, you would need to add a comparison on the reset vector to 0xFFFF just before after each function with a unique display on some port depending on what you see.&lt;BR /&gt;Once this is done and we see which one is causing trouble, we need to analyze how you call these functions as &lt;U&gt;maybe something else is corrupting the stack when you do the function call !!&lt;/U&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Comic Sans MS"&gt;My goal would be to see where the fault is and &lt;U&gt;&lt;STRONG&gt;if&lt;/STRONG&gt;&lt;/U&gt; there's any problem with the on-chip FPR, we should be able to protect your application with FBPR .&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Comic Sans MS"&gt;Cheers,&lt;BR /&gt;Alban.&lt;/FONT&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2006 20:25:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126490#M1082</guid>
      <dc:creator>Alban</dc:creator>
      <dc:date>2006-02-17T20:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: QT4 security bytes being erased</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126491#M1083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;I have a similar problem&amp;nbsp; with a DemoBoard. The mask is ZRPG.&lt;/P&gt;&lt;P&gt;When I erase a page at $EE00, 16 bytes are being erase at $FFB0.&lt;/P&gt;&lt;P&gt;I can reproduce this, every time I try it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;I&amp;nbsp;use&amp;nbsp; ERARNGE&amp;nbsp;rom routine to erase the page.&lt;/P&gt;&lt;P&gt;When I use mask ZRQG with the same software, everything is alwright.&lt;/P&gt;&lt;P&gt;It looks it's a bad mask just like 3L69J !&lt;/P&gt;&lt;P&gt;It would be fine to have a compilation of those faulty masks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2006 06:53:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126491#M1083</guid>
      <dc:creator>JM</dc:creator>
      <dc:date>2006-03-17T06:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: QT4 security bytes being erased</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126492#M1084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Sorry, Alban, I haven't had much time lately to respond. I have three (&lt;STRONG&gt;three!&lt;/STRONG&gt;) simultaneous production runs happening.&lt;BR /&gt;&lt;BR /&gt;But quickly, I just got some new info from my local distributor about updated Freescale docs:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.freescale.com/files/microcontrollers/doc/app_note/AN1831.pdf?srch=1" rel="nofollow" target="_blank"&gt;AN1831&lt;/A&gt; using MC68HC908 On-Chip FLASH Programming Routines&lt;BR /&gt;&lt;A href="http://www.freescale.com/files/microcontrollers/doc/app_note/AN2874.pdf?srch=1" rel="nofollow" target="_blank"&gt;AN2874&lt;/A&gt; Using M68HC908 ROM-Resident Routines&lt;BR /&gt;&lt;A href="http://www.freescale.com/files/microcontrollers/doc/app_note/AN2874SW.zip?srch=1" rel="nofollow" target="_blank"&gt;AN2874SW&lt;/A&gt; CodeWarrior 5 demo software for both the HC908QY4 and HC908LJ12&lt;BR /&gt;&lt;BR /&gt;Looks promising...&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Mar 2006 01:07:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126492#M1084</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2006-03-24T01:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: QT4 security bytes being erased</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126493#M1085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Sorry I'm responding &lt;STRONG&gt;so&lt;/STRONG&gt; late to this. But the problem has flared up again, so I'm needing to address it.&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Alban wrote:&lt;BR /&gt;&lt;FONT face="Comic Sans MS"&gt;&lt;STRONG&gt;Do you erase and then program?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;Yes, every time. Our programming cycle consists of:&lt;OL&gt;&lt;LI&gt;Erase Device&lt;/LI&gt;&lt;LI&gt;Blank Check Device&lt;/LI&gt;&lt;LI&gt;Program Device&lt;/LI&gt;&lt;LI&gt;Verify Device&lt;/LI&gt;&lt;/OL&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Alban wrote:&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Comic Sans MS"&gt;&lt;STRONG&gt;Can you post the line of your S-Record showing which value is programmed in the &lt;EM&gt;FBPR (Flash Block Protection Register) @ 0xFFBE?&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;Here's that line in my s-record:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="Courier New"&gt;S104&lt;STRONG&gt;FFBE&lt;/STRONG&gt;&lt;EM&gt;F6&lt;/EM&gt;48&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;As you can see, the FBPR is clearly written to FFBE, and is set to 0xF6. According to the datasheet, this decodes to a starting address in flash as 0xFD80. My software writes user parameters to 0xFD40. This gives me one full page to write to.&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Alban wrote:&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Comic Sans MS"&gt;&lt;STRONG&gt;If you can easily and quickly reproduce the fault:&lt;BR /&gt;&lt;/STRONG&gt;Can you please tell us if the vector erase happens because of the Erase Range or Program Range routine?&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;No, I've never been able to reliably reproduce the error in the lab. However, I have much evidence that shows this error only started happening after I added EEPROM emulation with the ROM-resident routines. In the meantime, I've removed the erase function on a few sample targets and deployed them in the field. We'll see what happens.&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Alban wrote:&lt;BR /&gt;...To learn this (Erase Range or Program Range causing error), you would need to add a comparison on the reset vector to 0xFFFF just before after each function with a unique display on some port depending on what you see.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;I'm not clear what you mean by "adding a comparison on the reset vector to 0xFFFF". Realize that when this fault happens, the reset vector is reset. What good would it do to add that comparison if the MCU is lost out of reset?&lt;P&gt;Message Edited by irob on &lt;SPAN class="date_text"&gt;2006-10-24&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;02:34 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2006 03:33:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126493#M1085</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2006-10-25T03:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: QT4 security bytes being erased</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126494#M1086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi iRob,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;That's indeed an old one.&lt;/DIV&gt;&lt;DIV&gt;I read the whole thread again and there is something I'm thinking about.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The way the Flash prog/erase works on this is the address on the bus is latched to erase the matching page.&lt;/DIV&gt;&lt;DIV&gt;If you kick the COPs' @ss at this point, you will latch the last page address instead of the one of the dummy read you did ! I'm only working from memory here so may say something strange.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;To clarify my last comment, I was saying that if before and after each of your prog/erase function you check the value of the reset vector is not erased, you will be able to detect which of your function does erase the vector page.&lt;/DIV&gt;&lt;DIV&gt;From what I read in your new message, it looks like removing the erase function does solve the problematic behaviour.&lt;/DIV&gt;&lt;DIV&gt;This would tend to confirm my bla-bla above.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If you use ROM Flash Erase routine and have no control over the COP within, you would have to create a new clean one in Flash.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Solution would be NOT to kick the COP in the erase step where the address on bus is latched.&lt;/DIV&gt;&lt;DIV&gt;If it's too long for your COP, try and see with the LONG COP period.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;OK ?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Cheers,&lt;/DIV&gt;&lt;DIV&gt;Alban.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2006 03:56:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126494#M1086</guid>
      <dc:creator>Alban</dc:creator>
      <dc:date>2006-10-25T03:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: QT4 security bytes being erased</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126495#M1087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Reading twice is quite good.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I do confirm what I just wrote because of points 2 and 3 of your original post + me reading Erratum&lt;/DIV&gt;&lt;DIV&gt;The ROM Erase routine probably refreshes the COP and latches 0xFFFF.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Do &lt;STRONG&gt;not&lt;/STRONG&gt; use internal Flash Erase routine on this mask. &lt;STRONG&gt;Create your own in Flash&lt;/STRONG&gt;.&lt;/DIV&gt;&lt;DIV&gt;Do &lt;STRONG&gt;not&lt;/STRONG&gt; refresh Ze Cop in the middle according to Erratum of the 3L69J you mentioned.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This way you &lt;U&gt;will&lt;/U&gt; be fine !&lt;/DIV&gt;&lt;DIV&gt;Alban.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2006 04:07:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126495#M1087</guid>
      <dc:creator>Alban</dc:creator>
      <dc:date>2006-10-25T04:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: QT4 security bytes being erased</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126496#M1088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thanks for the replies, Alban, much appreciated!&lt;BR /&gt;&lt;BR /&gt;A couple more questions:&lt;BR /&gt;&lt;BR /&gt;1) I looked in my source code archives and examined all the versions which include ROM-resident EEPROM emulation. They &lt;STRONG&gt;all&lt;/STRONG&gt; have the following settings in CONFIG1: 0x11, which decodes to LVI disabled and COP disabled. Looks like I already disabled the COP module, per the advice in &lt;A href="http://www.freescale.com/files/microcontrollers/doc/errata/MSE908QY4_3L69J.pdf" rel="nofollow" target="_blank"&gt;the errata&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;Now if the ERARNGE() function in ROM attempts to write to 0xFFFF to reset the COP, is it still possible that the address is being latched, even if I've disabled the COP module?&lt;BR /&gt;&lt;BR /&gt;2) Do you have any sample code or perhaps the source for ERARNGE() in the ROM?&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2006 05:01:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126496#M1088</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2006-10-25T05:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: QT4 security bytes being erased</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126497#M1089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello iRob,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Have a look at AN1831 (Rev 3)&amp;nbsp;and AN2635 for the source code for the ROM based programming routines.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2006 09:33:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126497#M1089</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-10-25T09:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: QT4 security bytes being erased</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126498#M1090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;iRob,&lt;BR /&gt;&lt;BR /&gt;1- Totally. It is not linked to the COP functionality but to the address present on the bus. Even with a COP disabled, if the software writes at 0xFFFF, that address could be latched.&lt;BR /&gt;You would have a similar behaviour on another page if the soft was accessing data somewhere else in Flash.&lt;BR /&gt;&lt;BR /&gt;Alban.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2006 15:53:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126498#M1090</guid>
      <dc:creator>Alban</dc:creator>
      <dc:date>2006-10-25T15:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: QT4 security bytes being erased</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126499#M1091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello iRob,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Further to Alban's suggestion to monitor when the vector erasure occurs in relation to the operation of your program, in order to help diagnose the problem, here is a suggestion -&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Should the vectors become erased, normal operation of your program should continue up to the point where an interrupt event occurs, or there is a reset.&amp;nbsp; I am suggesting to allocate an additional&amp;nbsp;byte, within the flash page that holds your non-volatile data, for the purpose of writing an error code.&amp;nbsp; Then implement the following sequence within the portion of code that handles the writing of data -&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Disable interrupts&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Initialise a test counter&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Vector test routine - just in case there is some other cause&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Increment test counter&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Erase flash page&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Vector test routine&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Increment test counter&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Write flash data&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Vector test routine&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Repeat for other flash pages to be erased and written.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Re-enable interrupts, as required.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;The vector test routine would simply test the byte value at address $FFFF, and if found to contain the value $FF, write the current test count value as an error code, and then cause an immediate reset (perhaps by the illegal instruction method).&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Subsequent examination of the flash contents would enable you to identify the position in code where the vector had become corrupt.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;HR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;A while back I did disassemble part of the ROM code of a QY device from my existing stock ( of more recent manufacture), and found it corelated to the code listing given in AN1831.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Incidently, I have been using the ROM routines, without apparent problem, in a mature product of at least three years.&amp;nbsp; I erase the first page of flash, and then program the first two bytes only.&amp;nbsp; However, this will generally occur only a few times during the product lifetime - perhaps I have been lucky.&amp;nbsp; Long COP timeout is enabled, and I reset the COP timer a few instructions prior to the ERARNGE sub-routine&amp;nbsp;being called.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2006 22:18:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126499#M1091</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-10-25T22:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: QT4 security bytes being erased</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126500#M1092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thanks for the debug ideas, Big Mac. I like the idea of using a test routine in the field. I also like your idea of reseting the COP right before flash writes/erases.&lt;BR /&gt;&lt;BR /&gt;Incidentally, is the COP an issue with S08 parts which have the radically different flash architecture? I'm wondering if I should implement a similar COP reset right before data storage and erasure. I guess it couldn't hurt, huh?&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2006 23:05:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126500#M1092</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2006-10-25T23:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: QT4 security bytes being erased</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126501#M1093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Yo,&lt;BR /&gt;&lt;BR /&gt;The S08 Flash is different in the way to deal with it.&lt;BR /&gt;It's a state machine and writing to the COP during erase will not corrupt anything.&lt;BR /&gt;&lt;BR /&gt;Alban.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2006 16:32:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126501#M1093</guid>
      <dc:creator>Alban</dc:creator>
      <dc:date>2006-10-26T16:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: QT4 security bytes being erased</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126502#M1094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;bigmac wrote:&lt;BR /&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello iRob,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Have a look at AN1831 (Rev 3) and AN2635 for the source code for the ROM based programming routines.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;Mac, the ERARNGE functions listed in both of those app notes are considerably different from each other. Strangely, there's reference in the AN1831 to "page erase step 1 through step 6". Yet, I can't find these steps in that document. However, these steps are clearly laid out in AN2635's ERARNGE.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Oct 2006 04:22:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126502#M1094</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2006-10-28T04:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: QT4 security bytes being erased</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126503#M1095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Anyone know what the values of these bytes are:&lt;BR /&gt;&lt;BR /&gt;mERASE&lt;BR /&gt;mMASS&lt;BR /&gt;mHVEN&lt;BR /&gt;&lt;BR /&gt;They are referenced in both App Notes that Big Mac mentioned. I'm guessing they are the masks of the bits in FLCR, but they're not listed as equates in either pdf.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Oct 2006 04:55:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126503#M1095</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2006-10-28T04:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: QT4 security bytes being erased</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126504#M1096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi iRob,&lt;BR /&gt;&lt;BR /&gt;Looks like a good guess to me.&lt;BR /&gt;Check how they are being handled in the soft, but these are indeed bits in the Flash.&lt;BR /&gt;&lt;BR /&gt;Alban.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Oct 2006 22:11:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126504#M1096</guid>
      <dc:creator>Alban</dc:creator>
      <dc:date>2006-10-29T22:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: QT4 security bytes being erased</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126505#M1097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello iRob,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;This is a summary of my observations&amp;nbsp;for the ERARNGE function -&lt;/FONT&gt;&lt;/DIV&gt;&lt;OL&gt;&lt;LI&gt;&lt;FONT size="2"&gt;AN1831&amp;nbsp;implies that the QT/QY series does &lt;U&gt;not&lt;/U&gt; have a page erase problem with&amp;nbsp;its version of the ERARNGE routine, but many ofther listed devices do have a problem.&amp;nbsp; The source code included within the note is applicable to the problem devices, and is apparently not a "corrected" version, because the work-around code is then described.&amp;nbsp; The ERARNGE routine clears the COP timer a number of times within a timing loop, and once again when the loop completes.&amp;nbsp; This occurs&amp;nbsp;after &amp;nbsp;the "write to any address within the erase range" has&amp;nbsp;occurred, and&amp;nbsp; the HVEN bit is set.&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="2"&gt;When I disassembled the code for the ERARNGE routine&amp;nbsp;contained within&amp;nbsp;a more recent QY device, I found &lt;U&gt;exact&lt;/U&gt; corelation with the "bad" code of AN1831 (including the COP timer resets).&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="2"&gt;AN2635 is applicable to the QY4A series devices, and the ERARNGE routine is not unexpectedly slightly different than that for the QY4 series.&amp;nbsp; The source code given is for the LB8 device, with the assumption that it would also apply to the other devices listed in the note.&amp;nbsp; The testing of the bulk erase bit is different, and the Tnvs delay does not call the DELNUS routine, but otherwise the differences would appear to be minor.&amp;nbsp; It is interesting to note that the COP reset occurs in exactly the same manner as for the AN1831 code.&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Obviously, the occurence of COP timer reset within ERARNGE is not necessarily causing a problem, since it occurs after the address information has been latched, and also remains present for the more recent devices.&amp;nbsp; I can only surmise that the&amp;nbsp;issue lies within the operation of the hardware for the problem devices - perhaps the erase address is capable of being "re-latched" for some, but not for others.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;This seems to make the cause of the erased vectors for the QT4 device even harder to plausibly explain, assuming any hardware issues have been corrected for later mask sets.&amp;nbsp; There is certainly no explanation why the problem should be an intermittent one.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BLOCKQUOTE dir="ltr"&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;HR /&gt;&lt;FONT size="2"&gt;Anyone know what the values of these bytes are:&lt;BR /&gt;&lt;BR /&gt;mERASE&lt;BR /&gt;mMASS&lt;BR /&gt;mHVEN&lt;BR /&gt;&lt;/FONT&gt;&lt;HR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;You should find the values for these bit&amp;nbsp;masks within the .inc file&amp;nbsp;for the particular device.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Oct 2006 02:31:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126505#M1097</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-10-30T02:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: QT4 security bytes being erased</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126506#M1098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;All true, Mac. Especially in that the QT/QY parts have never been listed by Freescale to have the problematic vector erasure when using ERARNGE.&lt;BR /&gt;&lt;BR /&gt;But given the breadth of the problems I'm seeing in the field and frustration of my customers, I'm forced to at least try patching firmware with the measures recommended to the other MCU families. Short of a recall and hardware patch (adding external EEPROM or updating to newer QG4's), this seemed the speediest solution.&lt;BR /&gt;&lt;BR /&gt;Onto ERARNGE, there seems to be at least two versions between AN1831 and AN2635, as those two copies are quite different from one another. QT/Y's are only mentioned in AN1831, so I guess I'll stick with that version.&lt;P&gt;Message Edited by irob on &lt;SPAN class="date_text"&gt;2006-10-30&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;10:27 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Oct 2006 01:13:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QT4-security-bytes-being-erased/m-p/126506#M1098</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2006-10-31T01:13:45Z</dc:date>
    </item>
  </channel>
</rss>

