<?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: cpp lpc1549 default stack pointer in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/cpp-lpc1549-default-stack-pointer/m-p/526310#M8940</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by efiLabs on Mon Jun 23 09:59:37 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you very very much for pointing out all of the options ... the one with changing the startup code seems the most logical and less intrusive&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks, cheers efiLabs&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 17:03:41 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T17:03:41Z</dc:date>
    <item>
      <title>cpp lpc1549 default stack pointer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/cpp-lpc1549-default-stack-pointer/m-p/526306#M8936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by efiLabs on Sun Jun 22 23:25:43 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;friends :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;a question arises for the lpc1549 : lpcxpresso 7.2.0 cpp (C++ lpcopen proj)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the default stack pointer seems to be assigned at the end of xxx_Debug.ld linker script&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PROVIDE(_pvHeapStart = .);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PROVIDE(_vStackTop = __top_Ram0_16 - 0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the location of __top_Ram0_16 is at 0x02004000 which is at the end +1 of the 1st 16 k sram "Ram0"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the lpc1549 has 2 x 16 k + 4k sram&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;one would assume that it should by default be placed at the end of sram +1 which is 0x02009000&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i did a quick and dirty hack of hard coding this void (*)() function pointer in cr_startup_lpc15xx.cpp and my pgm works now since i use at least 32 k sram ... it took a while to figure it out since i 1st assumed my pgm is somehow at fault&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this can't be the intended fix for it i assume.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;what's the appropriate solution for it ... i can't just start hacking happily away, right from the start&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks, cheers efiLabs&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:03:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/cpp-lpc1549-default-stack-pointer/m-p/526306#M8936</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: cpp lpc1549 default stack pointer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/cpp-lpc1549-default-stack-pointer/m-p/526307#M8937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by lpcxpresso-support on Mon Jun 23 00:26:31 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;The LPC15xx parts have three blocks of RAM, with the ability to enable/disable the second and third banks separately. For more details see the LPC15xx User Manual, Chapter 1: LPC15xx Memory mapping.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Fcontent%2Fnxpfile%2Flpc15xx-user-manual" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/nxpfile/lpc15xx-user-manual&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As the RAM banks are contiguous, you can merge them if required using the memory configuration editor (as described in the LPCXpresso User Guide). The stack will then be automatically placed at the end of the 1st RAM bank (as defined after your editing of the memory map).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or alternatively you could move the stack (and heap) to the second (or third!) RAM block using a linker script template - as described at:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Fcontent%2Ffaq%2Flpcxpresso%2Flinker-script-templates" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/faq/lpcxpresso/linker-script-templates&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPCXpresso Support&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:03:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/cpp-lpc1549-default-stack-pointer/m-p/526307#M8937</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: cpp lpc1549 default stack pointer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/cpp-lpc1549-default-stack-pointer/m-p/526308#M8938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by efiLabs on Mon Jun 23 01:50:39 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks for the reply :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;since i do not want a custom linker script, the suggested way seems to be the following&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Properties -&amp;gt; C/C++ Build -&amp;gt; MCU Settings -&amp;gt; Memory configuration editor and merging all 3 ram regions into one ??? correct ???&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;do i still need to call the combined sram region Ram0_16 or can i call it Ram0_all as an example ???&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if i make these changes tomorrow and check it ... it's past midnight here in Ca ... will these changes be permanent for all future lpc1549 project creations ??? or only for this one ???&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;my thought was, since the 3 sram regions are contiguous in nature, no gaps, the lpc1549 project creation out of the box would adjust automatically to the end of the sram&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;why would someone buy a 36 k part and then want the stack pointer in the middle of the 36 k and fiddle with 3 regions ???&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;since they are contiguous, the plain vanilla thought is to treat it as memory and if anyone wants something special they can adjust the cpu to their individual segmented needs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;sorry ... no criticism, just some thoughts ... i buy a cpu out of the box cause it has 36 k (which isn't a lot to begin with) then most users have one memory. nice to allow for segmentation if needed and use it ... like i thought ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;again ... just some thoughts ... i'm sure your answer before will help others as well to shine light onto where the default stack pointer is&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks again, cheers efiLabs&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:03:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/cpp-lpc1549-default-stack-pointer/m-p/526308#M8938</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: cpp lpc1549 default stack pointer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/cpp-lpc1549-default-stack-pointer/m-p/526309#M8939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by lpcxpresso-support on Mon Jun 23 02:38:00 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;Properties -&amp;gt; C/C++ Build -&amp;gt; MCU Settings -&amp;gt; Memory configuration editor and merging all 3 ram regions into one ??? correct ???&lt;BR /&gt;&lt;BR /&gt;do i still need to call the combined sram region Ram0_16 or can i call it Ram0_all as an example ???&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, you can merge them all. You can name it whatever you want.&lt;/SPAN&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if i make these changes tomorrow and check it ... it's past midnight here in Ca ... will these changes be permanent for all future lpc1549 project creations ??? or only for this one ???&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Only this one. You can use the Export/Import buttons on the memory configuration editor to move the configuration between different projects&lt;/SPAN&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;my thought was, since the 3 sram regions are contiguous in nature, no gaps, the lpc1549 project creation out of the box would adjust automatically to the end of the sram&lt;BR /&gt;&lt;BR /&gt;why would someone buy a 36 k part and then want the stack pointer in the middle of the 36 k and fiddle with 3 regions ???&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It was done this way because the 2 other banks can be powered off (to save power).&lt;/SPAN&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;since they are contiguous, the plain vanilla thought is to treat it as memory and if anyone wants something special they can adjust the cpu to their individual segmented needs.&lt;BR /&gt;&lt;BR /&gt;sorry ... no criticism, just some thoughts ... i buy a cpu out of the box cause it has 36 k (which isn't a lot to begin with) then most users have one memory. nice to allow for segmentation if needed and use it ... like i thought ...&lt;BR /&gt;&lt;BR /&gt;again ... just some thoughts ... i'm sure your answer before will help others as well to shine light onto where the default stack pointer is&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another way to move the stack is to change the Startup code. The linker script defined the top of each RAM bank and you can use these symbols to change the stack initialiser.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Add this to the startup code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
extern void __top_Ram2_4(void); // definition from the linker script
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;And edit the stack initialiser to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
&amp;amp;__top_Ram2_4,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // The initial stack pointer
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;And you do not need to change your linker script.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:03:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/cpp-lpc1549-default-stack-pointer/m-p/526309#M8939</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: cpp lpc1549 default stack pointer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/cpp-lpc1549-default-stack-pointer/m-p/526310#M8940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by efiLabs on Mon Jun 23 09:59:37 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you very very much for pointing out all of the options ... the one with changing the startup code seems the most logical and less intrusive&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks, cheers efiLabs&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:03:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/cpp-lpc1549-default-stack-pointer/m-p/526310#M8940</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:03:41Z</dc:date>
    </item>
  </channel>
</rss>

