<?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: debug through bootloader, or attach to a running target? in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/debug-through-bootloader-or-attach-to-a-running-target/m-p/579241#M24014</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by ex-kayoda on Fri Oct 12 06:14:54 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: joeyoravec&lt;/STRONG&gt;&lt;BR /&gt; Every time I debug it automatically resets the target, downloads code, and expects to start from reset.&lt;BR /&gt;&lt;BR /&gt;Any ideas? :confused:&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you try to debug a runing target already? &lt;/SPAN&gt;&lt;A href="http://"&gt;http://knowledgebase.nxp.com/showthread.php?t=2787&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 23:59:49 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T23:59:49Z</dc:date>
    <item>
      <title>debug through bootloader, or attach to a running target?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/debug-through-bootloader-or-attach-to-a-running-target/m-p/579240#M24013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by joeyoravec on Fri Oct 12 06:08:54 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I've written a bootloader for my LPC11C24. The bootloader and main application are separate lpcxpresso projects, compiled as separate *.axf files, and converted to *.bin images that can be written to internal flash memory.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is that at some point the bootloader jumps to the application like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
// We're currently running the bootloader at 0x00000000
// The main application exists at 0x00002000
// Get a function pointer to the main application's ResetISR
void (*(* const app_pfnVectors))(void) = 0x00002000;
void (*app_entry)(void) = app_pfnVectors[1];
// Run the main application, this will not return
app_entry();&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;which works fine, but the debugger was started for the bootloader project so it has no symbols loaded for, and cannot step into, the main application.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want some way to debug the main application. My ideas so far were:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Allow the bootloader to launch the main application, then make the debugger attach to an already running target. Is this possible?? Every time I debug it automatically resets the target, downloads code, and expects to start from reset.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- When debugging, compile a special version of the main app linked to run from 0x0 instead of the normal location. But this is not ideal because then I'd be debugging a binary that gets launched fundamentally differently than the one I ship to customers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Compile both bootloader and application into a single image, but this is also non-ideal since the two would have global symbol conflicts.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas? :confused:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:59:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/debug-through-bootloader-or-attach-to-a-running-target/m-p/579240#M24013</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: debug through bootloader, or attach to a running target?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/debug-through-bootloader-or-attach-to-a-running-target/m-p/579241#M24014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by ex-kayoda on Fri Oct 12 06:14:54 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: joeyoravec&lt;/STRONG&gt;&lt;BR /&gt; Every time I debug it automatically resets the target, downloads code, and expects to start from reset.&lt;BR /&gt;&lt;BR /&gt;Any ideas? :confused:&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you try to debug a runing target already? &lt;/SPAN&gt;&lt;A href="http://"&gt;http://knowledgebase.nxp.com/showthread.php?t=2787&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:59:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/debug-through-bootloader-or-attach-to-a-running-target/m-p/579241#M24014</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: debug through bootloader, or attach to a running target?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/debug-through-bootloader-or-attach-to-a-running-target/m-p/579242#M24015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by ArtjomGromak on Fri Oct 12 13:07:22 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: joeyoravec&lt;/STRONG&gt;&lt;BR /&gt;I've written a bootloader for my LPC11C24. The bootloader and main application are separate lpcxpresso projects, compiled as separate *.axf files, and converted to *.bin images that can be written to internal flash memory.&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did so:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Create bootloader project, which start application.&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
__set_MSP(*(uint32_t *)0x1000);
ISRPtr application_reset_handler=(ISRPtr)(*(uint32_t *)0x1004);
application_reset_handler();
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Program bootloader in flash.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Create application project which is placed in flash from 0x1000.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. Build application&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5. Just debug application:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; lpcxpresso write application to our flash region (0x1000) and don't erase bootloader. Bootloader started application. Debug is the same as &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;debug&amp;nbsp; application without bootloader.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: joeyoravec&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;- Allow the bootloader to launch the main application, then make the debugger attach to an already running target. Is this possible?? &lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think it's don't work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: joeyoravec&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;- Compile both bootloader and application into a single image, but this is also non-ideal since the two would have global symbol conflicts.&lt;BR /&gt;Any ideas? :confused:&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One project for bootloader and application is bad idea.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:59:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/debug-through-bootloader-or-attach-to-a-running-target/m-p/579242#M24015</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: debug through bootloader, or attach to a running target?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/debug-through-bootloader-or-attach-to-a-running-target/m-p/579243#M24016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by daniel.widyanto on Sun Oct 14 21:38:33 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To debug the application, that's not stored in 0x00 (the default reset address), you can use the same method to debug the program that's running from SDRAM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See &lt;/SPAN&gt;&lt;A href="http://"&gt;http://knowledgebase.nxp.com/showthread.php?t=3589&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just set the PC to 0x2000, and SP = *0x2004 from GDB init script (the GDB init should emulate the bootloader's behavior).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:59:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/debug-through-bootloader-or-attach-to-a-running-target/m-p/579243#M24016</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:59:50Z</dc:date>
    </item>
  </channel>
</rss>

