<?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>S12 / MagniV MicrocontrollersのトピックDebugging question</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Debugging-question/m-p/124656#M166</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="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;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;NAMESPACE ns="urn:schemas-microsoft-com:office:office" prefix="o"&gt;&lt;/NAMESPACE&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;B style="mso-bidi-font-weight: normal;"&gt;&lt;FONT size="2"&gt;Posted: Sat Dec 10, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;1:22 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;G'day,&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've got two programs: a boot loader and an application.&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;If I build the application and flash it (directly from CW using my BDM) the app runs fine.&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;If I flash the boot loader, download the application (specifically its S19 records), then transfer control to the app. As the app doesn't run correctly, I've got some debugging to do.&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;How can I tell CW's debugger to use the app's debug info rather than the boot loader's debug info?&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;Alternatively, can I switch CW to the application and start the debugger _without_ having it flash the 68HC12?&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;Either of the above techniques would give me the boot loaded version of the application along with the application's source code for determining what's wrong.&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;Thanks.&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: Sat Dec 10, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;5:59 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; How can I tell CW's debugger to use the app's debug info rather than&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; the boot loader's debug info?&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 is a column in CW when you build the app that you must check or it will not build the debug information. It looks like a green bug, just click until you get a dot in the column and you should be good to go. Note that you need to turn off as much optimization as possible if you want to be able to set breakpoints where you think they should be. There is a function if you right click that shows where the breakpoints can be set; it puts check marks in the code. Markpoints I think... also you need to define variables as static if you want to see them or they will get optimized to the stack. Afterwards you change it back.&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: Sat Dec 10, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;12:54 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;Both the boot loader and user application are built with debug info. I've sufficient knowledge of 68xx assembly language that I can deal with the optimized code.&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;During testing I first use the debugger to flash the boot loader. Then I use a PC based program to download the user application (via a serial port). Finally I want to use the debugger on the _application_ code.&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;How do I tell the debugger to use the user application's debug info (rather than the boot loader's info)?&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;Regards,&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: Sat Dec 10, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;7:48 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;&amp;gt; During testing I first use the debugger to flash the boot loader. Then&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; I use a PC based program to download the user application (via a serial&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; port). Finally I want to use the debugger on the _application_ code.&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; How do I tell the debugger to use the user application's debug info&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; (rather than the boot loader's info)?&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 you can debug using this method. The debugger/loader is loading files and tables before it flashes the code which have the debug and app information. It then syncs the source lines to the execution. So unless you are able to build the internal structures in the manner that the debugger expects and then call the entry point of the debugger with the right calling convention, I doubt this will work.&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;What I would suggest you do is build both the bootloader and app as a single module. You have debugged the boot loader and know it works, therefore bypass the serial download fcn and call your main app.&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;FONT size="2"&gt;&lt;SPAN class="msg_source_code"&gt;&lt;SPAN class="text_smallest"&gt;Code:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;void main(void){&amp;nbsp; MyBootLoader(); // TestBootloader&amp;nbsp; // bypass's external&amp;nbsp; // load, (comment out)&amp;nbsp; }&amp;nbsp; return;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void TestBootLoader(void)&amp;nbsp; {&amp;nbsp; MyCodeToTest();&amp;nbsp; }&lt;/PRE&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;FONT size="2"&gt;Now you can debug without a problem. The other way will lead you into all manner of tech issues.&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: Sat Dec 10, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;8:00 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 hiwave debugger, use the File-&amp;gt;"Load Application" menu and select "Load Symbols Only" and select your application *.abs fle. &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;FONT size="2"&gt;And there is also a corresponding command line command: &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;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;LOAD "app.abs" SYMBOLSONLY&lt;/FONT&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;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Jan 2006 14:05:18 GMT</pubDate>
    <dc:creator>khumphri</dc:creator>
    <dc:date>2006-01-27T14:05:18Z</dc:date>
    <item>
      <title>Debugging question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Debugging-question/m-p/124656#M166</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="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;/P&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;NAMESPACE ns="urn:schemas-microsoft-com:office:office" prefix="o"&gt;&lt;/NAMESPACE&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;B style="mso-bidi-font-weight: normal;"&gt;&lt;FONT size="2"&gt;Posted: Sat Dec 10, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;1:22 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;G'day,&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've got two programs: a boot loader and an application.&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;If I build the application and flash it (directly from CW using my BDM) the app runs fine.&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;If I flash the boot loader, download the application (specifically its S19 records), then transfer control to the app. As the app doesn't run correctly, I've got some debugging to do.&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;How can I tell CW's debugger to use the app's debug info rather than the boot loader's debug info?&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;Alternatively, can I switch CW to the application and start the debugger _without_ having it flash the 68HC12?&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;Either of the above techniques would give me the boot loaded version of the application along with the application's source code for determining what's wrong.&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;Thanks.&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: Sat Dec 10, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;5:59 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; How can I tell CW's debugger to use the app's debug info rather than&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; the boot loader's debug info?&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 is a column in CW when you build the app that you must check or it will not build the debug information. It looks like a green bug, just click until you get a dot in the column and you should be good to go. Note that you need to turn off as much optimization as possible if you want to be able to set breakpoints where you think they should be. There is a function if you right click that shows where the breakpoints can be set; it puts check marks in the code. Markpoints I think... also you need to define variables as static if you want to see them or they will get optimized to the stack. Afterwards you change it back.&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: Sat Dec 10, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;12:54 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;Both the boot loader and user application are built with debug info. I've sufficient knowledge of 68xx assembly language that I can deal with the optimized code.&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;During testing I first use the debugger to flash the boot loader. Then I use a PC based program to download the user application (via a serial port). Finally I want to use the debugger on the _application_ code.&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;How do I tell the debugger to use the user application's debug info (rather than the boot loader's info)?&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;Regards,&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: Sat Dec 10, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;7:48 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;&amp;gt; During testing I first use the debugger to flash the boot loader. Then&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; I use a PC based program to download the user application (via a serial&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; port). Finally I want to use the debugger on the _application_ code.&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; How do I tell the debugger to use the user application's debug info&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; (rather than the boot loader's info)?&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 you can debug using this method. The debugger/loader is loading files and tables before it flashes the code which have the debug and app information. It then syncs the source lines to the execution. So unless you are able to build the internal structures in the manner that the debugger expects and then call the entry point of the debugger with the right calling convention, I doubt this will work.&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;What I would suggest you do is build both the bootloader and app as a single module. You have debugged the boot loader and know it works, therefore bypass the serial download fcn and call your main app.&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;FONT size="2"&gt;&lt;SPAN class="msg_source_code"&gt;&lt;SPAN class="text_smallest"&gt;Code:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;void main(void){&amp;nbsp; MyBootLoader(); // TestBootloader&amp;nbsp; // bypass's external&amp;nbsp; // load, (comment out)&amp;nbsp; }&amp;nbsp; return;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void TestBootLoader(void)&amp;nbsp; {&amp;nbsp; MyCodeToTest();&amp;nbsp; }&lt;/PRE&gt;&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt;"&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;FONT size="2"&gt;Now you can debug without a problem. The other way will lead you into all manner of tech issues.&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: Sat Dec 10, 2005&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;8:00 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 hiwave debugger, use the File-&amp;gt;"Load Application" menu and select "Load Symbols Only" and select your application *.abs fle. &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;FONT size="2"&gt;And there is also a corresponding command line command: &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;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;LOAD "app.abs" SYMBOLSONLY&lt;/FONT&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;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2006 14:05:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Debugging-question/m-p/124656#M166</guid>
      <dc:creator>khumphri</dc:creator>
      <dc:date>2006-01-27T14:05:18Z</dc:date>
    </item>
  </channel>
</rss>

