<?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: IAP: in LPC1768</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/598185#M23144</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG class="" style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 200; font-size: 1.286rem; padding: 0px 0px 0px 30px;"&gt;&lt;SPAN class="" style="border: 0px; font-weight: inherit; font-size: 18.004px;"&gt;mahadeva,&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG class="" style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 200; font-size: 1.286rem; padding: 0px 0px 0px 30px;"&gt;&lt;SPAN class="" style="border: 0px; font-weight: inherit; font-size: 18.004px;"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG class="" style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 200; font-size: 1.286rem; padding: 0px 0px 0px 30px;"&gt;&lt;SPAN class="" style="border: 0px; font-weight: inherit; font-size: 18.004px;"&gt;I have found it necissary to write the REINVOKE ISP command before PREPARE SECTOR and ERASE SECTOR and then performing a reset before I can write to a flash location.&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG class="" style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 200; font-size: 1.286rem; padding: 0px 0px 0px 30px;"&gt;&lt;SPAN class="" style="border: 0px; font-weight: inherit; font-size: 18.004px;"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG class="" style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 200; font-size: 1.286rem; padding: 0px 0px 0px 30px;"&gt;&lt;SPAN class="" style="border: 0px; font-weight: inherit; font-size: 18.004px;"&gt;Best regards,&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG class="" style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 200; font-size: 1.286rem; padding: 0px 0px 0px 30px;"&gt;&lt;SPAN class="" style="border: 0px; font-weight: inherit; font-size: 18.004px;"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG class="" style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 200; font-size: 1.286rem; padding: 0px 0px 0px 30px;"&gt;&lt;SPAN class="" style="border: 0px; font-weight: inherit; font-size: 18.004px;"&gt;Peter&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Feb 2017 19:26:16 GMT</pubDate>
    <dc:creator>petervanhoomiss</dc:creator>
    <dc:date>2017-02-27T19:26:16Z</dc:date>
    <item>
      <title>IAP: in LPC1768</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/598179#M23138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In LPC1768, i have to types of software section.&lt;/P&gt;&lt;P&gt;1) bootloader (flash sector 0 to sector 7)&lt;/P&gt;&lt;P&gt;2) system software (flash sector 8 to 12)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i am trying to write on flash sector 0 to 7 using IAP, from system software. prepare_sector will execute properly but&lt;/P&gt;&lt;P&gt;when i am try to write to sector 0 it is giving error(status 9) stating that sector is not prepared.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(I want to flash bootloader from system software which is not able to do. please suggest me solution).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2017 13:15:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/598179#M23138</guid>
      <dc:creator>mahadevahn</dc:creator>
      <dc:date>2017-02-24T13:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: IAP: in LPC1768</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/598180#M23139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey I am currently working on a&amp;nbsp;program that uses the IAP functions and also having problems with programming sector0. Check out the thread here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/445475"&gt;IAP via JTAG on LPC1754 #3&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would seem that there is some behavior in sector0 that is&amp;nbsp;not documented, and I am also still waiting on an explanation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That said, are you making sure to erase the sector before trying to perform the write?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT&lt;/P&gt;&lt;P&gt;I got a response back from the very helpful @Carlos_Mendoza&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To program sector0 you need to follow these steps:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;1) Relocate interrupt table to RAM by writing new address to VTOR (0xE000ED04)&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;a)So copy the data in flash from 0x0-0x1F to your new RAM location. Remember that from 0x10000000-&lt;SPAN&gt;0x100001FF is used by the&amp;nbsp;IAP, so relocate it to&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;0x10000&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;200 or higher.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;2) Erase sector0 with erase sector IAP command.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;a) I found it necicary to reset the core after an erase before I could send another IAP command.&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;3) Program secotr0 with copy ram to flash command&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;a) Check that data includes 2s comp checksum at 0x1C&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;4) Restore VOTR to 0x0&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;5) Power cycle&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;/EDIT&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Best Regards,&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2017 17:41:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/598180#M23139</guid>
      <dc:creator>petervanhoomiss</dc:creator>
      <dc:date>2017-02-24T17:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: IAP: in LPC1768</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/598181#M23140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As Peter is writing, you must erase the sector before trying to perform write. Also remember to execute&amp;nbsp;the Prepare sector command before the erase command and before every write command&amp;nbsp;as these commands causes the relevant sectors to be protected again after execution&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Feb 2017 20:43:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/598181#M23140</guid>
      <dc:creator>tim99</dc:creator>
      <dc:date>2017-02-25T20:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: IAP: in LPC1768</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/598182#M23141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i am preparing sector before writing. even though it is giving same error status &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Feb 2017 05:24:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/598182#M23141</guid>
      <dc:creator>mahadevahn</dc:creator>
      <dc:date>2017-02-26T05:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: IAP: in LPC1768</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/598183#M23142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;According to the manual the prepare sector command cannot return error 9.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Feb 2017 07:52:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/598183#M23142</guid>
      <dc:creator>tim99</dc:creator>
      <dc:date>2017-02-26T07:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: IAP: in LPC1768</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/598184#M23143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;prepare sector is executing properly which returns 0. but when i am going to write that sector(which is sector-0 to sector-7)&lt;/P&gt;&lt;P&gt;it is returning 9. (SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;once again i will explain my problem&lt;/P&gt;&lt;P&gt;i am using sector-0 to sector-7 for my bootloader. when i am trying write to these sector after preparing also, it is returning 9.(SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Feb 2017 12:34:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/598184#M23143</guid>
      <dc:creator>mahadevahn</dc:creator>
      <dc:date>2017-02-26T12:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: IAP: in LPC1768</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/598185#M23144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG class="" style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 200; font-size: 1.286rem; padding: 0px 0px 0px 30px;"&gt;&lt;SPAN class="" style="border: 0px; font-weight: inherit; font-size: 18.004px;"&gt;mahadeva,&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG class="" style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 200; font-size: 1.286rem; padding: 0px 0px 0px 30px;"&gt;&lt;SPAN class="" style="border: 0px; font-weight: inherit; font-size: 18.004px;"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG class="" style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 200; font-size: 1.286rem; padding: 0px 0px 0px 30px;"&gt;&lt;SPAN class="" style="border: 0px; font-weight: inherit; font-size: 18.004px;"&gt;I have found it necissary to write the REINVOKE ISP command before PREPARE SECTOR and ERASE SECTOR and then performing a reset before I can write to a flash location.&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG class="" style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 200; font-size: 1.286rem; padding: 0px 0px 0px 30px;"&gt;&lt;SPAN class="" style="border: 0px; font-weight: inherit; font-size: 18.004px;"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG class="" style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 200; font-size: 1.286rem; padding: 0px 0px 0px 30px;"&gt;&lt;SPAN class="" style="border: 0px; font-weight: inherit; font-size: 18.004px;"&gt;Best regards,&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG class="" style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 200; font-size: 1.286rem; padding: 0px 0px 0px 30px;"&gt;&lt;SPAN class="" style="border: 0px; font-weight: inherit; font-size: 18.004px;"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG class="" style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 200; font-size: 1.286rem; padding: 0px 0px 0px 30px;"&gt;&lt;SPAN class="" style="border: 0px; font-weight: inherit; font-size: 18.004px;"&gt;Peter&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2017 19:26:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/598185#M23144</guid>
      <dc:creator>petervanhoomiss</dc:creator>
      <dc:date>2017-02-27T19:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: IAP: in LPC1768</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/598186#M23145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) My bootloader code will&amp;nbsp; occupy first 8 sector of flash.&lt;/P&gt;&lt;P&gt;when i am trying to write sector -1 to sector-7 also not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;procedure i followed after your answer&lt;/P&gt;&lt;P&gt;1) changer scb-&amp;gt;vtor to ram&lt;/P&gt;&lt;P&gt;2) copy content at 0x1c to ram&lt;/P&gt;&lt;P&gt;3) disable interrupt&lt;/P&gt;&lt;P&gt;4)reinvoke isp&lt;/P&gt;&lt;P&gt;5)prepare and erase&lt;/P&gt;&lt;P&gt;6)reset&lt;/P&gt;&lt;P&gt;7) write to sector-0 to sector-7 (returning 9)&lt;/P&gt;&lt;P&gt;8) change scb-&amp;gt;vtor to flash&lt;/P&gt;&lt;P&gt;9) enable interrupt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2017 10:53:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/598186#M23145</guid>
      <dc:creator>mahadevahn</dc:creator>
      <dc:date>2017-02-28T10:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: IAP: in LPC1768</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/598187#M23146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please refer the application note AN10866 for details, &lt;/P&gt;&lt;P&gt;cache.nxp.com/documents/application_note/AN10866.zip?fsrch=1&amp;amp;sr=1&amp;amp;pageNum=1&lt;BR /&gt;Have a great day,&lt;/P&gt;&lt;P&gt;Ping&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>Wed, 01 Mar 2017 06:56:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/598187#M23146</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2017-03-01T06:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: IAP: in LPC1768</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/1201058#M43292</link>
      <description>&lt;P&gt;Hello Peter,&lt;/P&gt;&lt;P&gt;I tried the steps but it hasn't worked for me. Do you have a piece of code that I can look up to?&lt;/P&gt;&lt;P&gt;Or, would you please have a look at my code and comment?&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#define PAGE_SIZE  (256)
