Thank you for your really detailed response. Your hint "Check where your stack is located." lead me to the right location :-)
Here the complete solution for others with the same problem:
Following table shows the RAM setup (old and new desired version, the SRAM block 1 and 2 are not used)
Table not in scale!
| SRAM0 Address | |
|---|
| Top (End, 64kB) 0x0200'FFFF | Top of Stack (OLD place, wrong for my application) = __top_RAM0_64 |
| |
| |
| (End of first 8kB, SRM0A) 0x0200'2000 | Top of Stack (NEW place for my application) initial position of Stack pointer, growing downwards (in direction Bottom) |
| |
| |
| |
| Bottom (Start) 0x0200'000 | Variables in RAM (from Bottom up) |
The Memory locations are defined in LPCxpresso in following path:
MyProject/Debug/myproject_Debug_memory.ld
The Stack and Heap location is set in following file:
MyProject/Debug/myproject_Debug.ld - on Line 179 and 180 witt the define __user_heap_base and __user_stack_top
The heap pointer is on reset by default on location ??? (I'dont know, I don't need the heap until now because I didn't use dynamic memory allocation with malloc)
The stack pointer is on reset by default on location __top_RAM0_64 = 0x0200'FFFF (This is outside of the first 8kB of RAM, therefore after the wakeup, the CPU was lost with corrupted memory, the stack was killed by memory shutdown :-) )
To change the stackpointer to 0x0200'2000 (top of first 8kB = SRAM0A) I set the following Linker Flag:
Project / Properties / C/C++ Build / Settings / Tool Settings / MCU Linker / Add Flag:
--defsym=__user_stack_top=0x2002000
This solution is from the following thread:
How to modify the stack location?
Here is a list with topics concerning this question.
Stack location
Heap allocation/checking in Redlib
How can check stack level using IDE?
Monitoring Stack Size
How to use Watchpoints
Move (data) location into different RAM blocks:
Placing data into different RAM blocks
Move stack to RamAHB32
Stack placed in RAM2
How to modify the stack location?