<?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: Getting Hard Fault Error in LPC54606 while using EEPROM_Write in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1781689#M55090</link>
    <description>Hi,&lt;BR /&gt;This is only for testing purpose.&lt;BR /&gt;Did you tested same code on your board?</description>
    <pubDate>Tue, 02 Jan 2024 12:03:49 GMT</pubDate>
    <dc:creator>emb02</dc:creator>
    <dc:date>2024-01-02T12:03:49Z</dc:date>
    <item>
      <title>Getting Hard Fault Error in LPC54606 while using EEPROM_Write</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1780361#M55065</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm testing internal EEPROM of LPC54606 in which I want to write 64 bytes using&amp;nbsp;EEPROM_Write() function. But after calling this function controller goes in Hardfault handler and then not able to write data into EEPROM.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hardfault.PNG" style="width: 734px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/255998iE1E8340F7160740B/image-dimensions/734x410?v=v2" width="734" height="410" role="button" title="hardfault.PNG" alt="hardfault.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have referred lpcxpresso54628_eeprom example project.&lt;/P&gt;&lt;P&gt;I'm attaching my test project for reference.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2023 07:09:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1780361#M55065</guid>
      <dc:creator>emb02</dc:creator>
      <dc:date>2023-12-27T07:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Hard Fault Error in LPC54606 while using EEPROM_Write</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1780674#M55069</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have checked your code, I suppose that byou have modified the SDK example code.&lt;/P&gt;
