<?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中的主题 LPC FLASH CLOCK</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC-FLASH-CLOCK/m-p/737451#M29780</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;my device is lpc54102,system clock is 100M,FLASHTIM is 0x05,I use flash IAP like this :FLASHIAP_ErasePage(start_addr &amp;gt;&amp;gt; 8, end_addr &amp;gt;&amp;gt; 8, 24000000u);fast than FLASHIAP_ErasePage(start_addr &amp;gt;&amp;gt; 8, end_addr &amp;gt;&amp;gt; 8, SystemCoreClock); SystemCoreClock is 100M;Why is this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 May 2018 10:30:22 GMT</pubDate>
    <dc:creator>liujs1</dc:creator>
    <dc:date>2018-05-09T10:30:22Z</dc:date>
    <item>
      <title>LPC FLASH CLOCK</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC-FLASH-CLOCK/m-p/737451#M29780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;my device is lpc54102,system clock is 100M,FLASHTIM is 0x05,I use flash IAP like this :FLASHIAP_ErasePage(start_addr &amp;gt;&amp;gt; 8, end_addr &amp;gt;&amp;gt; 8, 24000000u);fast than FLASHIAP_ErasePage(start_addr &amp;gt;&amp;gt; 8, end_addr &amp;gt;&amp;gt; 8, SystemCoreClock); SystemCoreClock is 100M;Why is this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 May 2018 10:30:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC-FLASH-CLOCK/m-p/737451#M29780</guid>
      <dc:creator>liujs1</dc:creator>
      <dc:date>2018-05-09T10:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: LPC FLASH CLOCK</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC-FLASH-CLOCK/m-p/737452#M29781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" data-content-finding="Community" data-userid="318359" data-username="liujs1" href="https://community.nxp.com/people/liujs1"&gt;liu js1&lt;/A&gt;,&lt;/P&gt;&lt;DIV style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px;"&gt;&lt;SPAN style="font-size: 16px; color: #393939; background-color: #ffffff;"&gt;Thank you for your interest in NXP Semiconductor products and&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px;"&gt;&lt;SPAN style="font-size: 16px; color: #393939; background-color: #ffffff;"&gt;the opportunity to serve you.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px;"&gt;&lt;SPAN style="font-size: 16px; color: #393939; background-color: #ffffff;"&gt;I don't think the format of Param2 is correct, please try again.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="white-space: pre-wrap; text-align: left; line-height: 1.75; font-size: 14px;"&gt;&lt;SPAN style="font-size: 16px; color: #393939; background-color: #ffffff;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/7162i1599A160C24DDE39/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;TIC&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>Thu, 10 May 2018 02:28:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC-FLASH-CLOCK/m-p/737452#M29781</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2018-05-10T02:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: LPC FLASH CLOCK</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC-FLASH-CLOCK/m-p/737453#M29782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The clock will be converted to the correct format，this is the function code is:&lt;/P&gt;&lt;P&gt;status_t FLASHIAP_ErasePage(uint32_t startPage, uint32_t endPage, uint32_t systemCoreClock)&lt;BR /&gt;{&lt;BR /&gt; uint32_t command[5], result[4];&lt;/P&gt;&lt;P&gt;command[0] = kIapCmd_FLASHIAP_ErasePage;&lt;BR /&gt; command[1] = startPage;&lt;BR /&gt; command[2] = endPage;&lt;BR /&gt; command[3] = systemCoreClock / HZ_TO_KHZ_DIV;&lt;BR /&gt; iap_entry(command, result);&lt;/P&gt;&lt;P&gt;return translate_iap_status(result[0]);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;HZ_TO_KHZ_DIV is 1000&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2018 03:39:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC-FLASH-CLOCK/m-p/737453#M29782</guid>
      <dc:creator>liujs1</dc:creator>
      <dc:date>2018-05-10T03:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: LPC FLASH CLOCK</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC-FLASH-CLOCK/m-p/737454#M29783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN class=""&gt;&lt;A _jive_internal="true" class="" data-content-finding="Community" data-userid="318359" data-username="liujs1" href="https://community.nxp.com/people/liujs1"&gt;liu js&lt;/A&gt;&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I was wondering if you can illustrates testing steps and result, as it can help me to figure out this issue.&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&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>Thu, 10 May 2018 06:11:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC-FLASH-CLOCK/m-p/737454#M29783</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2018-05-10T06:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: LPC FLASH CLOCK</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC-FLASH-CLOCK/m-p/737455#M29784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;I have 2K data to be stored in flash，address is&amp;nbsp;0x50000，When the data changes, erase the existing data and store the new data.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;The system clock is always 100M and&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;FLASHTIM is always 0x05.At first, I used 100M to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d;"&gt;erase&amp;amp;&lt;/SPAN&gt;store data，Other modules are always waiting for time to go out of time.So I want to shorten this processing time.when&amp;nbsp; I change&amp;nbsp;&lt;SPAN&gt;FLASHIAP_ErasePage(start_addr &amp;gt;&amp;gt; 8, end_addr &amp;gt;&amp;gt; 8,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;100000000u)&amp;nbsp;to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;FLASHIAP_ErasePage(start_addr &amp;gt;&amp;gt; 8, end_addr &amp;gt;&amp;gt; 8,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;24000000u);,Other modules can wait for the correct results within the specified time。I don't know why.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2018 07:15:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC-FLASH-CLOCK/m-p/737455#M29784</guid>
      <dc:creator>liujs1</dc:creator>
      <dc:date>2018-05-10T07:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: LPC FLASH CLOCK</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC-FLASH-CLOCK/m-p/737456#M29785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN class=""&gt;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="318359" data-username="liujs1" href="https://community.nxp.com/people/liujs1"&gt;liu js&lt;/A&gt;&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;According to your testing, how long does it spend when &lt;SPAN style="font-size: 16px; color: #393939; background-color: #ffffff;"&gt;Param2&lt;/SPAN&gt; is 100 MHZ and 24 MHz respectively on MCUXpresso LPC54102 board?&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&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>Fri, 11 May 2018 03:25:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC-FLASH-CLOCK/m-p/737456#M29785</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2018-05-11T03:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: LPC FLASH CLOCK</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC-FLASH-CLOCK/m-p/737457#M29786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;When called function "int&amp;nbsp;updateTempleteToFlash",erase flash "void EraseFlash(unsigned int start_addr, unsigned int end_addr)" use 24000000u，The return result is faster than&amp;nbsp;use &lt;SPAN&gt;SystemCoreClock(100M),sorry,I can't provide accurate running time。&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is as follows：&lt;/P&gt;&lt;P&gt;void EraseFlash(unsigned int start_addr, unsigned int end_addr)&lt;BR /&gt;{&lt;BR /&gt; unsigned int u32irq;&lt;/P&gt;&lt;P&gt;if(start_addr &amp;gt; end_addr) return;&lt;BR /&gt; u32irq = DisableGlobalIRQ();&lt;BR /&gt; FLASHIAP_PrepareSectorForWrite((start_addr &amp;gt;&amp;gt; 15), (end_addr &amp;gt;&amp;gt; 15));&lt;BR /&gt; //FLASHIAP_ErasePage(start_addr &amp;gt;&amp;gt; 8, end_addr &amp;gt;&amp;gt; 8, SystemCoreClock);&lt;BR /&gt; FLASHIAP_ErasePage(start_addr &amp;gt;&amp;gt; 8, end_addr &amp;gt;&amp;gt; 8, 24000000u);&lt;BR /&gt; EnableGlobalIRQ(u32irq);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void deleteTemplate(const unsigned char index)&lt;BR /&gt;{&lt;BR /&gt; WWDT_Refresh(WWDT);&lt;BR /&gt; EraseFlash(Template_addr_index_buffer(index), (Template_addr_index_buffer(index) + TEMPLATE_SIZE -1));&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;int ProgramToFlash1(unsigned int addr, const unsigned char *buffer, const unsigned int num)&lt;BR /&gt;{&lt;BR /&gt; unsigned int temp_addr, start_sector, end_sector;&lt;BR /&gt; unsigned char *temp_pointer;&lt;BR /&gt;// unsigned int u32irq;&lt;BR /&gt; int status;&lt;/P&gt;&lt;P&gt;temp_pointer = (unsigned char *)buffer;&lt;BR /&gt; temp_addr = addr;&lt;BR /&gt; __ASM("CPSID I");&lt;/P&gt;&lt;P&gt;// u32irq = DisableGlobalIRQ();&lt;BR /&gt; while(temp_addr &amp;lt; addr + num)&lt;BR /&gt; {&lt;BR /&gt; start_sector = temp_addr &amp;gt;&amp;gt; 15;&lt;BR /&gt; end_sector = (temp_addr + 1024) &amp;gt;&amp;gt; 15;&lt;BR /&gt; FLASHIAP_PrepareSectorForWrite(start_sector, end_sector);&lt;BR /&gt; status = FLASHIAP_CopyRamToFlash(temp_addr, (unsigned int*)temp_pointer, 1024, SystemCoreClock);&lt;BR /&gt; if(status != kStatus_FLASHIAP_Success)&lt;BR /&gt; {&lt;BR /&gt; debug_printf("IAP error\n");&lt;BR /&gt; return -1;&lt;BR /&gt; }&lt;BR /&gt; temp_addr += 1024;&lt;BR /&gt; temp_pointer += 1024;&lt;BR /&gt; }&lt;BR /&gt; __ASM("CPSIE I");&lt;BR /&gt;// EnableGlobalIRQ(u32irq);e&lt;BR /&gt; debug_printf("IAP ok\n");&lt;BR /&gt; return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;unsigned char u8temp[9];&lt;/P&gt;&lt;P&gt;int updateTempleteToFlash(const unsigned char index, const BL_TEMPLATE *template_pointer)&lt;BR /&gt;{&lt;BR /&gt; unsigned int u32temp;&lt;BR /&gt; unsigned int i;&lt;BR /&gt; unsigned char *p, *p_flash;&lt;/P&gt;&lt;P&gt;u32temp = *((unsigned int*)(Template_addr_index_buffer(index) + TEMPLATE_FLAG_OFFSET)); // get the flash flag&lt;BR /&gt; if(0xffffffff != u32temp)&lt;BR /&gt; {&lt;BR /&gt; debug_printf("template have in\n");&lt;BR /&gt; deleteTemplate(index);&lt;BR /&gt; //return -1;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;u32temp = template_pointer -&amp;gt; templateSize;&lt;BR /&gt; if(u32temp &amp;gt; (TEMPLATE_SIZE - TEMPLATE_DATA_OFFSET))&lt;BR /&gt; {&lt;BR /&gt; debug_printf("template too large\n");&lt;BR /&gt; return -1;&lt;BR /&gt; }&lt;BR /&gt; p = 0;&lt;BR /&gt; p = malloc(TEMPLATE_SIZE);&lt;BR /&gt; if(0 == p)&lt;BR /&gt; {&lt;BR /&gt; debug_printf("store malloc error\n");&lt;BR /&gt; return -1;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;// for(i = 0; i &amp;lt; TEMPLATE_SIZE; i++)&lt;BR /&gt;// {&lt;BR /&gt;// p[i] = 0;&lt;BR /&gt;// }&lt;/P&gt;&lt;P&gt;u32temp = TEMPLATE_FLAG; // store template flag&lt;BR /&gt; p[0] = u32temp &amp;amp; 0xff;&lt;BR /&gt; p[1] = (u32temp &amp;gt;&amp;gt; 8) &amp;amp; 0xff;&lt;BR /&gt; p[2] = (u32temp &amp;gt;&amp;gt; 16) &amp;amp; 0xff;&lt;BR /&gt; p[3] = (u32temp &amp;gt;&amp;gt; 24) &amp;amp; 0xff;&lt;/P&gt;&lt;P&gt;u32temp = template_pointer -&amp;gt; templateSize; // store template size&lt;BR /&gt; p[4] = u32temp &amp;amp; 0xff;&lt;BR /&gt; p[5] = (u32temp &amp;gt;&amp;gt; 8) &amp;amp; 0xff;&lt;BR /&gt; p[6] = (u32temp &amp;gt;&amp;gt; 16) &amp;amp; 0xff;&lt;BR /&gt; p[7] = (u32temp &amp;gt;&amp;gt; 24) &amp;amp; 0xff;&lt;/P&gt;&lt;P&gt;p[8] = template_pointer -&amp;gt; templateType; // store template type&lt;/P&gt;&lt;P&gt;memcpy(&amp;amp;p[TEMPLATE_DATA_OFFSET], template_pointer -&amp;gt; pTemplateData, template_pointer -&amp;gt; templateSize); // store template data&lt;/P&gt;&lt;P&gt;for(i = 0; i &amp;lt; template_pointer -&amp;gt; templateSize; i++)&lt;BR /&gt; {&lt;BR /&gt; if(template_pointer -&amp;gt; pTemplateData[i] != p[TEMPLATE_DATA_OFFSET + i])&lt;BR /&gt; {&lt;BR /&gt; debug_printf("*****not match ****\n");&lt;BR /&gt; free(p);&lt;BR /&gt; return -1;&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; debug_printf("begin to store\n");&lt;/P&gt;&lt;P&gt;u32temp = template_pointer -&amp;gt; templateSize + TEMPLATE_DATA_OFFSET;&lt;BR /&gt; ProgramToFlash1(Template_addr_index_buffer(index), p, u32temp);&lt;BR /&gt; p_flash = (unsigned char *)Template_addr_index_buffer(index);&lt;/P&gt;&lt;P&gt;for(i = 0; i &amp;lt; u32temp; i++)&lt;BR /&gt; {&lt;BR /&gt; if(p_flash[i] != p[i])&lt;BR /&gt; {&lt;BR /&gt; debug_printf("flash check noce error\n");&lt;BR /&gt; ProgramToFlash1(Template_addr_index_buffer(index), p, u32temp);&lt;BR /&gt; for(i = 0; i &amp;lt; u32temp; i++)&lt;BR /&gt; {&lt;BR /&gt; if(p_flash[i] != p[i])&lt;BR /&gt; {&lt;BR /&gt; free(p);&lt;BR /&gt; deleteTemplate(index);&lt;BR /&gt; debug_printf("flash check twice error and delete\n");&lt;BR /&gt; return -1;&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; free(p);&lt;BR /&gt; return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2018 03:49:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC-FLASH-CLOCK/m-p/737457#M29786</guid>
      <dc:creator>liujs1</dc:creator>
      <dc:date>2018-05-11T03:49:21Z</dc:date>
    </item>
  </channel>
</rss>

