<?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 Running App after Bootloader Issue in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Running-App-after-Bootloader-Issue/m-p/125589#M350</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;SPAN style="mso-bookmark: OLE_LINK1;"&gt;&lt;SPAN style="mso-bookmark: OLE_LINK2;"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red;"&gt;This message contains an entire topic ported from a separate forum. The original message and all replies are in this single message. We have seeded this new forum with selected information that we expect will be of value to you as you search for answers to your questions.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;SPAN style="mso-bookmark: OLE_LINK1;"&gt;&lt;SPAN style="mso-bookmark: OLE_LINK2;"&gt;&lt;NAMESPACE ns="urn:schemas-microsoft-com:office:office" prefix="o"&gt;&lt;/NAMESPACE&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&lt;SPAN style="mso-bookmark: OLE_LINK1;"&gt;&lt;SPAN style="mso-bookmark: OLE_LINK2;"&gt;&lt;B style="mso-bidi-font-weight: normal;"&gt;Posted: &lt;/B&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;B style="mso-bidi-font-weight: normal;"&gt;Thu Jun 2, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;10:49 pm &lt;/B&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;We implemented a bootloader that loads an application to the E128 processor. The bootloader does its job and reprograms the Flash, and then jumps to execute the new application at its entry point. The problem is that the new application crashes all the time, at different points without a pattern.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;When flashing the new application directly with a P&amp;amp;E BDM box, it works without failure, so we know the application is not a problem.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;When running the bootloader using the BDM box, and loading the new application, the new application works without a problem.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;Has anybody experienced any similar problem when running applications after the bootloader?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;Thank you for your help!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&amp;nbsp;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;B style="mso-bidi-font-weight: normal;"&gt;&lt;FONT size="2"&gt;Posted: Thu Jun 2, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;11:02 pm &lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;Are all the vectors for your application properly mapped to the actual vectors for the mcu? That would be my first guess. Are you using paged memory? Is your stack initialized properly?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;I have a bootloader and it, as well as the application, run fine so I am guessing it is some small oversight.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&amp;nbsp;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;B style="mso-bidi-font-weight: normal;"&gt;&lt;FONT size="2"&gt;Posted: Thu Jun 2, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;11:16 pm &lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;There may be a problem with the BDM running in "Special Single Chip" mode while the stand alone runs in "Normal Single Chip" mode.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;There has been a great amount of discussion of this on this list in the last week or so under the heading of "BOOTLOADER only works in debug mode". See the Archives.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;A likely candidate is the COP watchdog, which is not enabled by default in "Special Single Chip" mode and is enabled in "Normal Single Chip" mode, but there are also many registers that become write-once in "Normal Single Chip" mode.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;Please read the archives, the list wouldn't stand for rehashing this subject so soon after it was examined in great detail.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&amp;nbsp;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;B style="mso-bidi-font-weight: normal;"&gt;&lt;FONT size="2"&gt;Posted: Fri Jun 3, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;1:39 am &lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;I have been following these entries as well. Is there a document that describe which registers are write once, so that I can verify which ones could be causing the problems?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;Regarding the COP, it is my undertanding that the initialization code of both the bootloader and the main application (both generated by Processor Expert) disables the COP watchdog. In addition, the program doesn't seem to reset and start over, but to hang (in different places each time).&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;One question is: if the initialization code of both the bootloader and the application is the same, the registers would have the same values when the application is initializing, and, therefore, would run properly. But this is not the case.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&amp;nbsp;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;B style="mso-bidi-font-weight: normal;"&gt;&lt;FONT size="2"&gt;Posted: Fri Jun 3, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;3:32 am &lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;I am not aware of any single place to look.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;As the HC(S)-12 family has evolved the details of what is write once and a few registers that were "first write ignored in Special Single Chip Mode" (write twice!) have evolved.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;The only safe thing to do is use the "device user's guide" to tell you about the different documents that describe registers for the particular part and version of that part, and then look carefully in the detailed register descriptions.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;I just did a brief scan of the MC9S12E128 documentation, and found that there were write once registers which might trip up a boot loader mentioned in the CRG, PIM, Flash, EEPROM, MEBI, and MMC documents!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;Some of these will probably affect only applications that attempt to use external memory, but the all seem to have some mode dependent differences.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;I don't think that blindly trusting Processor Expert to do what you expect is wise. It depends on the authors of Processor Expert and you both correctly expecting the same "right thing". I would strongly recommend looking at the assembler listings or the disassembly of the loaded code to see what is actually going.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;The startup code usually ends up being pretty straightforward, although looking at the source files that have conditional compilation to deal with the many options makes it look very complicated.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;The last few weeks of list traffic on this subject have mentioned all of the pitfalls that come to mind, but I'm sure that there are a few more lurking in the shadows.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&amp;nbsp;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;B style="mso-bidi-font-weight: normal;"&gt;&lt;FONT size="2"&gt;Posted: Fri Jun 3, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;7:00 am &lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; I have been following these entries as well. Is there a document that&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; describe which registers are write once, so that I can verify which&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;The list archives, my mail "List of "write once" registers in HCS12 derivatives":&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; Hello All,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; is there an exhaustive list of "write once" registers in HCS12&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; derivatives?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; The modular documentation makes it very hard to find all places, and one&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; can't even rely on searching the "write once" phrase.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; I know so far:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; INITRM&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; INITRG&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; INITEE ("on some devices") with the exception of the EEON bit&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; MISC (EXSTR1 EXSTR0 ROMHM ROMON)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; MODE (several restrictions)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; EBICTL (External Bus Interface Control Register): ESTR&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; IRQCR (IRQ Control Register): IRQE - IRQ Select Edge Sensitive Only&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; PEAR: with the exception of the NECLK bit&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; CLKSEL: COPWAI&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; PLLCTL: SCME - Self Clock Mode Enable Bit&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; COPCTL (CRG COP Control Register)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; ECLKDIV (EEPROM Clock Divider Register)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; FCLKDIV (Flash Clock Divider Register)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; CANCTL1 MSCAN Control 1 Register: CANE - MSCAN Enable&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; DLCBCR1 (BDLC Control Register 1): CLKS&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; DLCBARD (BDLC Analog Round Trip Delay Register)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; DLCBRSR (BDLC Rate Select Register)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; BFPCTLBF (&lt;NAMESPACE ns="urn:schemas-microsoft-com:office:smarttags" prefix="st1"&gt;&lt;PLACE st="on"&gt;&lt;PLACENAME st="on"&gt;Byteflight&lt;/PLACENAME&gt; &lt;PLACETYPE st="on"&gt;Port&lt;/PLACETYPE&gt;&lt;/PLACE&gt; Control Register): BFEN&lt;/NAMESPACE&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; Any more?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;The question still applies. Maybe some new registers in the S12X?&lt;/FONT&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&amp;nbsp;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;B style="mso-bidi-font-weight: normal;"&gt;&lt;FONT size="2"&gt;Posted: Fri Jun 3, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;1:49 am &lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;The vectors are properly mapped to the vectors of the MCU. This is from the fact that the application runs without problems when programmed independently (using BDM). In fact, when the application runs from the bootloader, it works for a few moments, but then it hangs.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;Regarding the paged memory, we are indeed using paged memory (due to the size of the application). How would this affect the behavior of the application, when loaded with a bootloader?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;Regarding the stack, it is initialized properly. Stepping through the initialization of the application after being launched by the bootloader, shows that the stack is correctly located (at the top address of RAM).&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;Did you code your own booloader or did you use some of the available bootloader code? Would it be possible to check your code to see if this give us some clue about the problem we're having?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;Thank you for your help!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&amp;nbsp;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;B style="mso-bidi-font-weight: normal;"&gt;&lt;FONT size="2"&gt;Posted: Fri Jun 3, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;4:22 pm &lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;In the first point you mention that the application runs without problem when programmed from the BDM. I assume then that for the application all of the reset vectors are from FFD0 to FFFF. If this application is to run with a bootloader it must be recompiled with the vectors placed at a secondary location. For example...in the bootloader that I wrote the bootloader itself occupies F800 to FFFF and its vector table lies at FFDO to FFFF. The application's vector table however lies at F7DO to F7FF. All of the bootloader's vectors must point to this secondary table for the application to run properly. Maybe this is what you are doing already but it is unclear to me.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;The paged memory caused me a few headaches as I recall due to not setting the page register properly in the bootloader to begin with. This was a while back so I am fuzzy on the details.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;I wish I could show you the bootloader but it also performs some decryption routines that should be kept private.&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Feb 2006 01:08:37 GMT</pubDate>
    <dc:creator>khumphri</dc:creator>
    <dc:date>2006-02-01T01:08:37Z</dc:date>
    <item>
      <title>Running App after Bootloader Issue</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Running-App-after-Bootloader-Issue/m-p/125589#M350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;SPAN style="mso-bookmark: OLE_LINK1;"&gt;&lt;SPAN style="mso-bookmark: OLE_LINK2;"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red;"&gt;This message contains an entire topic ported from a separate forum. The original message and all replies are in this single message. We have seeded this new forum with selected information that we expect will be of value to you as you search for answers to your questions.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;SPAN style="mso-bookmark: OLE_LINK1;"&gt;&lt;SPAN style="mso-bookmark: OLE_LINK2;"&gt;&lt;NAMESPACE ns="urn:schemas-microsoft-com:office:office" prefix="o"&gt;&lt;/NAMESPACE&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&lt;SPAN style="mso-bookmark: OLE_LINK1;"&gt;&lt;SPAN style="mso-bookmark: OLE_LINK2;"&gt;&lt;B style="mso-bidi-font-weight: normal;"&gt;Posted: &lt;/B&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;B style="mso-bidi-font-weight: normal;"&gt;Thu Jun 2, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;10:49 pm &lt;/B&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;We implemented a bootloader that loads an application to the E128 processor. The bootloader does its job and reprograms the Flash, and then jumps to execute the new application at its entry point. The problem is that the new application crashes all the time, at different points without a pattern.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;When flashing the new application directly with a P&amp;amp;E BDM box, it works without failure, so we know the application is not a problem.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;When running the bootloader using the BDM box, and loading the new application, the new application works without a problem.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;Has anybody experienced any similar problem when running applications after the bootloader?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;Thank you for your help!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&amp;nbsp;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;B style="mso-bidi-font-weight: normal;"&gt;&lt;FONT size="2"&gt;Posted: Thu Jun 2, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;11:02 pm &lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;Are all the vectors for your application properly mapped to the actual vectors for the mcu? That would be my first guess. Are you using paged memory? Is your stack initialized properly?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;I have a bootloader and it, as well as the application, run fine so I am guessing it is some small oversight.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&amp;nbsp;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;B style="mso-bidi-font-weight: normal;"&gt;&lt;FONT size="2"&gt;Posted: Thu Jun 2, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;11:16 pm &lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;There may be a problem with the BDM running in "Special Single Chip" mode while the stand alone runs in "Normal Single Chip" mode.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;There has been a great amount of discussion of this on this list in the last week or so under the heading of "BOOTLOADER only works in debug mode". See the Archives.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;A likely candidate is the COP watchdog, which is not enabled by default in "Special Single Chip" mode and is enabled in "Normal Single Chip" mode, but there are also many registers that become write-once in "Normal Single Chip" mode.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;Please read the archives, the list wouldn't stand for rehashing this subject so soon after it was examined in great detail.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&amp;nbsp;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;B style="mso-bidi-font-weight: normal;"&gt;&lt;FONT size="2"&gt;Posted: Fri Jun 3, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;1:39 am &lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;I have been following these entries as well. Is there a document that describe which registers are write once, so that I can verify which ones could be causing the problems?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;Regarding the COP, it is my undertanding that the initialization code of both the bootloader and the main application (both generated by Processor Expert) disables the COP watchdog. In addition, the program doesn't seem to reset and start over, but to hang (in different places each time).&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;One question is: if the initialization code of both the bootloader and the application is the same, the registers would have the same values when the application is initializing, and, therefore, would run properly. But this is not the case.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&amp;nbsp;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;B style="mso-bidi-font-weight: normal;"&gt;&lt;FONT size="2"&gt;Posted: Fri Jun 3, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;3:32 am &lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;I am not aware of any single place to look.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;As the HC(S)-12 family has evolved the details of what is write once and a few registers that were "first write ignored in Special Single Chip Mode" (write twice!) have evolved.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;The only safe thing to do is use the "device user's guide" to tell you about the different documents that describe registers for the particular part and version of that part, and then look carefully in the detailed register descriptions.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;I just did a brief scan of the MC9S12E128 documentation, and found that there were write once registers which might trip up a boot loader mentioned in the CRG, PIM, Flash, EEPROM, MEBI, and MMC documents!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;Some of these will probably affect only applications that attempt to use external memory, but the all seem to have some mode dependent differences.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;I don't think that blindly trusting Processor Expert to do what you expect is wise. It depends on the authors of Processor Expert and you both correctly expecting the same "right thing". I would strongly recommend looking at the assembler listings or the disassembly of the loaded code to see what is actually going.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;The startup code usually ends up being pretty straightforward, although looking at the source files that have conditional compilation to deal with the many options makes it look very complicated.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;The last few weeks of list traffic on this subject have mentioned all of the pitfalls that come to mind, but I'm sure that there are a few more lurking in the shadows.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&amp;nbsp;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;B style="mso-bidi-font-weight: normal;"&gt;&lt;FONT size="2"&gt;Posted: Fri Jun 3, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;7:00 am &lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; I have been following these entries as well. Is there a document that&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; describe which registers are write once, so that I can verify which&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;The list archives, my mail "List of "write once" registers in HCS12 derivatives":&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; Hello All,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; is there an exhaustive list of "write once" registers in HCS12&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; derivatives?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; The modular documentation makes it very hard to find all places, and one&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; can't even rely on searching the "write once" phrase.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; I know so far:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; INITRM&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; INITRG&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; INITEE ("on some devices") with the exception of the EEON bit&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; MISC (EXSTR1 EXSTR0 ROMHM ROMON)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; MODE (several restrictions)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; EBICTL (External Bus Interface Control Register): ESTR&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; IRQCR (IRQ Control Register): IRQE - IRQ Select Edge Sensitive Only&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; PEAR: with the exception of the NECLK bit&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; CLKSEL: COPWAI&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; PLLCTL: SCME - Self Clock Mode Enable Bit&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; COPCTL (CRG COP Control Register)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; ECLKDIV (EEPROM Clock Divider Register)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; FCLKDIV (Flash Clock Divider Register)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; CANCTL1 MSCAN Control 1 Register: CANE - MSCAN Enable&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; DLCBCR1 (BDLC Control Register 1): CLKS&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; DLCBARD (BDLC Analog Round Trip Delay Register)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; DLCBRSR (BDLC Rate Select Register)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; BFPCTLBF (&lt;NAMESPACE ns="urn:schemas-microsoft-com:office:smarttags" prefix="st1"&gt;&lt;PLACE st="on"&gt;&lt;PLACENAME st="on"&gt;Byteflight&lt;/PLACENAME&gt; &lt;PLACETYPE st="on"&gt;Port&lt;/PLACETYPE&gt;&lt;/PLACE&gt; Control Register): BFEN&lt;/NAMESPACE&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;&amp;gt; Any more?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;The question still applies. Maybe some new registers in the S12X?&lt;/FONT&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&amp;nbsp;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;B style="mso-bidi-font-weight: normal;"&gt;&lt;FONT size="2"&gt;Posted: Fri Jun 3, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;1:49 am &lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;The vectors are properly mapped to the vectors of the MCU. This is from the fact that the application runs without problems when programmed independently (using BDM). In fact, when the application runs from the bootloader, it works for a few moments, but then it hangs.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;Regarding the paged memory, we are indeed using paged memory (due to the size of the application). How would this affect the behavior of the application, when loaded with a bootloader?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;Regarding the stack, it is initialized properly. Stepping through the initialization of the application after being launched by the bootloader, shows that the stack is correctly located (at the top address of RAM).&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;Did you code your own booloader or did you use some of the available bootloader code? Would it be possible to check your code to see if this give us some clue about the problem we're having?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;Thank you for your help!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&amp;nbsp;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;B style="mso-bidi-font-weight: normal;"&gt;&lt;FONT size="2"&gt;Posted: Fri Jun 3, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;4:22 pm &lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;In the first point you mention that the application runs without problem when programmed from the BDM. I assume then that for the application all of the reset vectors are from FFD0 to FFFF. If this application is to run with a bootloader it must be recompiled with the vectors placed at a secondary location. For example...in the bootloader that I wrote the bootloader itself occupies F800 to FFFF and its vector table lies at FFDO to FFFF. The application's vector table however lies at F7DO to F7FF. All of the bootloader's vectors must point to this secondary table for the application to run properly. Maybe this is what you are doing already but it is unclear to me.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;The paged memory caused me a few headaches as I recall due to not setting the page register properly in the bootloader to begin with. This was a while back so I am fuzzy on the details.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;FONT size="2"&gt;I wish I could show you the bootloader but it also performs some decryption routines that should be kept private.&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2006 01:08:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Running-App-after-Bootloader-Issue/m-p/125589#M350</guid>
      <dc:creator>khumphri</dc:creator>
      <dc:date>2006-02-01T01:08:37Z</dc:date>
    </item>
  </channel>
</rss>

