<?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>LPC MicrocontrollersのトピックRe: Secondary bootloader error</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Secondary-bootloader-error/m-p/558383#M15591</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by whitecoe on Fri Sep 04 01:02:16 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: michaelleekun&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; __set_MSP(SCB-&amp;gt;VTOR);//load stackpointer with initial value&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Well that certain looks broken to me. You want something 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;__set_MSP((uint32_t *)SBL_SLV_FIRMWARE_START);&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i.e. the contents of the first address of the image, not the address itself.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;HTH!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:57:28 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:57:28Z</dc:date>
    <item>
      <title>Secondary bootloader error</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Secondary-bootloader-error/m-p/558382#M15590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by michaelleekun on Thu Sep 03 13:51:06 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using a LPCXpresso54102 board (cortex M4 only now) and I am trying to upgrade the user application with the secondary bootloader. It will copy the new binary to the "Sector 1 (0x00008000)" which was downloaded by the old user application to the other sector of flash area.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Seconday bootloader runs at Sector 0 (0x00000000)&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;
#include "board.h"

typedef void (*USER_ENTRY_PFN)();
#define SBL_SLV_FIRMWARE_START(0x8000)

int main(void)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; USER_ENTRY_PFN user_entry;
&amp;nbsp;&amp;nbsp;&amp;nbsp; user_entry = (USER_ENTRY_PFN)*((uint32_t*)(SBL_SLV_FIRMWARE_START +4));

&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Generic Initialization */
&amp;nbsp;&amp;nbsp;&amp;nbsp; Board_Init(); 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Board_LED_Set(0, TRUE);

&amp;nbsp;&amp;nbsp;&amp;nbsp; __disable_irq(); 
&amp;nbsp;&amp;nbsp; SCB-&amp;gt;VTOR = SBL_SLV_FIRMWARE_START;
&amp;nbsp;&amp;nbsp;&amp;nbsp; __enable_irq();

&amp;nbsp;&amp;nbsp;&amp;nbsp; __set_MSP(SCB-&amp;gt;VTOR);//load stackpointer with initial value
&amp;nbsp;&amp;nbsp;&amp;nbsp; (user_entry)(); 

&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Loop forever */
while (1) {
__WFI();}

&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have compiled (using LPCXpresso) the user application changing the start address to 0x8000. This one is working fine with the "AN11610: LPC5410x I2C SPI Secondary Bootloader" which means it should work if my Secondary Bootloader (above codes) is fine.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But if I run the Secondary Bootloader code, this one does not jump to the user application. The "user_entry" is set to "0x81FD" and the debugger stops working. I am not sure but I am missing something here. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:57:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Secondary-bootloader-error/m-p/558382#M15590</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Secondary bootloader error</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Secondary-bootloader-error/m-p/558383#M15591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by whitecoe on Fri Sep 04 01:02:16 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: michaelleekun&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; __set_MSP(SCB-&amp;gt;VTOR);//load stackpointer with initial value&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Well that certain looks broken to me. You want something 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;__set_MSP((uint32_t *)SBL_SLV_FIRMWARE_START);&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i.e. the contents of the first address of the image, not the address itself.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;HTH!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:57:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Secondary-bootloader-error/m-p/558383#M15591</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Secondary bootloader error</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Secondary-bootloader-error/m-p/558384#M15592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by frankeggink on Fri Apr 22 07:32:07 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This should work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Bootloader is located at location 0x0 in memory.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Application is located at location 0x8000 (sector 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/*--------------------------------------------------------------------------------*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;/* bootloader config */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;typedef void (*USER_ENTRY_PFN)();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#define SBL_SLV_FIRMWARE_START(0x8000)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;USER_ENTRY_PFN user_entry;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* Call bootloader */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;__disable_irq(); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SCB-&amp;gt;VTOR = SBL_SLV_FIRMWARE_START;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;__enable_irq();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//__set_MSP(SCB-&amp;gt;VTOR);//load stackpointer with initial value&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;__set_MSP(*(uint32_t *)SBL_SLV_FIRMWARE_START);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(user_entry)(); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;/*--------------------------------------------------------------------------------*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Frank Eggink&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:57:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Secondary-bootloader-error/m-p/558384#M15592</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Secondary bootloader error</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Secondary-bootloader-error/m-p/558385#M15593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by mysepp on Fri Apr 22 07:46:58 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Question aside: Why __enable_irq() before jump? I think it is correct, but why does it not work without it? What happens then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;or different to the way, when IRQs are enabled?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Application is (I assume) installing its own interrupts handlers and also enables them when everything is setup and it is needed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Second question: Shall app then disable interrupts as one of it first steps?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:57:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Secondary-bootloader-error/m-p/558385#M15593</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Secondary bootloader error</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Secondary-bootloader-error/m-p/558386#M15594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by cptnproton on Thu May 26 09:18:32 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you! Thank you! Thank you! Thank you! :) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been struggling with getting a secondary bootloader for an LPC1769 working for almost a week, using AN10866 as the basis, and looking at every thread I could find on secondary bootloaders for a cortex M3. The bootloader would correctly jump to the application, but none of the interrupt routines in the main app would work. Adding the "__enable_irq()" line in the bootloader made the main application's interrupt handlers work. As msepp asks, I have no idea why this should be necessary. It's not in any of the samples I've encountered.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:57:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Secondary-bootloader-error/m-p/558386#M15594</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Secondary bootloader error</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Secondary-bootloader-error/m-p/558387#M15595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;bump&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 22:11:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Secondary-bootloader-error/m-p/558387#M15595</guid>
      <dc:creator>jpadilla</dc:creator>
      <dc:date>2016-06-16T22:11:15Z</dc:date>
    </item>
  </channel>
</rss>