#define PF1_BOOTLOADER_START_ADDR   (0x0000)

uint8_t u8tempArray[32];
uint8_t vtorOnRAM[32];

void FW_updateBootloader(void)
{
    uint32_t u32Address = 0;
    uint32_t u32Offset = 0;

    // Each sector is 4096 bytes
    // Each sector can be programmed in sequence - Prepare sector &amp;gt; Erase sector &amp;gt; Program page in the sector
    //To program sector0 you need to follow these steps:
    //1) Relocate interrupt table to RAM by writing new address to VTOR (0xE000ED04)
    //    So copy the data in flash from 0x0-0x1F to your new RAM location. 
    //    Remember that from 0x10000000-0x100001FF is used by the IAP, so relocate it to 0x10000200 or higher.
    //2) Erase sector0 with erase sector IAP command.
    //    I found it necicary to reset the core after an erase before I could send another IAP command. 
    //3) Program secotr0 with copy ram to flash command
    //a) Check that data includes 2s comp checksum at 0x1C
    //4) Restore VOTR to 0x0
    //5) Power cycle
    
    // Criterion for Valid User Code (Section 32.3.1.1, page 627 of UM10360 LPC17XX user manual
    //  The reserved Cortex-M3 exception vector location 7 (offset 0x 001C in the vector table)
    //  should contain the 2’s complement of the check-sum of table entries 0 through 6. This
    //  causes the checksum of the first 8 table entries to be 0. The boot loader code checksums
    //  the first 8 locations in sector 0 of the flash. If the result is 0, then execution control is
    //  transferred to the user code.
    
    uint32_t NumBlocks = PF1_APP_START_ADDR / PAGE_SIZE;
    for(uint32_t i = 2; i &amp;lt; NumBlocks; i++)
    {    
        /* Write flash sector */
        //write_data(CCLK, u32Address, (uint8_t*)&amp;amp;bootloaderImage[u32Offset], PAGE_SIZE);
        write_flash((uint32_t*)u32Address, (uint8_t*)&amp;amp;bootloaderImage[u32Offset], PAGE_SIZE);
        u32Address = u32Address + PAGE_SIZE;
        u32Offset = u32Offset + PAGE_SIZE;
    }

    // Step 1
    // Relocate interrupt table to RAM by writing new address to VTOR (0xE000ED04)
    // So copy the data in flash from 0x0-0x1F to your new RAM location. 
    // Remember that from 0x10000000-0x100001FF is used by the IAP, so relocate it to 0x10000200 or higher.
    
    memset(u8tempArray, 0, sizeof(u8tempArray));
    /* Read on-chip sector from internal flah to read the vtor */
    Read_Onchip_Flash((void *)PF1_VTOR_START, (uint8_t*)&amp;amp;u8tempArray, sizeof(u8tempArray));
    memcpy(vtorOnRAM, u8tempArray, sizeof(vtorOnRAM));
    
    __disable_irq();
    uint32_t vtorAddressonRAM = &amp;amp;vtorOnRAM;
    SCB-&amp;gt;VTOR = vtorAddressonRAM &amp;amp; 0x1FFFFF80;
    __enable_irq();
    
    // Step 2
    // Erase sector0 with erase sector IAP command.
    find_erase_prepare_sector(CCLK, PF1_BOOTLOADER_START_ADDR);
    // Step 3
    // Program secotr0 with copy ram to flash command
    u32Address = 0;
    u32Offset = 0;
    write_flash((uint32_t*)u32Address, (uint8_t*)&amp;amp;bootloaderImage[u32Offset], PAGE_SIZE);   
    u32Address += PAGE_SIZE;
    u32Offset += PAGE_SIZE;
    write_flash((uint32_t*)u32Address, (uint8_t*)&amp;amp;bootloaderImage[u32Offset], PAGE_SIZE);   
    u32Address += PAGE_SIZE;
    u32Offset += PAGE_SIZE;
    
    // Step 4
    // Restore VOTR to 0x0
    __disable_irq();
    SCB-&amp;gt;VTOR = 0;
    __enable_irq();
    
    NVIC_SystemReset();
}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 17 Dec 2020 08:02:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/1201058#M43292</guid>
      <dc:creator>prasad_t</dc:creator>
      <dc:date>2020-12-17T08:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: IAP: in LPC1768</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/1278766#M45053</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;Did you succeed to update the bootloader through firmware using IAP ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Ali&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 07:56:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/1278766#M45053</guid>
      <dc:creator>alirezafasih</dc:creator>
      <dc:date>2021-05-19T07:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: IAP: in LPC1768</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/1278801#M45055</link>
      <description>&lt;P&gt;Hi, yes, I managed to get it working. The code remains the same, just added more code to calculate checksum of vectors and put it at the designated address. You'll find it in the datasheet.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The sector 0 is the section of memory where boot ROM is mapped. In order to be able to access this sector, a flag in MEMMAP register needs to be set.&lt;/P&gt;&lt;P&gt;Section 33.6.1, page 655 of UM10360 LPC17XX user manual states:&lt;/P&gt;&lt;P&gt;The MEMMAP register (Address - 0x400FC040) allows switch the mapping of the bottom of memory, including default reset and interrupt vectors, between the Boot ROM and the bottom of on-chip Flash memory.&lt;BR /&gt;If bit 0 is 0 -- Boot mode. A portion of the Boot ROM is mapped to address 0.&lt;BR /&gt;If bit 0 is 1 -- User mode. The on-chip Flash memory is mapped to address 0.&lt;BR /&gt;Bit 31:1 are reserved.&lt;/P&gt;&lt;P&gt;Section 32.3.1.1, page no. 627 of UM10360 LPC17XX user manual states:&lt;/P&gt;&lt;P&gt;The&amp;nbsp;reserved&amp;nbsp;Cortex-M3&amp;nbsp;exception&amp;nbsp;vector&amp;nbsp;location&amp;nbsp;7&amp;nbsp;(offset&amp;nbsp;0x&amp;nbsp;001C&amp;nbsp;in&amp;nbsp;the&amp;nbsp;vector&amp;nbsp;table) should&amp;nbsp;contain&amp;nbsp;the&amp;nbsp;2’s&amp;nbsp;complement&amp;nbsp;of&amp;nbsp;the&amp;nbsp;check-sum&amp;nbsp;of&amp;nbsp;table&amp;nbsp;entries&amp;nbsp;0&amp;nbsp;through&amp;nbsp;6.&amp;nbsp;This causes&amp;nbsp;the&amp;nbsp;checksum&amp;nbsp;of&amp;nbsp;the&amp;nbsp;first&amp;nbsp;8&amp;nbsp;table&amp;nbsp;entries&amp;nbsp;to&amp;nbsp;be&amp;nbsp;0.&amp;nbsp;The&amp;nbsp;boot&amp;nbsp;loader&amp;nbsp;code&amp;nbsp;checksums the&amp;nbsp;first&amp;nbsp;8&amp;nbsp;locations&amp;nbsp;in&amp;nbsp;sector&amp;nbsp;0&amp;nbsp;of&amp;nbsp;the&amp;nbsp;flash.&amp;nbsp;If&amp;nbsp;the&amp;nbsp;result&amp;nbsp;is&amp;nbsp;0,&amp;nbsp;then&amp;nbsp;execution&amp;nbsp;control&amp;nbsp;is transferred&amp;nbsp;to the&amp;nbsp;user&amp;nbsp;code.&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 08:38:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/1278801#M45055</guid>
      <dc:creator>prasad_t</dc:creator>
      <dc:date>2021-05-19T08:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: IAP: in LPC1768</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/1278891#M45061</link>
      <description>&lt;P&gt;Hi, Thank you very much for your quick answer! this can help us to find a solution for this issue. we are using LPC546XX family and I think the procedure is almost the same. Have a good time!&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 10:03:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-in-LPC1768/m-p/1278891#M45061</guid>
      <dc:creator>alirezafasih</dc:creator>
      <dc:date>2021-05-19T10:03:17Z</dc:date>
    </item>
  </channel>
</rss>

