<?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: Debugging a program with debugger in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520382#M3612</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by R2D2 on Tue May 19 08:16:30 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: justmakeit&lt;/STRONG&gt;&lt;BR /&gt;only my user code uses the SysTick_Handler. I disable it in the bootloader code. but it is still jumping to the wrong Systick_handler. I probably asking very stupid questions&amp;nbsp; :) ,&amp;nbsp; please give me some more information.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've no idea what your bootloader or application is doing in detail&amp;nbsp; :) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So it could be a good idea to disable SysTick in your application, then the problem should disappear...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 17:44:17 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T17:44:17Z</dc:date>
    <item>
      <title>Debugging a program with debugger</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520375#M3605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by justmakeit on Thu May 07 01:38:18 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Currently i'm trying to make a program with a bootloader. But i keep failing with debugging the user application in LPCxpresso. There are a lot of questions and answers on the internet about creating a bootloader, but i cant found how to implement the flash settings in lpcxpresso. i'm using the "lpc link2" as programmer&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;what i'm doing:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. program the bootloader the default way.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Debug As-&amp;gt; C/C++ (NXP semiconductors) MCU application&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. the bootloader start the application with the next code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;PROGRAM_ADDRESS_START = 0x3000&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;
void execute_user_code(void)
{
void (*user_code_entry)(void);

unsigned *p;// used for loading address of reset handler from user flash

/* Change the Vector Table to the USER_FLASH_START
in case the user application uses interrupts */

SCB-&amp;gt;VTOR = (PROGRAM_ADDRESS_START &amp;amp; 0x1FFFFF80);

// Load contents of second word of user flash - the reset handler address
// in the applications vector table
p = (unsigned *)(PROGRAM_ADDRESS_START +4);

// Set user_code_entry to be the address contained in that second word
// of user flash
user_code_entry = (void *) *p;

// Jump to user application
&amp;nbsp;&amp;nbsp;&amp;nbsp; user_code_entry();

}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;3. replace the user application in flash&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;properties-&amp;gt;c/c++ build-&amp;gt;mcu settings-&amp;gt;LPC1766-&amp;gt;MFlash256 location: 0x3000 size: 0x3d000&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;4. Debug the user code&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Debug As-&amp;gt; C/C++ (NXP semiconductors) MCU application&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;5. Debugger jumps to the wrong code&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:44:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520375#M3605</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging a program with debugger</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520376#M3606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by R2D2 on Thu May 07 04:44:58 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: justmakeit&lt;/STRONG&gt;&lt;BR /&gt;Currently i'm trying to make a program with a bootloader...&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Usually it's enough to flash/debug&amp;nbsp; the bootlader and then debug the application (with application Flash settting)&amp;nbsp; :)&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Debugger should of course start the debug session at your MCU settings-&amp;gt;Flash location...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If that's not working and the debugger is still starting at 0x0000 use a simple bootloader to jump to your application start address... &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:44:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520376#M3606</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging a program with debugger</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520377#M3607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by justmakeit on Tue May 19 06:38:49 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your reaction,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I made the simple bootloader to jump to my user code and he is jumping to the right code. When i set a breakpoint at te start of my main function it breaks at the right location. But when i step through my code it goes wrong after a few steps. the place of failure is random depending on the speed of stepping through my code. When it's failing it jumps to pc = 0x114 . &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How can i figureout the reason it is failing?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:44:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520377#M3607</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging a program with debugger</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520378#M3608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by R2D2 on Tue May 19 06:50:59 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you still using the code above?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could be useful to load the stack pointer before the jump is executed&amp;nbsp; :O &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And of course disable interrupts&amp;nbsp; :) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: justmakeit&lt;/STRONG&gt;&lt;BR /&gt;When it's failing it jumps to pc = 0x114. &lt;BR /&gt;How can i figureout the reason it is failing?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What's in 0x114&amp;nbsp; :quest: &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:44:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520378#M3608</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging a program with debugger</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520379#M3609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by justmakeit on Tue May 19 07:35:55 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes my simple bootloader is the code above.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i haven't turn on any interrupts. are there interrupts default on?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i'm a bit confused now... The stack of the bootloader is the same memory as my user code uses right? So why do i need to load a stack pointer?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;my user code start at address 0x3000 so&amp;nbsp; 0x114 is not in the user code. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 0x114 is the SysTick_Handler of the bootloader code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:44:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520379#M3609</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging a program with debugger</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520380#M3610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by R2D2 on Tue May 19 07:41:00 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: justmakeit&lt;/STRONG&gt;&lt;BR /&gt;my user code start at address 0x3000 so&amp;nbsp; 0x114 is not in the user code.&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt; :D &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: justmakeit&lt;/STRONG&gt;&lt;BR /&gt;0x114 is the SysTick_Handler of the bootloader code.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And who is using SysTick?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:44:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520380#M3610</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging a program with debugger</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520381#M3611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by justmakeit on Tue May 19 08:11:28 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;only my user code uses the SysTick_Handler. I disable it in the bootloader code. but it is still jumping to the wrong Systick_handler. I probably asking very stupid questions&amp;nbsp; :) ,&amp;nbsp; please give me some more information.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:44:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520381#M3611</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging a program with debugger</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520382#M3612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by R2D2 on Tue May 19 08:16:30 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: justmakeit&lt;/STRONG&gt;&lt;BR /&gt;only my user code uses the SysTick_Handler. I disable it in the bootloader code. but it is still jumping to the wrong Systick_handler. I probably asking very stupid questions&amp;nbsp; :) ,&amp;nbsp; please give me some more information.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've no idea what your bootloader or application is doing in detail&amp;nbsp; :) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So it could be a good idea to disable SysTick in your application, then the problem should disappear...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:44:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520382#M3612</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging a program with debugger</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520383#M3613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by justmakeit on Wed May 20 05:27:34 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I disabled the systick in my user application and it don't fail anymore &lt;SPAN class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;&lt;LI-EMOJI id="lia_grinning-face-with-smiling-eyes" title=":grinning_face_with_smiling_eyes:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt; . But my user program uses the systick interrupt to run my timers. so how can i remap the interrupt to address 0x3114 ? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i remap the vector table with this code:&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;SCB-&amp;gt;VTOR = (PROGRAM_ADDRESS_START &amp;amp; 0x1FFFFF80);&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you in advance for your help &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:44:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520383#M3613</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging a program with debugger</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520384#M3614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by R2D2 on Wed May 20 05:45:53 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: justmakeit&lt;/STRONG&gt;&lt;BR /&gt;I disabled the systick in my user application and it don't fail anymore :D . But my user program uses the systick interrupt... &lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Don't panic early&amp;nbsp; :) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Disabling SysTick is of course a test to show you the problem...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Next step: look in your application vector table (at 0x3000) .&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There's the address (+1) for SysTick interrupt handler at word 0x3C&amp;nbsp; :O &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That should be in your case something &amp;gt; 0x3000. If it's 0x115 your vector table is wrong&amp;nbsp; :D &lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:44:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520384#M3614</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging a program with debugger</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520385#M3615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by justmakeit on Wed May 20 05:48:24 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I have found my problem. CMSIS overwrite my configuration. so i was searching in the wrong code ;-) its working now :D&amp;nbsp; Thanks for your help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:44:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Debugging-a-program-with-debugger/m-p/520385#M3615</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:44:19Z</dc:date>
    </item>
  </channel>
</rss>

