Dear Community.
I'm developing an application on NPC1788 Cortex M3 architecture (specifically an Embedded Artists LPC1788-32 Developer's Kit.) I'm using Keil U-Link as my IDE deploy/test environment. One thread in my application requires a very large stack. For that reason, I am using using os_sys_init_user to create a thread for which I pass a stack area which I have allocated from the SDRAM available on the development board, external to the processor.
The internal SD RAM range is at 0x1000000 (64 Kilobytes.) My external SDRAM starts at 0xA11100000 at which I have set up for 16 Megabytes.
The problem that I see is that when I create the task either using os_sys_init_user or by using os_tsk_create_user is that even though I specify my stack to be at 0xA11100000 and I attempt to allocate 256 Kilobytes, when I stop the debugger in my created task's context, the Stack Pointer R13 is in the 0x1000XXXX range. The RTX API has not honoured the stack that I have assigned to it.
As required I made sure that my stack base address was 8 byte aligned.
To test my sensibilities, I manually changed the stack pointer at the entry of the stack main. I did mov R13, 0xa11100000 and I can run that one task without failure. However if I use this and other tasks try to use OS services, I end up getting a hard fault.
Did I do something wrong when I created the task? I'm not sure why it's not honouring my stack pointer. Also I am not sure I understand why I can't change the stack pointer manually.
Please advise me
Eric T.