<?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: Escape from Security Mode in 9S12DG256 in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Escape-from-Security-Mode-in-9S12DG256/m-p/134342#M2049</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;From the Freescale 256 K flash documentation:&lt;/P&gt;&lt;P&gt;"The ACCERR flag will not be set if any Flash register is read during the command sequence."&lt;/P&gt;&lt;P&gt;I'm not familiar with the details of the software that you are using to maniplulate the registers, but you should try to use commands that do NOT attempt to verify the writes to the flash control registers.&lt;/P&gt;&lt;P&gt;It may be a good idea to check BDM communication by reading PARTID or some other readable register BEFORE attempting the unsecure sequence.&lt;/P&gt;&lt;P&gt;As you are demonstrating, it would be a help to include unsecuring instructions with any BDM software.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 May 2006 01:24:12 GMT</pubDate>
    <dc:creator>SteveRussell</dc:creator>
    <dc:date>2006-05-04T01:24:12Z</dc:date>
    <item>
      <title>Escape from Security Mode in 9S12DG256</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Escape-from-Security-Mode-in-9S12DG256/m-p/134337#M2044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;During a flashprocedure of a new development with a MC9S12DG256 I obviously cleared the Security Byte ($FF0F) by accident, i.e. including the backdoor access..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;I do not get a connection with my BDM (a part offered by Kevin Ross) to FLASH, EEPROM and RAM.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;But I can read and write to the registers. (See Dump of the RegPage in the attachment).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;The contents of the REGS page can be found mod $400 of the complete adress range.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;The control of the output pins works fine.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;Reading through the Specification and the application note AN2206 I still am not clear how to escape from the Security Mode. (btw. I have doubts the sequence given there on page 9 really works, as Command $20 is a PROG and not a MASSERASE.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;here is my sequence ("ew" edits words, "eb" edits bytes):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;----&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;reset //with MODA = MODB = MODC = 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;eb 100 4a //write $4a to $100; FCLK set for 16MHz crystal&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;eb 102 10 //write all&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;ew 104 FFFF //FPROT set to FF; FSTAT clear all bits&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;ew f000 0000 // write something to page&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;eb 106 41 //FCMD: MASS ERASE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;eb 105 80 //GO&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;reset //Reset to Special Mode to enable background check for erased FLASH according spec.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;eb 100 4a //FCLK init again&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;ew 104 FFFF //open Prot and clear FSTAT bits again&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;ew ff0e fffe //SECURITY set to FE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;eb 106 20 //FCMD: prog&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;eb 105 80 //go&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;&amp;lt;----&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;One very strange behavior of FSTAT is the result of $C1 instead of $C0 after the command is started. Accordung the Secification the LSB should always read zero.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;I tried several similar sequences also delays before and after "reset". Unfortunately w/o effect.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;Do you have an idea what my problem could be?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;The accidential erasure is not very unlikely. ist there a standard escape sequence available, when no ext ROM ist available?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 2;"&gt;Thank you very much for reply in advance&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 May 2006 03:40:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Escape-from-Security-Mode-in-9S12DG256/m-p/134337#M2044</guid>
      <dc:creator>BHock</dc:creator>
      <dc:date>2006-05-02T03:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Escape from Security Mode in 9S12DG256</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Escape-from-Security-Mode-in-9S12DG256/m-p/134338#M2045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hi BH,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;To unsecure your part, you may try the attached command file.&lt;/DIV&gt;&lt;DIV&gt;As I couldn't post a .cmd, you&amp;nbsp;can rename the file to a .cmd&amp;nbsp;and adapt the speed of the oscillator by reading internal comments.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This is a standard file&amp;nbsp;I took within CodeWarrior. I didn't check your procedure as I used this file and it worked a few times already.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Of course, unsecuring a MCU erases it fully.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Cheers,&lt;/DIV&gt;&lt;DIV&gt;Alvin.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 May 2006 04:50:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Escape-from-Security-Mode-in-9S12DG256/m-p/134338#M2045</guid>
      <dc:creator>Nabla69</dc:creator>
      <dc:date>2006-05-02T04:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Escape from Security Mode in 9S12DG256</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Escape-from-Security-Mode-in-9S12DG256/m-p/134339#M2046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;If you have not yet done so, you should read Freescale application note AN2400/D "HCS12 NVM Guidelines".&lt;/P&gt;&lt;P&gt;This is the best single document that covers flash and EEPROM programming and securing.&lt;/P&gt;&lt;P&gt;In particular, at the end it describes the 27 step procedure for unsecuring a HCS12 part.&lt;/P&gt;&lt;P&gt;You should also check the mask set of your particular part and look at the latest errata for that mask set.&amp;nbsp; Some early parts had a number of errata in the operation of the security features.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should also be aware that some very early HCS-12 parts exhibited security behaviour that is not clearly documented in the errata/&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;I&gt;&lt;FONT color="#ffffff" size="3"&gt;NVM Guidelines&lt;/FONT&gt;&lt;/I&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 May 2006 01:03:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Escape-from-Security-Mode-in-9S12DG256/m-p/134339#M2046</guid>
      <dc:creator>SteveRussell</dc:creator>
      <dc:date>2006-05-03T01:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Escape from Security Mode in 9S12DG256</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Escape-from-Security-Mode-in-9S12DG256/m-p/134340#M2047</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&amp;nbsp;sent the sequence according the spec. (See Attachment: steve1.txt is input file; seq1.txt the output log.) The 2nd part of the sequence&amp;nbsp;ist not in the log.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The interesting result is in Line 24.&lt;/P&gt;&lt;P&gt;"Verify failure: address 0x115 expected 0x80, verified as &lt;STRONG&gt;0xd1&lt;/STRONG&gt;"&lt;/P&gt;&lt;P&gt;Looks like an Access error as I expect the result &lt;STRONG&gt;0xc1&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;there might also be a problem with the BDM. Maybe I&amp;nbsp;corrupt &amp;nbsp;the internal state machine with the edit command (Write/Read) .&lt;/P&gt;&lt;P&gt;what is your opinion?&lt;/P&gt;&lt;P&gt;Bertram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 May 2006 03:34:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Escape-from-Security-Mode-in-9S12DG256/m-p/134340#M2047</guid>
      <dc:creator>BHock</dc:creator>
      <dc:date>2006-05-03T03:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Escape from Security Mode in 9S12DG256</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Escape-from-Security-Mode-in-9S12DG256/m-p/134341#M2048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Dear Alvin,&lt;/P&gt;&lt;P&gt;I am using Kevin Ross' BDM. I translated your code but unfortunately without success.&lt;/P&gt;&lt;P&gt;THere are no Write Commands but Edit Commands available. I guess they destroy internal states.&lt;/P&gt;&lt;P&gt;rgds&lt;/P&gt;&lt;P&gt;Bertram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 May 2006 03:39:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Escape-from-Security-Mode-in-9S12DG256/m-p/134341#M2048</guid>
      <dc:creator>BHock</dc:creator>
      <dc:date>2006-05-03T03:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Escape from Security Mode in 9S12DG256</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Escape-from-Security-Mode-in-9S12DG256/m-p/134342#M2049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;From the Freescale 256 K flash documentation:&lt;/P&gt;&lt;P&gt;"The ACCERR flag will not be set if any Flash register is read during the command sequence."&lt;/P&gt;&lt;P&gt;I'm not familiar with the details of the software that you are using to maniplulate the registers, but you should try to use commands that do NOT attempt to verify the writes to the flash control registers.&lt;/P&gt;&lt;P&gt;It may be a good idea to check BDM communication by reading PARTID or some other readable register BEFORE attempting the unsecure sequence.&lt;/P&gt;&lt;P&gt;As you are demonstrating, it would be a help to include unsecuring instructions with any BDM software.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2006 01:24:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Escape-from-Security-Mode-in-9S12DG256/m-p/134342#M2049</guid>
      <dc:creator>SteveRussell</dc:creator>
      <dc:date>2006-05-04T01:24:12Z</dc:date>
    </item>
  </channel>
</rss>

