QN9090 stack pointer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

QN9090 stack pointer

670 Views
alexedge
Contributor I

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.

Labels (3)
0 Kudos
3 Replies

649 Views
Ricardo_Zamora
NXP TechSupport
NXP TechSupport

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:

Ricardo_Zamora_0-1681513768907.png

 

And also, this other section (warm start) modifies the SP register:

Ricardo_Zamora_1-1681513768911.png

 

Best Regards,

Ricardo

0 Kudos

637 Views
alexedge
Contributor I

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.

0 Kudos

576 Views
Ricardo_Zamora
NXP TechSupport
NXP TechSupport

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

0 Kudos