&lt;P&gt;If you use the SDK example code without any modification, do you have any issue?&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2023 02:37:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1780674#M55069</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2023-12-28T02:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Hard Fault Error in LPC54606 while using EEPROM_Write</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1780690#M55070</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;for your code:&lt;/P&gt;
&lt;P&gt;for (i = 0; i &amp;lt; 1; i++)&lt;BR /&gt;{&lt;BR /&gt;EEPROM_Write(EXAMPLE_EEPROM, u16Address, data, u16BytesToWrite);&lt;/P&gt;
&lt;P&gt;for (j = 0; j &amp;lt; u16BytesToWrite / 4; j++)&lt;BR /&gt;{&lt;BR /&gt;eeprom_data = *((uint32_t *)(FSL_FEATURE_EEPROM_BASE_ADDRESS + i * u16BytesToWrite + j * 4));&lt;BR /&gt;if (eeprom_data != data[j])&lt;BR /&gt;{&lt;BR /&gt;err++;&lt;BR /&gt;PRINTF("Page %d offset %d is wrong, data is %x \r\n", i, (j * 4), eeprom_data);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;PRINTF("Page %d program finished!\r\n", i);&lt;/P&gt;
&lt;P&gt;u16Address += u16BytesToWrite;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;The EEPROM page size is 0x4000/128=128 bytes, if you define u16BytesToWrite as 128, the EEPROM_Write() function will become page program.&lt;/P&gt;
&lt;P&gt;Pls have a try&lt;/P&gt;
&lt;P&gt;Generally, the wrong address will leads to hardfault error.&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2023 02:56:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1780690#M55070</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2023-12-28T02:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Hard Fault Error in LPC54606 while using EEPROM_Write</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1780724#M55071</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/26034"&gt;@xiangjun_rong&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you use the SDK example code without any modification, do you have any issue?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-&amp;gt; No I don't get any error if using&amp;nbsp;EEPROM_WritePage() to write data into EEPROM.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But I don't want to write all 128 bytes (1 page) hence not using EEPROM_WritePage().&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The EEPROM page size is 0x4000/128=128 bytes, if you define u16BytesToWrite as 128, the EEPROM_Write() function will become page program.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-&amp;gt; If I change&amp;nbsp;u16BytesToWrite to 128 then also I'm getting hardfault error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there any mistake in my test routine?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you run this code and will let me know if there is no hardfault error?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2023 03:49:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1780724#M55071</guid>
      <dc:creator>emb02</dc:creator>
      <dc:date>2023-12-28T03:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Hard Fault Error in LPC54606 while using EEPROM_Write</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1780747#M55073</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have not LPC54628-EVK board on hand, pls try to test. If you still have issue, I will test on Tuesday next week.&lt;/P&gt;
&lt;P&gt;Pls try to execute the line, and check which line leads to the hardfault&lt;/P&gt;
&lt;P&gt;EEPROM_Write(EXAMPLE_EEPROM, u16Address, data, u16BytesToWrite);&lt;/P&gt;
&lt;P&gt;for (j = 0; j &amp;lt; u16BytesToWrite / 4; j++)&lt;BR /&gt;{&lt;BR /&gt;eeprom_data = *((uint32_t *)(FSL_FEATURE_EEPROM_BASE_ADDRESS + i * u16BytesToWrite + j * 4));&lt;BR /&gt;if (eeprom_data != data[j])&lt;BR /&gt;{&lt;BR /&gt;err++;&lt;BR /&gt;PRINTF("Page %d offset %d is wrong, data is %x \r\n", i, (j * 4), eeprom_data);&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2023 05:36:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1780747#M55073</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2023-12-28T05:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Hard Fault Error in LPC54606 while using EEPROM_Write</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1780836#M55077</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/26034"&gt;@xiangjun_rong&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Pls try to execute the line, and check which line leads to the hardfault&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-&amp;gt; I don't get error while debugging (step in).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="eeprom out.PNG" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/256124iCCD816EE66F7CF04/image-size/large?v=v2&amp;amp;px=999" role="button" title="eeprom out.PNG" alt="eeprom out.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;But in runtime MCU goes in hardfault handler.&lt;/P&gt;&lt;P&gt;Not able to understand this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2023 08:38:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1780836#M55077</guid>
      <dc:creator>emb02</dc:creator>
      <dc:date>2023-12-28T08:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Hard Fault Error in LPC54606 while using EEPROM_Write</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1781155#M55084</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I suppose that you can not write EEPROM in a forever loop.&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2023 08:06:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1781155#M55084</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2023-12-29T08:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Hard Fault Error in LPC54606 while using EEPROM_Write</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1781689#M55090</link>
      <description>Hi,&lt;BR /&gt;This is only for testing purpose.&lt;BR /&gt;Did you tested same code on your board?</description>
      <pubDate>Tue, 02 Jan 2024 12:03:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1781689#M55090</guid>
      <dc:creator>emb02</dc:creator>
      <dc:date>2024-01-02T12:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Hard Fault Error in LPC54606 while using EEPROM_Write</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1787975#M55139</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/26034"&gt;@xiangjun_rong&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm still not able to write data into EEPROM. I'm getting&lt;SPAN&gt;&amp;nbsp;Hardfault error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;In Chapter 47: LPC546xx EEPROM memory (UM10912)&amp;nbsp;AUTOPROG mode is mentioned.&lt;/P&gt;&lt;P&gt;I'm using AUTOPROG = 01: Writing a single word to the page starts the erase/program cycle&lt;BR /&gt;automatically. This mode is useful store small data items (word) on random locations.&lt;/P&gt;&lt;P&gt;But I'm not able to get steps to do the same.&lt;/P&gt;&lt;P&gt;Can you provide example code for this configuration (AUTOPROG = 01) using EEPROM_Write().&lt;/P&gt;&lt;P&gt;I have also attached my test project please guide me with this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 05:10:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1787975#M55139</guid>
      <dc:creator>emb02</dc:creator>
      <dc:date>2024-01-18T05:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Hard Fault Error in LPC54606 while using EEPROM_Write</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1899665#M56380</link>
      <description>&lt;P&gt;I have the exact same problem. I am also using a 54606.&lt;/P&gt;&lt;P&gt;If I single step the interal code for EEPROM_Write() then it works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you just normally run&amp;nbsp;EEPROM_Write() then I get a&amp;nbsp;&lt;SPAN&gt;hardfault.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So it must be an underlying timing issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The short answer (not previously given) is to use EEPROM_WriteWord(); (with multiple calls) instead.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2024 16:06:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1899665#M56380</guid>
      <dc:creator>rjleiser</dc:creator>
      <dc:date>2024-07-04T16:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Hard Fault Error in LPC54606 while using EEPROM_Write</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1899669#M56381</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;// can pass &lt;/SPAN&gt;&lt;SPAN&gt;struct&lt;/SPAN&gt;&lt;SPAN&gt; or arrays, should work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;void&lt;/SPAN&gt; &lt;SPAN&gt;Write&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;uint32_t&lt;/SPAN&gt;&lt;SPAN&gt; address, &lt;/SPAN&gt;&lt;SPAN&gt;void&lt;/SPAN&gt;&lt;SPAN&gt;* data, &lt;/SPAN&gt;&lt;SPAN&gt;uint32_t&lt;/SPAN&gt;&lt;SPAN&gt; size)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; ((size % 4) != 0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;printf(&lt;/SPAN&gt;&lt;SPAN&gt;"ERROR: &lt;/SPAN&gt;&lt;SPAN&gt;eeprom&lt;/SPAN&gt;&lt;SPAN&gt; write, size align not 4 bytes\n"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;// Combine four bytes from the buffer to a 32-bits word&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;uint32_t&lt;/SPAN&gt;&lt;SPAN&gt;* buffer = (&lt;/SPAN&gt;&lt;SPAN&gt;uint32_t&lt;/SPAN&gt;&lt;SPAN&gt;*)data;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;uint16_t&lt;/SPAN&gt;&lt;SPAN&gt; i = 0, j = 0; i &amp;lt; size; i+=4, j++)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;EEPROM_WriteWord(EEPROM, address + i, buffer[j]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 04 Jul 2024 16:10:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-Hard-Fault-Error-in-LPC54606-while-using-EEPROM-Write/m-p/1899669#M56381</guid>
      <dc:creator>rjleiser</dc:creator>
      <dc:date>2024-07-04T16:10:29Z</dc:date>
    </item>
  </channel>
</rss>

