Hi,
I have been trying to find a stack / heap problem and finally noticed that the stack (SP) isn't actually initialized in 'startup_qn9090.c' / 'startup_qn9090.cpp' ? I have modified the file adding the following if not a 'WarmMain'.
__asm volatile(
"LDR R0,=_vStackTop\t\n"
"MOV SP,R0\t\n"
);
I must be missing something? Could somebody please put me out of my misery - where is the stack normally initialized - will my addition cause destruction and mayhem later?!
TIA.
Hello,
Hope you are doing well. Could you please clarify what SDK version are you using?
Also, what do you mean with "stack (SP) isn't actually initialized in 'startup_qn9090.c'"?
This is the section code where the SP register is initialized:
And also, this other section (warm start) modifies the SP register:
Best Regards,
Ricardo
Hi,
in the function ResetISR, the 'beq.n masterboot' is executed so SP not setup.
In the function ResetISR2 WarmMain is false and SP is not setup.
Maybe you could explain masterboot and WarmMain?
SDK is 2.6.4
Thanks.
Hi,
I apologize for a late reply. But, the SP is configure at a library level.
You can see on the connectivity.ld file:
PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RAM_Bank7 );
The _vStackTop is used on the g_pfnVectors (from the startup_qn9090.c).
But, could you please give more details about your stack issue? The SP should be correctly configured at the start of the application.
Regards,
Ricardo