<?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のトピックIAP function to write into flash returns always 2</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-function-to-write-into-flash-returns-always-2/m-p/677138#M27228</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to write some data into a specific, not used by code, area of flash.&lt;/P&gt;&lt;P&gt;I'm using the functions included in the LpcOpen library v2.20, &amp;nbsp;Chip_IAP_PreSectorForReadWrite,&amp;nbsp;Chip_IAP_EraseSector and&amp;nbsp;Chip_IAP_CopyRamToFlash.&lt;/P&gt;&lt;P&gt;I can prepare and erase sectors, but when copying data into flash it always returns 2 and data is not written (checked that)&lt;/P&gt;&lt;P&gt;Yes, I have interrupts disabled&lt;/P&gt;&lt;P&gt;I'm working on LPC 1519&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The offending line is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while( 0 != Chip_IAP_CopyRamToFlash((uint32_t)0x00020000, (uint32_t *)UpBuffer, 0x400) );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And UpBuffer is (for test purposes) defined and set up as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static uint8_t UpBuffer[1024];&lt;/P&gt;&lt;P&gt;for(j=0; j&amp;lt;0x400; j++) UpBuffer[j] = (uint8_t)j;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Jul 2017 10:40:09 GMT</pubDate>
    <dc:creator>juanabelaira</dc:creator>
    <dc:date>2017-07-20T10:40:09Z</dc:date>
    <item>
      <title>IAP function to write into flash returns always 2</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-function-to-write-into-flash-returns-always-2/m-p/677138#M27228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to write some data into a specific, not used by code, area of flash.&lt;/P&gt;&lt;P&gt;I'm using the functions included in the LpcOpen library v2.20, &amp;nbsp;Chip_IAP_PreSectorForReadWrite,&amp;nbsp;Chip_IAP_EraseSector and&amp;nbsp;Chip_IAP_CopyRamToFlash.&lt;/P&gt;&lt;P&gt;I can prepare and erase sectors, but when copying data into flash it always returns 2 and data is not written (checked that)&lt;/P&gt;&lt;P&gt;Yes, I have interrupts disabled&lt;/P&gt;&lt;P&gt;I'm working on LPC 1519&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The offending line is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while( 0 != Chip_IAP_CopyRamToFlash((uint32_t)0x00020000, (uint32_t *)UpBuffer, 0x400) );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And UpBuffer is (for test purposes) defined and set up as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static uint8_t UpBuffer[1024];&lt;/P&gt;&lt;P&gt;for(j=0; j&amp;lt;0x400; j++) UpBuffer[j] = (uint8_t)j;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jul 2017 10:40:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-function-to-write-into-flash-returns-always-2/m-p/677138#M27228</guid>
      <dc:creator>juanabelaira</dc:creator>
      <dc:date>2017-07-20T10:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: IAP function to write into flash returns always 'busy'</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-function-to-write-into-flash-returns-always-2/m-p/677139#M27229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved... The return code was '2'. I read somewhere that this means busy but it's 'Source Address not in word boundary'&lt;/P&gt;&lt;P&gt;My source address was, unfortunately, an int8 array re-cast as int32.&lt;/P&gt;&lt;P&gt;After using a proper int32 array, everything is fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jul 2017 12:52:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/IAP-function-to-write-into-flash-returns-always-2/m-p/677139#M27229</guid>
      <dc:creator>juanabelaira</dc:creator>
      <dc:date>2017-07-20T12:52:17Z</dc:date>
    </item>
  </channel>
</rss>

