Hi,
I want to save a U-Boot current stack pointer so I could use my own stack in my stand alone U-boot program. I know already how to set a stack pointer, but I can't manage to get a current stack pointer. I tried:
int OldStackPointer;
int * pStack;
{
//...
pStack = &OldStackPointer;
asm volatile ( "LDR R0, %0" : : "m" (pStack) );
asm volatile ( "STR SP, [R0]" );
//...
}
But it doesn't work. The variable OldStackPointer doesn't change.
I also tried:
asm volatile ( "STR SP, =OldStackPointer" );
But it doesn't compile.
I run this on ARM core of OMAP3530 under U-Boot bootloader. I use arm-none-eabi-gcc compiler.
Best regards
Thomas