For example, is it at the beginning of RAM, user or silicon vendor defined?
I'd like to know such that I can identify the stack boundaries in memory and therefore know if I've caused a stack overflow in my code.
My device is an LPC1778, and Im using keil uvusion v4.
Many thanks!
It's not vendor-defined in any way other than the vendor/manufacturer will provide some suitable memory at a particular location. In a Cortex-M3, RAM can only be located at certain specific address ranges in t he address map so you will always find the stack located in one of these.
The exact starting address of the stack pointer (the top of the stack) is defined by the startup code in the program which runs at reset. As you found, the processor reads the first two words of memory on startup. The first word is used for the initial stack pointer value and the second word for the address of the reset handler.
Hope this helps.
Chris