<?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: Bootloader in bank A: Self-Update - anything special? (LPC4357) in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Bootloader-in-bank-A-Self-Update-anything-special-LPC4357/m-p/585598#M21287</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by michele sponchiado on Fri Jan 15 03:12:22 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,this is the sequence which works for me:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[list]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]call the Chip_IAP_Init() routine&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]to program the flash I followed this sequence&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[list=1]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]loop for every flash sector involved&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]disable the IRQs!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]call the Chip_IAP_PreSectorForReadWrite, check for errors in the return code&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]call the Chip_IAP_Chip_IAP_EraseSector, check for errors in the return code&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]loop into the current sector: for every 512 bytes (I think it works also with other bytes size, e.g. 1024, but never tried), I call the Chip_IAP_PreSectorForReadWrite then the Chip_IAP_CopyRamToFlash using a buffer in the internal RAM (I dunno if it works also using external SDRAM), always checking the return code&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]enable the IRQs!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]loop next flash sector&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/list]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]if I need to call the Chip_IAP_SetBootFlashBank, but this is really needed if the boot bank has been changed, I call again the&amp;nbsp; Chip_IAP_Init, but I really don't know if it is needed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/list]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:10:13 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:10:13Z</dc:date>
    <item>
      <title>Bootloader in bank A: Self-Update - anything special? (LPC4357)</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Bootloader-in-bank-A-Self-Update-anything-special-LPC4357/m-p/585597#M21286</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 Wed Dec 02 15:15:43 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a bootloader which is stored in bank A. The bootloader shall be able to update itself.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I collect my new bootloader in RAM. When everything is transmitted to RAM&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and verified to be correct by a checksum, I replace the existing bootloader.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Theoretically it seems to be working, I get no errors when using IAP commands.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Addressses where I store the bootloader and which I take data from RAM, used length paramers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;seem to be correct.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nevertheless it seems (at least part of it) is the old bootloader???&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there something special to pay attention? Perhaps are some flash areas remapped during start-up,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;which I must un-remap first or put the sector to the mapped address?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think to remember that such a thing was used in old LPC176x (or was it even earlier with LPC21xx?),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;where vector table was replaced (or replaceable) by RAM...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or is there perhaps some example of a bootloader which can replace itself?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BTW: Is it correct to call "activate flash bank" (of bank A) every time or is it only needed once,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;when bootloader is installed the first time?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks!&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;Martin&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:10:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Bootloader-in-bank-A-Self-Update-anything-special-LPC4357/m-p/585597#M21286</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Bootloader in bank A: Self-Update - anything special? (LPC4357)</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Bootloader-in-bank-A-Self-Update-anything-special-LPC4357/m-p/585598#M21287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by michele sponchiado on Fri Jan 15 03:12:22 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,this is the sequence which works for me:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[list]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]call the Chip_IAP_Init() routine&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]to program the flash I followed this sequence&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[list=1]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]loop for every flash sector involved&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]disable the IRQs!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]call the Chip_IAP_PreSectorForReadWrite, check for errors in the return code&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]call the Chip_IAP_Chip_IAP_EraseSector, check for errors in the return code&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]loop into the current sector: for every 512 bytes (I think it works also with other bytes size, e.g. 1024, but never tried), I call the Chip_IAP_PreSectorForReadWrite then the Chip_IAP_CopyRamToFlash using a buffer in the internal RAM (I dunno if it works also using external SDRAM), always checking the return code&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]enable the IRQs!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]loop next flash sector&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/list]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]if I need to call the Chip_IAP_SetBootFlashBank, but this is really needed if the boot bank has been changed, I call again the&amp;nbsp; Chip_IAP_Init, but I really don't know if it is needed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/list]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:10:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Bootloader-in-bank-A-Self-Update-anything-special-LPC4357/m-p/585598#M21287</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:10:13Z</dc:date>
    </item>
  </channel>
</rss>

