<?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のトピックRe: remaping stack from internal to external RAM</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/remaping-stack-from-internal-to-external-RAM/m-p/569063#M17849</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the hints, I have managed now to get the stack running from external SDRAM.&lt;/P&gt;&lt;P&gt;The application is running very well now without any stack-issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finaly, all the declared stuff for the stack is not needed and may be removed.&lt;/P&gt;&lt;P&gt;Instead I am using now an assembler-file "userStack.s":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AREA &amp;nbsp; &amp;nbsp; USRSTACK, &amp;nbsp; &amp;nbsp;CODE, &amp;nbsp; &amp;nbsp;READONLY, &amp;nbsp; &amp;nbsp;ALIGN=3&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; EXPORT &amp;nbsp; &amp;nbsp; ustack &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ustack &amp;nbsp; LDR &amp;nbsp;SP, =0x29DFFFF0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BX &amp;nbsp; &amp;nbsp; &amp;nbsp;LR&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ALIGN&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;END&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code will be called within main() &amp;nbsp;just after systemInit():&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;main()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;systemInit();&lt;/P&gt;&lt;P&gt;userInitStackHeap();&lt;/P&gt;&lt;P&gt;userStack();&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The stack will grow down from the hardcoded address in upper SDRAM-region&lt;/P&gt;&lt;P&gt;and the user is responsible to reserve enough space here,&lt;/P&gt;&lt;P&gt;there must not occure collisions with heap, program-data&amp;nbsp;or the framepointer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using __asm is possible as well instead of userStack.s:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;__asm void userStack(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; LDR &amp;nbsp; SP, =0x29DFFFF0&lt;/P&gt;&lt;P&gt;&amp;nbsp; BX &amp;nbsp; &amp;nbsp; &amp;nbsp;LR&lt;/P&gt;&lt;P&gt;&amp;nbsp; ALIGN&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Changing the stack already in userInitStackHeap() didn't work for my application, therefore there are two files.&lt;/P&gt;&lt;P&gt;The values are only working examples and are subject to change of course.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 03 Sep 2016 15:31:39 GMT</pubDate>
    <dc:creator>hartmutmeyer</dc:creator>
    <dc:date>2016-09-03T15:31:39Z</dc:date>
    <item>
      <title>remaping stack from internal to external RAM</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/remaping-stack-from-internal-to-external-RAM/m-p/569059#M17845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the LPC4357 with&amp;nbsp;32 MB&amp;nbsp;SDRAM.&lt;/P&gt;&lt;P&gt;This extenal SDRAM needs to be initialized before it can be used,&lt;/P&gt;&lt;P&gt;doing this there is internal RAM required for startup.s and system.c&lt;/P&gt;&lt;P&gt;as well the default stack is located in internal RAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The board actualy in use has only 136 KB internal RAM,&lt;/P&gt;&lt;P&gt;splitted into different regions, so the max usable is only 64 KB ( 72 KB ).&lt;/P&gt;&lt;P&gt;My application requires more stack as is available after longer runtime&lt;/P&gt;&lt;P&gt;and a crash occures of course &amp;nbsp;if running out of stack.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are there any examples how to use a stack in external SDRAM,&lt;/P&gt;&lt;P&gt;after initialization has completed ? Is this possible at all ?&lt;/P&gt;&lt;P&gt;I am using already a scatter-load-description file where&amp;nbsp;stack and heap is&lt;/P&gt;&lt;P&gt;already defined there as regions.&lt;/P&gt;&lt;P&gt;I am also using "__user_setup_stackheap" what results in using the allocated heap,&lt;/P&gt;&lt;P&gt;but the stack will still be used from internal RAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basicaly, the application is working but quite useless if stack-overflow occures...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 12:51:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/remaping-stack-from-internal-to-external-RAM/m-p/569059#M17845</guid>
      <dc:creator>hartmutmeyer</dc:creator>
      <dc:date>2016-08-29T12:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: remaping stack from internal to external RAM</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/remaping-stack-from-internal-to-external-RAM/m-p/569060#M17846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It sounds like you're not using&amp;nbsp; __user_setup_stackheap() correctly. Your startup code only needs an initial stack sufficient to complete the early setup. You can define more than one stack region in your startup code. Once you've configured the external SDRAM, change the stack pointer. Check this link for more info.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.keil.com/support/man/docs/armlib/armlib_chr1359122863069.htm"&gt;http://www.keil.com/support/man/docs/armlib/armlib_chr1359122863069.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You didn't say whether you're using an RTOS. Stack setup can differ depending on the RTOS. Some allocate stack space from the heap, others use static memory (or both).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;LPCXpresso Support&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 21:39:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/remaping-stack-from-internal-to-external-RAM/m-p/569060#M17846</guid>
      <dc:creator>lpcxpresso_supp</dc:creator>
      <dc:date>2016-08-29T21:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: remaping stack from internal to external RAM</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/remaping-stack-from-internal-to-external-RAM/m-p/569061#M17847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;RTOS is not used in my application.&lt;/P&gt;&lt;P&gt;The default stack and heap is now set to 0x400 only.&lt;/P&gt;&lt;P&gt;In the application there will be done iterative deepening,&lt;/P&gt;&lt;P&gt;the demand for stack may grow depending on runtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is defined in "stackheap.h" :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#define &amp;nbsp; &amp;nbsp;USER_HEAP_BASE &amp;nbsp; &amp;nbsp;0x28801000&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#define &amp;nbsp; &amp;nbsp;USER_HEAP_SIZE &amp;nbsp; &amp;nbsp; &amp;nbsp;0x01400000&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In main.c there will be executed "userInitStackHeap():&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#include &amp;nbsp; &amp;nbsp;"stackheap.h"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;__asm &amp;nbsp;void &amp;nbsp;userInitStackHeap(void)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; IMPORT &amp;nbsp; &amp;nbsp; __use_two_region_memory&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; EXPORT &amp;nbsp; &amp;nbsp;__user_setup_stackheap&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; EXPORT &amp;nbsp; &amp;nbsp;__heap_base&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; EXPORT &amp;nbsp; &amp;nbsp;__heap_limit&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;__heap_base &amp;nbsp;EQU &amp;nbsp; &amp;nbsp;USER_HEAP_BASE&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;__heap_limit &amp;nbsp; &amp;nbsp;EQU &amp;nbsp; USER_HEAP_BASE + USER_HEAP_SIZE&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;__user_setup_stackheap&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; LDR &amp;nbsp; &amp;nbsp; R0, = &amp;nbsp;__heap_base&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; LDR &amp;nbsp; &amp;nbsp; R2, = &amp;nbsp;__heap_limit&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; BX &amp;nbsp; &amp;nbsp;LR&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; ALIGN&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use scatter-load-description as well:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LR_IROM1 &amp;nbsp; &amp;nbsp;0x1A000000 &amp;nbsp; &amp;nbsp;0x00080000 &amp;nbsp;{&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; ER_IROM1 &amp;nbsp; &amp;nbsp;0x1A00.0000 &amp;nbsp; 0x00080000 &amp;nbsp;{&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; *.o (RESET, +First)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; *(InRoot$$Sections)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; .ANY (+RO)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; RW_IRAM1 &amp;nbsp; &amp;nbsp;0x10000000 &amp;nbsp; &amp;nbsp;0x00008000 &amp;nbsp;{&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;system_LPC43xx.o &amp;nbsp;(+RW +ZI)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; RW_IRAM2 &amp;nbsp; &amp;nbsp;0x20000000 &amp;nbsp; &amp;nbsp;0x00010000 &amp;nbsp;{&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;startup_LPC43xx.o &amp;nbsp;(+RW +ZI) &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; ; may be put in RW_IRAM1 as well&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; }&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; RW_RAM1 &amp;nbsp; 0x28000000 &amp;nbsp; &amp;nbsp; 0x01DFFFFF &amp;nbsp;{&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;.ANY &amp;nbsp; (+RW +ZI)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; }&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ARM_LIB_HEAP &amp;nbsp; &amp;nbsp; &amp;nbsp;0x28801000 &amp;nbsp; &amp;nbsp;EMPTY &amp;nbsp; 0x1400000 &amp;nbsp;{}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ARM_LIB_STACK &amp;nbsp; 0x29DF0000 &amp;nbsp; &amp;nbsp;EMPTY &amp;nbsp; &amp;nbsp; &amp;nbsp;-0x40000 {}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;The application is working and heap is fully used,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;but the stack will not be remaped.&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2016 23:34:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/remaping-stack-from-internal-to-external-RAM/m-p/569061#M17847</guid>
      <dc:creator>hartmutmeyer</dc:creator>
      <dc:date>2016-08-30T23:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: remaping stack from internal to external RAM</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/remaping-stack-from-internal-to-external-RAM/m-p/569062#M17848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can put the stack pointer to wherever you like at any point in time, just by&amp;nbsp;changing the content of the stack pointer register. The stack is a hardware controlled mechanism, so from the point in time you set the SP register to a specific address it will work from there.&lt;/P&gt;&lt;P&gt;This means that for the basic initialization tasks you need to provide an address in internal RAM. After the external SRAM or SDRAM has been made accessible (whenever this is) you can change the stack pointer to an external address. Using an intrinsic or an assembler instruction.&lt;/P&gt;&lt;P&gt;What you should avoid at this point in time is the usage of application functions (for example interrupts) which use the stack. Otherwise you might lose something when you switch the stack pointer.&lt;/P&gt;&lt;P&gt;To emphasize it again: &amp;nbsp;the initial setting of the stack pointer is required, but if&amp;nbsp;you do this with a linker macro or if you set it in assembler in startup.s or in C in the cr_startup_xxxx.c file is in principle a don't care.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the heap it's different, that's a software controlled memeory area and the embedded libraries or any other heap management from an RTOS needs to know the position and the size of this area. But the same principle applies to the heap settings. You only need to have it set before it is used.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is not something the linker needs to know, you can do the required things in code as well. But one thing of course needs to be considered: if you don't give the linker this information, then you need to keep the area you intend to use for stack &amp;amp; heap free, so don't provide it to the linker as available area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;NXP Support Team.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 14:16:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/remaping-stack-from-internal-to-external-RAM/m-p/569062#M17848</guid>
      <dc:creator>bernhardfink</dc:creator>
      <dc:date>2016-09-02T14:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: remaping stack from internal to external RAM</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/remaping-stack-from-internal-to-external-RAM/m-p/569063#M17849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the hints, I have managed now to get the stack running from external SDRAM.&lt;/P&gt;&lt;P&gt;The application is running very well now without any stack-issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finaly, all the declared stuff for the stack is not needed and may be removed.&lt;/P&gt;&lt;P&gt;Instead I am using now an assembler-file "userStack.s":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AREA &amp;nbsp; &amp;nbsp; USRSTACK, &amp;nbsp; &amp;nbsp;CODE, &amp;nbsp; &amp;nbsp;READONLY, &amp;nbsp; &amp;nbsp;ALIGN=3&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; EXPORT &amp;nbsp; &amp;nbsp; ustack &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ustack &amp;nbsp; LDR &amp;nbsp;SP, =0x29DFFFF0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BX &amp;nbsp; &amp;nbsp; &amp;nbsp;LR&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ALIGN&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;END&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code will be called within main() &amp;nbsp;just after systemInit():&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;main()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;systemInit();&lt;/P&gt;&lt;P&gt;userInitStackHeap();&lt;/P&gt;&lt;P&gt;userStack();&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The stack will grow down from the hardcoded address in upper SDRAM-region&lt;/P&gt;&lt;P&gt;and the user is responsible to reserve enough space here,&lt;/P&gt;&lt;P&gt;there must not occure collisions with heap, program-data&amp;nbsp;or the framepointer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using __asm is possible as well instead of userStack.s:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;__asm void userStack(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; LDR &amp;nbsp; SP, =0x29DFFFF0&lt;/P&gt;&lt;P&gt;&amp;nbsp; BX &amp;nbsp; &amp;nbsp; &amp;nbsp;LR&lt;/P&gt;&lt;P&gt;&amp;nbsp; ALIGN&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Changing the stack already in userInitStackHeap() didn't work for my application, therefore there are two files.&lt;/P&gt;&lt;P&gt;The values are only working examples and are subject to change of course.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Sep 2016 15:31:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/remaping-stack-from-internal-to-external-RAM/m-p/569063#M17849</guid>
      <dc:creator>hartmutmeyer</dc:creator>
      <dc:date>2016-09-03T15:31:39Z</dc:date>
    </item>
  </channel>
</rss>

