<?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: Hi all, i am using lpc4367 controller and trying to write flash programming. But i am getting Hard Fault error at iap_entry API call. I am using the same location as mentioned in user manual for entry i.e.  IAP_LOCATION  0x10400100. Kindly help me.</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Hi-all-i-am-using-lpc4367-controller-and-trying-to-write-flash/m-p/729801#M29509</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Saurav,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Please refer to NXP official LPC4367 lpcopen sample code, you can download it from this link:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/lpc-cortex-m-mcus/lpc4300-cortex-m4-m0/lpcopen-software-development-platform-lpc43xx:LPCOPEN-SOFTWARE-FOR-LPC43XX" title="https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/lpc-cortex-m-mcus/lpc4300-cortex-m4-m0/lpcopen-software-development-platform-lpc43xx:LPCOPEN-SOFTWARE-FOR-LPC43XX"&gt;LPCOpen Software for LPC43XX|NXP&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; There has a project named as flashiap is the flash IAP project.&lt;/P&gt;&lt;P&gt;&amp;nbsp; You can open folder:lpcopen_3_02_keil_iar_xpresso4337\LPC43xx_18xx\prj_xpresso4337\iar, periph_examples.eww.&lt;/P&gt;&lt;P&gt;&amp;nbsp; The IAP address should defined like this:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* Pointer to ROM API function address */&lt;BR /&gt;#define LPC_ROM_API_BASE_LOC&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x10400100&lt;BR /&gt;#define LPC_ROM_API ((LPC_ROM_API_T *) LPC_ROM_API_BASE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Pointer to ROM IAP entry functions */&lt;BR /&gt;#define IAP_ENTRY_LOCATION&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (*((uint32_t *) 0x10400100))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&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>Sun, 11 Feb 2018 06:04:01 GMT</pubDate>
    <dc:creator>kerryzhou</dc:creator>
    <dc:date>2018-02-11T06:04:01Z</dc:date>
    <item>
      <title>Hi all, i am using lpc4367 controller and trying to write flash programming. But i am getting Hard Fault error at iap_entry API call. I am using the same location as mentioned in user manual for entry i.e.  IAP_LOCATION  0x10400100. Kindly help me.</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Hi-all-i-am-using-lpc4367-controller-and-trying-to-write-flash/m-p/729800#M29508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is the code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;BR /&gt;#define IAP_LOCATION 0x10400100&lt;/P&gt;&lt;P&gt;typedef void (*IAP)(unsigned int[5], unsigned int[4]);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;unsigned int command_param[5];&lt;BR /&gt;unsigned int status_result[4];&lt;/P&gt;&lt;P&gt;IAP iap_myentry=(IAP)0x10400100;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* Initializes the IAP command interface */&lt;BR /&gt;uint8_t Chip_IAP_Init(void)&lt;BR /&gt;{&lt;BR /&gt; uint32_t command[5], result[4];&lt;/P&gt;&lt;P&gt;command[0] = 49; /* IAP_INIT */&lt;BR /&gt; result[0] = IAP_CMD_SUCCESS;&lt;BR /&gt; delaymS(10);&lt;BR /&gt; iap_myentry(command, result);&lt;BR /&gt; return result[0];&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* Prepare sector for write operation */&lt;BR /&gt;uint8_t Chip_IAP_PreSectorForReadWrite(uint32_t strSector, uint32_t endSector, uint8_t flashBank)&lt;BR /&gt;{&lt;BR /&gt; uint32_t command[5], result[4];&lt;/P&gt;&lt;P&gt;command[0] = IAP_PREWRRITE_CMD;&lt;BR /&gt; command[1] = strSector;&lt;BR /&gt; command[2] = endSector;&lt;BR /&gt; command[3] = flashBank;&lt;BR /&gt; iap_myentry(command, result);&lt;/P&gt;&lt;P&gt;return result[0];&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* Copy RAM to flash */&lt;BR /&gt;uint8_t Chip_IAP_CopyRamToFlash(uint32_t dstAdd, uint32_t *srcAdd, uint32_t byteswrt)&lt;BR /&gt;{&lt;BR /&gt; uint32_t command[5], result[4];&lt;/P&gt;&lt;P&gt;command[0] = IAP_WRISECTOR_CMD;&lt;BR /&gt; command[1] = dstAdd;&lt;BR /&gt; command[2] = (uint32_t) srcAdd;&lt;BR /&gt; command[3] = byteswrt;&lt;BR /&gt; command[4] = SystemCoreClock / 1000;&lt;BR /&gt; iap_myentry(command, result);&lt;/P&gt;&lt;P&gt;return result[0];&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* Erase sector */&lt;BR /&gt;uint8_t Chip_IAP_EraseSector(uint32_t strSector, uint32_t endSector, uint8_t flashBank)&lt;BR /&gt;{&lt;BR /&gt; uint32_t command[5], result[4];&lt;/P&gt;&lt;P&gt;command[0] = IAP_ERSSECTOR_CMD;&lt;BR /&gt; command[1] = strSector;&lt;BR /&gt; command[2] = endSector;&lt;BR /&gt; command[3] = SystemCoreClock / 1000;&lt;BR /&gt; command[4] = flashBank;&lt;BR /&gt; iap_myentry(command, result);&lt;/P&gt;&lt;P&gt;return result[0];&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* Blank check sector */&lt;BR /&gt;uint8_t Chip_IAP_BlankCheckSector(uint32_t strSector, uint32_t endSector, uint8_t flashBank)&lt;BR /&gt;{&lt;BR /&gt; uint32_t command[5], result[4];&lt;/P&gt;&lt;P&gt;command[0] = IAP_BLANK_CHECK_SECTOR_CMD;&lt;BR /&gt; command[1] = strSector;&lt;BR /&gt; command[2] = endSector;&lt;BR /&gt; command[3] = flashBank;&lt;BR /&gt; iap_myentry(command, result);&lt;/P&gt;&lt;P&gt;return result[0];&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* Read part identification number */&lt;BR /&gt;uint32_t Chip_IAP_ReadPID()&lt;BR /&gt;{&lt;BR /&gt; uint32_t command[5], result[4];&lt;/P&gt;&lt;P&gt;command[0] = IAP_REPID_CMD;&lt;BR /&gt; iap_myentry(command, result);&lt;/P&gt;&lt;P&gt;return result[1];&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* Read boot code version number */&lt;BR /&gt;uint8_t Chip_IAP_ReadBootCode()&lt;BR /&gt;{&lt;BR /&gt; uint32_t command[5], result[4];&lt;/P&gt;&lt;P&gt;command[0] = IAP_READ_BOOT_CODE_CMD;&lt;BR /&gt; iap_myentry(command, result);&lt;/P&gt;&lt;P&gt;return result[0];&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* IAP compare */&lt;BR /&gt;uint8_t Chip_IAP_Compare(uint32_t dstAdd, uint32_t srcAdd, uint32_t bytescmp)&lt;BR /&gt;{&lt;BR /&gt; uint32_t command[5], result[4];&lt;/P&gt;&lt;P&gt;command[0] = IAP_COMPARE_CMD;&lt;BR /&gt; command[1] = dstAdd;&lt;BR /&gt; command[2] = srcAdd;&lt;BR /&gt; command[3] = bytescmp;&lt;BR /&gt; iap_myentry(command, result);&lt;/P&gt;&lt;P&gt;return result[0];&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* Reinvoke ISP */&lt;BR /&gt;uint8_t Chip_IAP_ReinvokeISP()&lt;BR /&gt;{&lt;BR /&gt; uint32_t command[5], result[4];&lt;/P&gt;&lt;P&gt;command[0] = IAP_REINVOKE_ISP_CMD;&lt;BR /&gt; iap_myentry(command, result);&lt;/P&gt;&lt;P&gt;return result[0];&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* Read the unique ID */&lt;BR /&gt;uint32_t Chip_IAP_ReadUID(uint32_t uid[])&lt;BR /&gt;{&lt;BR /&gt; uint32_t command[5], result[5], i;&lt;/P&gt;&lt;P&gt;command[0] = IAP_READ_UID_CMD;&lt;BR /&gt; iap_myentry(command, result);&lt;BR /&gt; for(i = 0; i &amp;lt; 4; i++) {&lt;BR /&gt; uid[i] = result[i + 1];&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;return result[0];&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* Erase page */&lt;BR /&gt;uint8_t Chip_IAP_ErasePage(uint32_t strPage, uint32_t endPage)&lt;BR /&gt;{&lt;BR /&gt; uint32_t command[5], result[4];&lt;/P&gt;&lt;P&gt;command[0] = IAP_ERASE_PAGE_CMD;&lt;BR /&gt; command[1] = strPage;&lt;BR /&gt; command[2] = endPage;&lt;BR /&gt; command[3] = SystemCoreClock / 1000;&lt;BR /&gt; iap_myentry(command, result);&lt;/P&gt;&lt;P&gt;return result[0];&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* Set active boot flash bank */&lt;BR /&gt;uint8_t Chip_IAP_SetBootFlashBank(uint8_t bankNum)&lt;BR /&gt;{&lt;BR /&gt; uint32_t command[5], result[4];&lt;/P&gt;&lt;P&gt;command[0] = IAP_SET_BOOT_FLASH;&lt;BR /&gt; command[1] = bankNum;&lt;BR /&gt; command[2] = SystemCoreClock / 1000;&lt;BR /&gt; iap_myentry(command, result);&lt;/P&gt;&lt;P&gt;return result[0];&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When ever i call API(lets say -&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;Chip_IAP_Init())&lt;/SPAN&gt; &amp;nbsp;from main, it gives error at&amp;nbsp;&lt;SPAN&gt;iap_myentry(command, result) as hard fault error.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How to get rid from this.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Feb 2018 15:04:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Hi-all-i-am-using-lpc4367-controller-and-trying-to-write-flash/m-p/729800#M29508</guid>
      <dc:creator>sauravsinha</dc:creator>
      <dc:date>2018-02-08T15:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Hi all, i am using lpc4367 controller and trying to write flash programming. But i am getting Hard Fault error at iap_entry API call. I am using the same location as mentioned in user manual for entry i.e.  IAP_LOCATION  0x10400100. Kindly help me.</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Hi-all-i-am-using-lpc4367-controller-and-trying-to-write-flash/m-p/729801#M29509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Saurav,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Please refer to NXP official LPC4367 lpcopen sample code, you can download it from this link:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/lpc-cortex-m-mcus/lpc4300-cortex-m4-m0/lpcopen-software-development-platform-lpc43xx:LPCOPEN-SOFTWARE-FOR-LPC43XX" title="https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/lpc-cortex-m-mcus/lpc4300-cortex-m4-m0/lpcopen-software-development-platform-lpc43xx:LPCOPEN-SOFTWARE-FOR-LPC43XX"&gt;LPCOpen Software for LPC43XX|NXP&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; There has a project named as flashiap is the flash IAP project.&lt;/P&gt;&lt;P&gt;&amp;nbsp; You can open folder:lpcopen_3_02_keil_iar_xpresso4337\LPC43xx_18xx\prj_xpresso4337\iar, periph_examples.eww.&lt;/P&gt;&lt;P&gt;&amp;nbsp; The IAP address should defined like this:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* Pointer to ROM API function address */&lt;BR /&gt;#define LPC_ROM_API_BASE_LOC&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x10400100&lt;BR /&gt;#define LPC_ROM_API ((LPC_ROM_API_T *) LPC_ROM_API_BASE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Pointer to ROM IAP entry functions */&lt;BR /&gt;#define IAP_ENTRY_LOCATION&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (*((uint32_t *) 0x10400100))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&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>Sun, 11 Feb 2018 06:04:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Hi-all-i-am-using-lpc4367-controller-and-trying-to-write-flash/m-p/729801#M29509</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-02-11T06:04:01Z</dc:date>
    </item>
  </channel>
</rss>

