<?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>LPCXpresso IDEのトピックRe: How does memory configuration works?</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-does-memory-configuration-works/m-p/570206#M20029</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by vtw.433e on Mon Feb 22 10:03:08 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;pvHeapLimit?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 22:27:36 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T22:27:36Z</dc:date>
    <item>
      <title>How does memory configuration works?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-does-memory-configuration-works/m-p/570201#M20024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by zou9a on Mon Feb 22 03:03:37 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using the last LPCXpresso, to make an application embedded on a LPC1788 + an external SDRAM 32M (K4S561632C)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have to use and split the ext.SDRAM to 4 regions. The first and the second will be used for the LCD buffer (2 LCD buffer), the third one is an array of a &amp;amp;graphic objet. The last one will save the content of the graphic object. simple no &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I started by creating a new memory in the project's properties -&amp;gt; MCU settings -&amp;gt; Memory config.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then, I have allocated using malloc a big array:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca" style="border:1px solid black;background-color:#cacaca;background-color:#cacaca;border:1px solid black;"&gt; &lt;PRE&gt; unsigned long* unUsed;
unUsed = malloc(512*1024*1024*sizeof(unsigned long));
_printPointer(50, 100, "unUsed pointer", &amp;amp;unUsed[512*1024*1024-1]);&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The printed address returns me 0x9000 1160. When I looked to the UM, it seems that address corresponds to an external SRAM and not the external SDRAM (might be 0xA........ in my case)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, my question is why I have this value and not the attended one?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:27:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/How-does-memory-configuration-works/m-p/570201#M20024</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: How does memory configuration works?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-does-memory-configuration-works/m-p/570202#M20025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by vtw.433e on Mon Feb 22 05:37:41 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;So, you are trying to malloc 2048 Mbytes (512*1024*1024*4 =&amp;nbsp; 512*4 * 1Mbyte) ? What do you think that will do?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Suggest you read the user manual on Memory COnfiguration. And then read the numerous FAQs on memory&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;p.s. When I look up K4S561632C, I see it is a 256Mbit part - i.e. 8Mbyte...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:27:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/How-does-memory-configuration-works/m-p/570202#M20025</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: How does memory configuration works?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-does-memory-configuration-works/m-p/570203#M20026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by zou9a on Mon Feb 22 06:02:53 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;No sorry, It was 5 not 512. I have read it and that's not the question&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I try to use malloc into the ext, and I cant. I have modified the script linker, I add memory on the memory configuration of lpcxpresso, nothing work. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;True, the K4S561632C is 256M but I will use just 32M, because it's bus address must be multiplexed to use all available memory and I will not do it. 32M it's enough for me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My question was: how to use malloc outside from 0xA017E7F5 to 0xA1FFFFFF. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PROVIDE(_pvHeapStart = DEFINED(0xA017E7F5); //doesnt work&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:27:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/How-does-memory-configuration-works/m-p/570203#M20026</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: How does memory configuration works?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-does-memory-configuration-works/m-p/570204#M20027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by vtw.433e on Mon Feb 22 07:15:42 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;1. malloc is allocated from the heap and there is just one heap. The heap needs to be 8-byte aligned - 0xA017E7F5 is not 8-byte aligned.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. DEFINED is a linker directive that returns true (1) or flase (0) is a symbol is defined. As 0xA017E7F5 is not a symbol, it is going to return false (0), so you are setting the start of the heap to zero!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Are you sure you want to use malloc for this? If you always want to used fixed-size, fixed-location areas, then just use them - either define a pointer or use one of the 'linker methods' such as defined in this FAQ:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.lpcware.com%2Fcontent%2Ffaq%2Flpcxpresso%2Fdata-different-ram-blocks" rel="nofollow" target="_blank"&gt;https://www.lpcware.com/content/faq/lpcxpresso/data-different-ram-blocks&lt;/A&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:27:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/How-does-memory-configuration-works/m-p/570204#M20027</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: How does memory configuration works?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-does-memory-configuration-works/m-p/570205#M20028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by zou9a on Mon Feb 22 08:56:45 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Ok, thank you for the hint - now it's 0xA017E800&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. I see my mistake, &lt;/SPAN&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;PROVIDE(_pvHeapStart =0xA017E800)&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt; should work now&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Yes, I must use it. Because only 3 region in my external RAM (before 0xA017E800) will be static, the rest save some graphical objects and it must be dynamically managed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Q: for the static region before 0xA017E800, how I can be sure that my application will not use it? I'm sure that malloc will not because of &lt;/SPAN&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;PROVIDE(_pvHeapStart =0xA017E800)&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can I define a limit of malloc such 0xA1FFFFFF?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:27:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/How-does-memory-configuration-works/m-p/570205#M20028</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: How does memory configuration works?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-does-memory-configuration-works/m-p/570206#M20029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by vtw.433e on Mon Feb 22 10:03:08 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;pvHeapLimit?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:27:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/How-does-memory-configuration-works/m-p/570206#M20029</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:27:36Z</dc:date>
    </item>
  </channel>
</rss>

