<?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中的主题 Writing to Flash on a PN7462</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-to-Flash-on-a-PN7462/m-p/851749#M33847</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use the PN7462 API to read and write from flash memory. I am not sure of the syntax. Has anyone got any examples of this working? My effort is below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PH_USER_ASSERT(phhalFlash_Init(false, true) == PH_ERR_SUCCESS);&lt;BR /&gt; uint8_t WriteBuffer[4] = {0x02, 0x03, 0x04, 0x05};&lt;BR /&gt; uint8_t ReadBuffer[4] = {0x00, 0x00, 0x00, 0x00};&lt;BR /&gt; uint8_t *WriteAddress = PHHAL_FLASH_USER_PAGE_START;&amp;nbsp;&lt;BR /&gt;uint8_t *ReadAddress = PHHAL_FLASH_USER_START_ADDRESS;&lt;BR /&gt; phStatus_t FlashErrorStatus;&lt;BR /&gt; uint32_t WordLength = 4;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; printf("Flash Start Address = %d\n", WriteAddress);&lt;BR /&gt; printf("Flash Read Address = %d\n", ReadAddress);&lt;BR /&gt; printf("Read = %04x %04x %04x %04x\n", ReadBuffer[0], ReadBuffer[1], ReadBuffer[2], ReadBuffer[3]);&lt;BR /&gt; FlashErrorStatus = phhalFlash_WritePage(WriteAddress, WriteBuffer);&lt;BR /&gt; FlashErrorStatus = phhalFlash_ReadBuffer(ReadBuffer, ReadAddress, WordLength);&lt;BR /&gt; printf("Write = %04x %04x %04x %04x\n", WriteBuffer[0], WriteBuffer[1], WriteBuffer[2], WriteBuffer[3]);&lt;BR /&gt; printf("Read = %04x %04x %04x %04x\n", ReadBuffer[0], ReadBuffer[1], ReadBuffer[2], ReadBuffer[3]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I run this it will, I think, overwrite part of my program that is located elsewhere on the Flash leaving the board unrecoverable. However, I am not sure that is what is happening.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 09 Feb 2019 10:50:25 GMT</pubDate>
    <dc:creator>rich3</dc:creator>
    <dc:date>2019-02-09T10:50:25Z</dc:date>
    <item>
      <title>Writing to Flash on a PN7462</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-to-Flash-on-a-PN7462/m-p/851749#M33847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use the PN7462 API to read and write from flash memory. I am not sure of the syntax. Has anyone got any examples of this working? My effort is below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PH_USER_ASSERT(phhalFlash_Init(false, true) == PH_ERR_SUCCESS);&lt;BR /&gt; uint8_t WriteBuffer[4] = {0x02, 0x03, 0x04, 0x05};&lt;BR /&gt; uint8_t ReadBuffer[4] = {0x00, 0x00, 0x00, 0x00};&lt;BR /&gt; uint8_t *WriteAddress = PHHAL_FLASH_USER_PAGE_START;&amp;nbsp;&lt;BR /&gt;uint8_t *ReadAddress = PHHAL_FLASH_USER_START_ADDRESS;&lt;BR /&gt; phStatus_t FlashErrorStatus;&lt;BR /&gt; uint32_t WordLength = 4;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; printf("Flash Start Address = %d\n", WriteAddress);&lt;BR /&gt; printf("Flash Read Address = %d\n", ReadAddress);&lt;BR /&gt; printf("Read = %04x %04x %04x %04x\n", ReadBuffer[0], ReadBuffer[1], ReadBuffer[2], ReadBuffer[3]);&lt;BR /&gt; FlashErrorStatus = phhalFlash_WritePage(WriteAddress, WriteBuffer);&lt;BR /&gt; FlashErrorStatus = phhalFlash_ReadBuffer(ReadBuffer, ReadAddress, WordLength);&lt;BR /&gt; printf("Write = %04x %04x %04x %04x\n", WriteBuffer[0], WriteBuffer[1], WriteBuffer[2], WriteBuffer[3]);&lt;BR /&gt; printf("Read = %04x %04x %04x %04x\n", ReadBuffer[0], ReadBuffer[1], ReadBuffer[2], ReadBuffer[3]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I run this it will, I think, overwrite part of my program that is located elsewhere on the Flash leaving the board unrecoverable. However, I am not sure that is what is happening.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Feb 2019 10:50:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-to-Flash-on-a-PN7462/m-p/851749#M33847</guid>
      <dc:creator>rich3</dc:creator>
      <dc:date>2019-02-09T10:50:25Z</dc:date>
    </item>
  </channel>
</rss>

