<?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: Writing/Reading EEPROM on LPC11U6x in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-Reading-EEPROM-on-LPC11U6x/m-p/831198#M33191</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sam,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank&amp;nbsp; you very much. Never knew we can write to a specified RAM address.&lt;/P&gt;&lt;P&gt;I solved my issue. Since the MCU setting of my project in IDE contains wrong RAM address, so whenever I use a variable, the address range goes beyond my MCU's RAM address.&lt;/P&gt;&lt;P&gt;So, I corrected the address range in MCU settings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, thanks for your tip.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 06 Oct 2018 09:15:01 GMT</pubDate>
    <dc:creator>athmesh_n</dc:creator>
    <dc:date>2018-10-06T09:15:01Z</dc:date>
    <item>
      <title>Writing/Reading EEPROM on LPC11U6x</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-Reading-EEPROM-on-LPC11U6x/m-p/831194#M33187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using an LPC11U67 on a custom designed circuit board. I want to store the board serial number in the eeprom of the LPC. It seemed like this would be a simple task using the&amp;nbsp;functions provided&amp;nbsp;by LPC Open in eeprom.c/eeprom.h. I wrote the following functions to access the serial number. The problem is, every time I tried to read or write to eeprom I get a return code of 14 (#define IAP_ADDR_NOT_MAPPED&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;14&lt;SPAN&gt; &lt;/SPAN&gt;/*!&amp;lt; Address is not mapped in the memory map */).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried changing the address to no avail. (On a side note, where is the eeprom located in memory, its not listed in the memory map in the datasheet.) I looked at the example code provided with LPC Open and I don't see any additional initialization steps that I'm not taking. I'm not quite sure what I'm missing. Is there another step I need to take before trying to invoke these commands? Is the address an absolute memory address?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="property macro token"&gt;#include &lt;SPAN class="string token"&gt;"eeprom.h"&lt;/SPAN&gt;&lt;/SPAN&gt;

&lt;SPAN class="property macro token"&gt;#define EEPROM_ADDRESS_ECHO_SN 64 &lt;/SPAN&gt;&lt;SPAN class="comment token"&gt;//Top 64 bytes of eeprom are locked and cannot be written&lt;/SPAN&gt;

uint8_t &lt;SPAN class="token function"&gt;WriteSN&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;uint8_t SN&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Chip_EEPROM_Write&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;EEPROM_ADDRESS_ECHO_SN&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;SN&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

uint8_t &lt;SPAN class="token function"&gt;ReadSN&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 uint8_t SN &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;255&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 uint8_t retCode &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

 retCode &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Chip_EEPROM_Read&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;EEPROM_ADDRESS_ECHO_SN&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;SN&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;log_msg&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"EEPROM Read Return Code: %u"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; retCode&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; SN&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2018 00:18:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-Reading-EEPROM-on-LPC11U6x/m-p/831194#M33187</guid>
      <dc:creator>sambennett</dc:creator>
      <dc:date>2018-06-29T00:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Writing/Reading EEPROM on LPC11U6x</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-Reading-EEPROM-on-LPC11U6x/m-p/831195#M33188</link>
      <description>&lt;P&gt;[&lt;STRONG&gt;EDIT: t&lt;/STRONG&gt;he URL in original post is no longer available. I have changed it to point to a link in the Internet Archive ]&lt;/P&gt;&lt;P&gt;Sam, I ran into this&amp;nbsp;tonight too and found that the EEPROM IAP routine works when the buffer address is in main RAM (0x10000000 and up) but not in the smaller RAM blocks (0x20000000 and 0x20004000), which is where I had my data buffer. So,&amp;nbsp;using a buffer on the stack solved the problem for me. YMMV.&lt;/P&gt;&lt;P&gt;By the way, for people landing here through search engines, there is an&amp;nbsp;article about the speed of the on-chip EEPROM and interrupts here:&amp;nbsp;&lt;A href="https://web.archive.org/web/20131016034605/https://www.lpcware.com/content/blog/lpc1100lpc1300-eeprom-library" target="_self"&gt;https://web.archive.org/web/20131016034605/https://www.lpcware.com/content/blog/lpc1100lpc1300-eeprom-library&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The built-in IAP routine disables interrupts for potentially many msec during large&amp;nbsp;writes. The alternative library that NXP provides doesn't disable interrupts.&amp;nbsp;&lt;/P&gt;&lt;P&gt;[&lt;STRONG&gt;EDIT: I'm not finding the library available for download anywhere anymore. Anyone know where it is?]&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 19:03:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-Reading-EEPROM-on-LPC11U6x/m-p/831195#M33188</guid>
      <dc:creator>brianknittel</dc:creator>
      <dc:date>2023-03-10T19:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Writing/Reading EEPROM on LPC11U6x</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-Reading-EEPROM-on-LPC11U6x/m-p/831196#M33189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Brian and Sam,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've Similar issue as that of&amp;nbsp;@sam bennet.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One project that uses EEPROM works fine , the read and write EEPROM works successfully.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But for another project the similar code does not work, returning 14 as result(memory not mapped). What can be the reason?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That link cannot be opened.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2018 05:21:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-Reading-EEPROM-on-LPC11U6x/m-p/831196#M33189</guid>
      <dc:creator>athmesh_n</dc:creator>
      <dc:date>2018-10-02T05:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: Writing/Reading EEPROM on LPC11U6x</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-Reading-EEPROM-on-LPC11U6x/m-p/831197#M33190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;As Brian figured out, your RAM variable must be in the main block of RAM otherwise the you get error 14. Perhaps in one of your projects the variable ends up in the main ram block and the other it does not. Check where in memory those variables end up.&lt;/P&gt;&lt;P&gt;One thing you could try, is to directly assign the ram variable to the main ram block. In the example below I'm storing a serial number in eeprom&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;uint8_t &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;s_ramVar &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;uint8_t &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0x10000000&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;//The ram copy of the variable must be in the block of ram starting at address 0x10000000 otherwise the iap functions do not work&lt;/SPAN&gt;

uint8_t &lt;SPAN class="token function"&gt;Version_WriteSN&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;uint8_t SN&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;s_ramVar &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; SN&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
uint8_t retCode &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;255&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
retCode &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Chip_EEPROM_Write&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;EEPROM_ADDRESS_ECHO_SN&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; s_ramVar&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; retCode&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2018 20:43:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-Reading-EEPROM-on-LPC11U6x/m-p/831197#M33190</guid>
      <dc:creator>sambennett</dc:creator>
      <dc:date>2018-10-04T20:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Writing/Reading EEPROM on LPC11U6x</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-Reading-EEPROM-on-LPC11U6x/m-p/831198#M33191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sam,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank&amp;nbsp; you very much. Never knew we can write to a specified RAM address.&lt;/P&gt;&lt;P&gt;I solved my issue. Since the MCU setting of my project in IDE contains wrong RAM address, so whenever I use a variable, the address range goes beyond my MCU's RAM address.&lt;/P&gt;&lt;P&gt;So, I corrected the address range in MCU settings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, thanks for your tip.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Oct 2018 09:15:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Writing-Reading-EEPROM-on-LPC11U6x/m-p/831198#M33191</guid>
      <dc:creator>athmesh_n</dc:creator>
      <dc:date>2018-10-06T09:15:01Z</dc:date>
    </item>
  </channel>
</rss>

