<?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: IAP commands Copy to Flash in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-commands-Copy-to-Flash/m-p/559636#M15886</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by OldisGold on Wed Nov 25 16:30:23 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi xianghuiwang&amp;nbsp;&amp;nbsp; Thanks for your help&amp;nbsp; :)&amp;nbsp;&amp;nbsp; I got the sbl working somehow.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:57:58 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:57:58Z</dc:date>
    <item>
      <title>IAP commands Copy to Flash</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-commands-Copy-to-Flash/m-p/559630#M15880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by OldisGold on Fri Oct 02 11:42:27 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Board: LPC54102 Sensor processing&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IDE: LPC Xpresso v 7.7.2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am working on building a secondary bootloader and using IAP commands to copy a binary(application firmware) to the flash. However the Copy RAM to Flash doesn't work for me. I am using the&amp;nbsp; function Chip_IAP_CopyRamToFlash from iap.c passing arguments as follows&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Chip_IAP_CopyRamToFlash(START_WRITE_ADDR, src_iap_array_data01, IAP_NUM_BYTES_TO_WRITE);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Start_write_address is 0x00018000&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;src_iap_array_data01 is the array containing the data from the binary(application firmware)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IAP_NUM_BYTES_TO_WRITE is 4096&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have prepared the sector for erase/write prior to calling the Chip_IAP_CopyRamToFlash.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;OldidGold&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:57:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-commands-Copy-to-Flash/m-p/559630#M15880</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: IAP commands Copy to Flash</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-commands-Copy-to-Flash/m-p/559631#M15881</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 Fri Oct 02 12:03:00 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: OldisGold&lt;/STRONG&gt;&lt;BR /&gt;I am using the&amp;nbsp; function Chip_IAP_CopyRamToFlash...&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And what is the function returning&amp;nbsp; :quest:&amp;nbsp; :~&amp;nbsp; :quest: &lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:57:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-commands-Copy-to-Flash/m-p/559631#M15881</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: IAP commands Copy to Flash</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-commands-Copy-to-Flash/m-p/559632#M15882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by OldisGold on Fri Oct 02 13:42:26 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Both functions &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chip_IAP_PreSectorForReadWrite() and Chip_IAP_CopyRamToFlash()&amp;nbsp; returns 0 (IAP_CMD_SUCCESS)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am also checking Chip_IAP_BlankCheckSector after the above functions and it returns CMD_SUCCESS showing the sector to be empty. &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:57:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-commands-Copy-to-Flash/m-p/559632#M15882</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: IAP commands Copy to Flash</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-commands-Copy-to-Flash/m-p/559633#M15883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by OldisGold on Fri Oct 02 16:56:26 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the code in main.c&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t *p;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;uint8_t ret_code;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#define START_WRITE_ADDR&amp;nbsp; 0x00018000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Board_LED_Set(1, TRUE);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;__disable_irq();// Start by disabling interrupts, before changing interrupt vectors&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//Chip_Clock_SetMainClockSource(SYSCTL_MAINCLKSRC_IRC); //switch to IRC&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//Check Firmware Version&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if(*new_firmware_version &amp;gt; *current_firmware_version)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//******************************Copy Extracted download firmware to location 0x18000*******************************************************//&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;/* IAP Flash programming */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Prepare to write/erase the last sector&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ret_code = Chip_IAP_PreSectorForReadWrite(3, 3);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if (ret_code != IAP_CMD_SUCCESS) { DEBUGSTR("Command failed to execute PrepareSectorForReadWrite.&amp;nbsp; \r\n");} // Error checking&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//Erase sector for Write&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ret_code = Chip_IAP_EraseSector(3,3);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if (ret_code != IAP_CMD_SUCCESS) { DEBUGSTR("Command failed to execute. EraseSector&amp;nbsp; \r\n");}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// Write to the last sector&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Prepare to write/erase the last sector&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ret_code = Chip_IAP_PreSectorForReadWrite(3, 3);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if (ret_code != IAP_CMD_SUCCESS) { DEBUGSTR("Command failed to execute PrepareSectorForReadWrite.&amp;nbsp; \r\n");} // Error checking&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ret_code = Chip_IAP_CopyRamToFlash(START_WRITE_ADDR, src_iap_array_data00, 4096);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if (ret_code != IAP_CMD_SUCCESS) { DEBUGSTR("Command failed to execute array00.&amp;nbsp; \r\n");}// Error checking&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DEBUGSTR("Flash array00\r\n");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;START_WRITE_ADDR = START_WRITE_ADDR+0x1000;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ret_code = Chip_IAP_PreSectorForReadWrite(3, 3);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if (ret_code != IAP_CMD_SUCCESS) { DEBUGSTR("Command failed to execute.PrepareSectorForReadWrite&amp;nbsp; \r\n");}&amp;nbsp; //Error checking&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ret_code = Chip_IAP_CopyRamToFlash(START_WRITE_ADDR, src_iap_array_data01, 4096);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if (ret_code != IAP_CMD_SUCCESS) { DEBUGSTR("Command failed to execute array01.&amp;nbsp; \r\n");}// Error checking&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DEBUGSTR("Flash array01\r\n");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//*current_firmware_version = *new_firmware_version; //Set the Current Firmware Version to the new firmware after copying&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/*******************To Check State of Sector 3**************************/&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ret_code = Chip_IAP_BlankCheckSector(3,3);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if(ret_code == IAP_SECTOR_NOT_BLANK) {DEBUGSTR("Sector 3 Not Blank");}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;/*************************************************************************/&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;DEBUGSTR("To test the SBL Code\n");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;/* Set vector table offset*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SCB-&amp;gt;VTOR = user_start_sector_address;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;p = (uint32_t *)user_start_sector_address;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Board_LED_Set(1, FALSE);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;__enable_irq();//Enable interrupts before jumping to application&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/*Set stack pointer to given address*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;__set_MSP(*p);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/*Set address for RESET*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;p++;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;user_code_entry = (void (*)(void))(*p);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/*Jump to application*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;user_code_entry();&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:57:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-commands-Copy-to-Flash/m-p/559633#M15883</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: IAP commands Copy to Flash</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-commands-Copy-to-Flash/m-p/559634#M15884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by OldisGold on Mon Oct 05 14:34:46 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Any Pointers as to why the above code fails ? Any help is very much appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried running my application binary on top of the SBL hex provided by NXP (AN11610.zip) and it works fine. Can anybody give me the source code for that&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;OldisGold. &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:57:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-commands-Copy-to-Flash/m-p/559634#M15884</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: IAP commands Copy to Flash</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-commands-Copy-to-Flash/m-p/559635#M15885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by xianghuiwang on Fri Nov 20 15:59:49 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There is sample project periph_flashiap in the LPCOpen package. You can bring up the sample project and then compare the execution with your project to tell what's missing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.lpcware.com%2Fcontent%2Fnxpfile%2Flpcopen-software-development-platform-lpc5410x-packages" rel="nofollow" target="_blank"&gt;https://www.lpcware.com/content/nxpfile/lpcopen-software-development-platform-lpc5410x-packages&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For the source code of the boot loader, it may take a bit time to prepare for you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:57:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-commands-Copy-to-Flash/m-p/559635#M15885</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: IAP commands Copy to Flash</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-commands-Copy-to-Flash/m-p/559636#M15886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by OldisGold on Wed Nov 25 16:30:23 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi xianghuiwang&amp;nbsp;&amp;nbsp; Thanks for your help&amp;nbsp; :)&amp;nbsp;&amp;nbsp; I got the sbl working somehow.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:57:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-commands-Copy-to-Flash/m-p/559636#M15886</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: IAP commands Copy to Flash</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-commands-Copy-to-Flash/m-p/559637#M15887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good. In the same way you come here for help, if you share your findings and solutions you can help other people, that's the point of a forum.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2017 09:30:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-commands-Copy-to-Flash/m-p/559637#M15887</guid>
      <dc:creator>juanabelaira</dc:creator>
      <dc:date>2017-07-19T09:30:04Z</dc:date>
    </item>
  </channel>
</rss>

