<?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>Kinetis MicrocontrollersのトピックRe: Jumping from boot loader mode to application mode</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746448#M45461</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kirti&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see that you have 0xab5d at 0xa004 and so I expect it to jump to here.&lt;BR /&gt;You need to single step the jmp code and check that 0x20000000 is really in the SP before the jump takes place.&lt;BR /&gt;Single step in disassemble mode since the debugger may otherwise become confused when it tries to follow using source level debugging.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Jan 2018 17:18:24 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2018-01-23T17:18:24Z</dc:date>
    <item>
      <title>Jumping from boot loader mode to application mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746444#M45457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have written a boot loader and application code using KDS 3.2 for K64FN controller.&lt;BR /&gt;My boot loader starts at 0x00000000 and application starts at address 0x0000A000.&lt;/P&gt;&lt;P&gt;My boot loader is able to flash application (S19 file) in application area. After &lt;BR /&gt;firmware flashing, I am using below function to jump to application start -&lt;/P&gt;&lt;P&gt;APP_FLASH_VECTOR_START - 0x0000A000&lt;BR /&gt;UByte checkForUserApp(void)&lt;BR /&gt;{&lt;BR /&gt; uint32_t startup; /* assuming 32bit function pointers */&lt;BR /&gt; startup = ((uint32_t*)APP_FLASH_VECTOR_START); /* this is the reset vector (__startup function) */&lt;/P&gt;&lt;P&gt;if ((startup!=-1))&lt;BR /&gt; {&lt;BR /&gt; /* we do have a valid application vector? -1/0xfffffff would mean flash erased */&lt;BR /&gt; ((void(*)(void))startup)(); /* Jump to application startup code */&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;}&lt;BR /&gt;I have also tried below code to jump to application but it is not able to jump to &lt;BR /&gt;0xA000 address.&lt;/P&gt;&lt;P&gt;UByte checkForUserApp(void)&lt;BR /&gt;{&lt;BR /&gt; __asm(" ldr r0, = 0xA000");&lt;/P&gt;&lt;P&gt;__asm(" ldr r1,[r0]"); // get the stack pointer value from the program's reset vector&lt;/P&gt;&lt;P&gt;__asm(" mov sp,r1"); // copy the value to the stack pointer&lt;/P&gt;&lt;P&gt;__asm(" ldr r0, = 0xA004"); // get the program counter value from the program's reset vector&lt;/P&gt;&lt;P&gt;__asm(" ldr r1,[r0]");&lt;/P&gt;&lt;P&gt;__asm(" blx r1"); // jump to the start address&lt;BR /&gt; &lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;The value at startup is 0xAB5D which is Program counter's value.&lt;/P&gt;&lt;P&gt;My issue is that, boot loader is not able to jump to application and is jumping to &lt;BR /&gt;thumb startup function.&lt;/P&gt;&lt;P&gt;did some one come across this scenario. Any help is appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kirti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jan 2018 17:22:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746444#M45457</guid>
      <dc:creator>kirtiraje</dc:creator>
      <dc:date>2018-01-22T17:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from boot loader mode to application mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746445#M45458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kirti&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following code jumps to the application correctly (M4 processor).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 12px;"&gt;// Allow the jump to a foreign application as if it were a reset (load SP and PC)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 12px;"&gt;//&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 12px;"&gt;extern void start_application(unsigned long app_link_location)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 12px;"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; asm(" ldr r1, [r0,#0]");&amp;nbsp;&amp;nbsp;&amp;nbsp; // get the stack pointer value from the program's reset vector&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; asm(" mov sp, r1");&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // copy the value to the stack pointer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; asm(" ldr r0, [r0,#4]");&amp;nbsp;&amp;nbsp;&amp;nbsp; // get the program counter value from the program's reset vector&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; asm(" blx r0");&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // jump to the start address&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 12px;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace; font-size: 12px;"&gt;start_application(0xa000);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the uTasker project includes serial loaders for the K64 (and most other Kinetis parts) which do one or multiple methods as follows:&lt;BR /&gt;- UART SREC, iHEX, KBOOT, AN2295 Developer's serial loader compatible&lt;BR /&gt;- USB-CDC (SREC, iHex)&lt;BR /&gt;- USB-HID AN4764 compatible&lt;BR /&gt;- USB-MSD binary, iHex, SREC&lt;BR /&gt;- USB memory stick&lt;BR /&gt;- SD card&lt;BR /&gt;- Modbus UART RTU/ASCII&lt;BR /&gt;- Modbus/TCP&lt;BR /&gt;- I2C&lt;BR /&gt;- Ethernet web server&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These have been industrially verified in hundreds of different products over 6 years of Kinetis use and so ensure reliable performance without need to redevelop.&lt;BR /&gt;Builds with: CW10.x, KDS, MCUXpresso, IAR, Keil, Greenhills, Crossworks, CooCox, Atollic, S32 Design Studio, GNU Make and Visual Studio&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kinetis: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;BR /&gt;Kinetis K64:&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FFRDM-K64F.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/FRDM-K64F.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FTWR-K64F120M.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TWR-K64F120M.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FTEENSY_3.5.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TEENSY_3.5.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FHexiwear-K64F.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/Hexiwear-K64F.html&lt;/A&gt;&lt;BR /&gt;&lt;STRONG&gt;Serial Loader&lt;/STRONG&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fdocs%2FuTasker%2FuTaskerSerialLoader.pdf" rel="nofollow" target="_blank"&gt;http://www.utasker.com/docs/uTasker/uTaskerSerialLoader.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;Free Open Source solution: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fgithub.com%2FuTasker%2FuTasker-Kinetis" rel="nofollow" target="_blank"&gt;https://github.com/uTasker/uTasker-Kinetis&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Working project in 15 minutes video: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fyoutu.be%2FK8ScSgpgQ6M" rel="nofollow" target="_blank"&gt;https://youtu.be/K8ScSgpgQ6M&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Professional Kinetis support, one-on-one training and complete fast-track project solutions: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fsupport.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/support.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jan 2018 19:44:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746445#M45458</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-01-22T19:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from boot loader mode to application mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746446#M45459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kirti raje,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; You also can refer to our &lt;A href="https://www.nxp.com/support/developer-resources/reference-designs/kinetis-bootloader:KBOOT?&amp;amp;tid=vanKBOOT"&gt;KBOOT2.0 &lt;/A&gt;for K64, this is the jump to application function:&lt;/P&gt;&lt;P&gt;static void jump_to_application(uint32_t applicationAddress, uint32_t stackPointer)&lt;BR /&gt;{&lt;BR /&gt;#if BL_FEATURE_OTFAD_MODULE&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; quadspi_cache_clear();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; oftfad_resume_as_needed();&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; shutdown_cleanup(kShutdownType_Shutdown);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Create the function call to the user application.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Static variables are needed since changed the stack pointer out from under the compiler&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // we need to ensure the values we are using are not stored on the previous stack&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; static uint32_t s_stackPointer = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; s_stackPointer = stackPointer;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; static void (*farewellBootloader)(void) = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; farewellBootloader = (void (*)(void))applicationAddress;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Set the VTOR to the application vector table address.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCB-&amp;gt;VTOR = (uint32_t)APP_VECTOR_TABLE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Set stack pointers to the application stack pointer.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; __set_MSP(s_stackPointer);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; __set_PSP(s_stackPointer);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Jump to the application.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; farewellBootloader();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Dummy fcuntion call, should never go to this fcuntion call&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; shutdown_cleanup(kShutdownType_Shutdown);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jan 2018 02:30:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746446#M45459</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-01-23T02:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from boot loader mode to application mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746447#M45460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;I have implemented &lt;SPAN&gt;extern void start_application(unsigned long app_link_location) function,still it is jumping to _thumb_startup()&amp;nbsp; in startup.c file. Please have a look at attached screenshot.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="BL_to_app_jump_issue.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20653i42231CE153A7BC32/image-size/large?v=v2&amp;amp;px=999" role="button" title="BL_to_app_jump_issue.png" alt="BL_to_app_jump_issue.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jan 2018 07:16:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746447#M45460</guid>
      <dc:creator>kirtiraje</dc:creator>
      <dc:date>2018-01-23T07:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from boot loader mode to application mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746448#M45461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kirti&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see that you have 0xab5d at 0xa004 and so I expect it to jump to here.&lt;BR /&gt;You need to single step the jmp code and check that 0x20000000 is really in the SP before the jump takes place.&lt;BR /&gt;Single step in disassemble mode since the debugger may otherwise become confused when it tries to follow using source level debugging.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jan 2018 17:18:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746448#M45461</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-01-23T17:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from boot loader mode to application mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746449#M45462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;I did debug in single step in disassemble mode and my SP is getting loaded with 0x20000000 and PC with 0xab5d. It is jumping into application but after execution of instruction at address 0xA28c it is switching from application to thumb_start() function of boot loader startup.c. Below are the screenshots showing &lt;SPAN&gt;0x20000000 loaded in&amp;nbsp;&lt;/SPAN&gt;SP in image1,&amp;nbsp; it is jumping to application in image2, and again switched to boot loader thumb_startup().&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/23963i11454CBF4A7F0A65/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.jpg" alt="1.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/24048iC44F5078C9AB2D1E/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.jpg" alt="2.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="3.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/23964iA03C4758539C1CBC/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.jpg" alt="3.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I am using KDS 3.2 and openSDA to debug the boot loader.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me to find out what could be wrong at&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;address 0xA28c, so that it get redirected again to boot loader.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jan 2018 06:39:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746449#M45462</guid>
      <dc:creator>kirtiraje</dc:creator>
      <dc:date>2018-01-24T06:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from boot loader mode to application mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746450#M45463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark ,&lt;/P&gt;&lt;P&gt;I did debug the application code. At address 0xA28c in application code is the watchdog reset instruction in init_hardware(), you can see that in the below screenshot.&lt;span class="lia-inline-image-display-wrapper" image-alt="4.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/25429i00B0E9DA37FC87C7/image-size/large?v=v2&amp;amp;px=999" role="button" title="4.jpg" alt="4.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I debug application, It is properly running the application. As I said while running boot loader mode, it is jumping to application and then at address&amp;nbsp;&lt;SPAN&gt;0xA28c it is again switching to boot loader thumb start function. Can any one help me in finding the solution.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jan 2018 09:24:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746450#M45463</guid>
      <dc:creator>kirtiraje</dc:creator>
      <dc:date>2018-01-24T09:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from boot loader mode to application mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746451#M45464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kirti&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like the watchdog unlock code is too slow.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;When unlocking the watchdog for modification the keys needs to be written quickly otherwise the watchdog will reset (to protect the system against watchdog manipulation). I have seen similar issue in Teensy watchdog code which works after a reset but not later (when the clock is running at full speed).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you have disabled the watchdog in the loader code (if the same as the code you show) you could just remove the same code from the application so that it doesn't disturb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise, build the code with full optimisation to make it faster. Or replace the code with assembler to ensure to avoid the inefficient accesses that are presently being performed (load the two key values to two registers and then write the two registers to the watchdog registers immediately after each other).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Finally, ensure that interrupts are disabled at this point to avoid the unlock sequence from potentially being interrupted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jan 2018 15:29:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746451#M45464</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-01-24T15:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from boot loader mode to application mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746452#M45465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;I have commented the watchdog disable code which is there in cpu_init.c file of application code&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code I have commented is -&lt;/P&gt;&lt;P&gt;// #if STARTUP_WDOG&lt;BR /&gt;// WDOG_UNLOCK = (uint16_t)STARTUP_WDOG_KEY_1; /* Key 1 */&lt;BR /&gt;// WDOG_UNLOCK = (uint16_t)STARTUP_WDOG_KEY_2; /* Key 2 */&lt;BR /&gt;// WDOG_STCTRLH = (uint16_t)STARTUP_WDOG_STCTRLH_VALUE; /* Disable WDOG */&lt;BR /&gt;// #endif /* STARTUP_WDOG */&lt;/P&gt;&lt;P&gt;I did disable the interrupts.&lt;/P&gt;&lt;P&gt;Then I did debug the application, but It did not run the application (LED blink) &lt;SPAN&gt;&amp;nbsp;(not from&amp;nbsp;&lt;/SPAN&gt;boot loader&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;code)&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;If I uncomment the above code then the application runs fine (not from boot loader code).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know your comments on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kirti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jan 2018 14:13:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746452#M45465</guid>
      <dc:creator>kirtiraje</dc:creator>
      <dc:date>2018-01-25T14:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from boot loader mode to application mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746453#M45466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Kirti&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is not the watchdog code I don't have any other ideas at the moment (there are many reasons why application code is not compatible with a boot loader but not all are evident from a screen shot).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need a fast solution you could just use the uTasker open source project which has a mature SREC loader included in it which may solve your issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In case you need to use other solutions I can fix it for you in your code but you will need to make a service request at &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fsupport.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/support.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jan 2018 17:56:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746453#M45466</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-01-25T17:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from boot loader mode to application mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746454#M45467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;Thank you for your help. It was not the watchdog reset issue.(&amp;nbsp;I was debugging the WDOG_UNLOCK keys switching and it got reset)&lt;/P&gt;&lt;P&gt;Now, I am able to jump to application mode successfully and the LED is switched ON (as my application is to blink LED in 1 sec interrupt). But it is not toggling. I have disabled all interrupts, timers in boot loader code before switching to application mode.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me in this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Kirti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2018 12:59:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746454#M45467</guid>
      <dc:creator>kirtiraje</dc:creator>
      <dc:date>2018-01-31T12:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from boot loader mode to application mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746455#M45468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kirti&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is sounds as though your interrupt are not yet operating in the application.&lt;/P&gt;&lt;P&gt;Go through the check list in the appendix of the uTasker serial loader document to verify application compatibility with boot loaders.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2018 16:40:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746455#M45468</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-01-31T16:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from boot loader mode to application mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746456#M45469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;As I told you , I am able to jump to application mode from boot loader. I have added the LED blinking code in main function without using interrupts. It is running fine but could not enable the timer interrupt. I did disable all the interrupts in boot loader mode before switching to application and enabled in application code. I am still looking into it. If you find any clue please let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one doubt about the flash configuration memory. Do I need to allocate memory for flash configuration (10 bytes) in application too. As I have already allocated that memory in boot loader.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kirti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Feb 2018 12:11:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746456#M45469</guid>
      <dc:creator>kirtiraje</dc:creator>
      <dc:date>2018-02-01T12:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from boot loader mode to application mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746457#M45470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kirti&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Flash configuration in the application is redundant - only the boot loader can determine the values in Flash at 0x400..0x40f.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Feb 2018 12:33:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746457#M45470</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-02-01T12:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from boot loader mode to application mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746458#M45471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay.. Thank you Mark..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Feb 2018 12:43:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746458#M45471</guid>
      <dc:creator>kirtiraje</dc:creator>
      <dc:date>2018-02-01T12:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from boot loader mode to application mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746459#M45472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;After a long try, finally my boot loader worked fine and it is flashing the application image properly and running the application. Now all the interrupts are also enabled in application.&amp;nbsp;&lt;/P&gt;&lt;P&gt;As my application was running without interrupt but interrupts was not getting enabled. The problem was , I did disable the cpu interruputs by calling&amp;nbsp;Cpu_DisableInt() function in boot loader code but did not enable that Cpu interrupts in application code. After adding the&amp;nbsp;Cpu_EnableInt() function in my application code my interrupts enabled.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for helping me to solve this issue..Your comments helped me to get in right direction to solve the issue.&lt;/P&gt;&lt;P&gt;I really appreciate&amp;nbsp; your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Kirti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Feb 2018 06:03:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jumping-from-boot-loader-mode-to-application-mode/m-p/746459#M45472</guid>
      <dc:creator>kirtiraje</dc:creator>
      <dc:date>2018-02-07T06:03:08Z</dc:date>
    </item>
  </channel>
</rss>

