You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- "(uint32_t)APPLICATION_ADDRESS + 4" simply suppresses an warning from the
compiler (related to doing arithmetic on void* pointers).
- "applicationResetHandler" is now static, to avoid placing it on the stack, since
it is used after the stack pointer is set to the application's stack pointer.
- while(1) is needed for armcc. Without it, armcc insists to jump to the
application's entry point only *after* restoring the context of
"forwardControlToApplication":
806c: f380 8808 msr MSP, r0
8070: 481d ldr r0, [pc, ARMmbed#116] ; (80e8 <forwardControlToApplication+0xe8>)
8072: 6004 str r4, [r0, #0]
8074: 6828 ldr r0, [r5, #0]
8076: e8bd 4070 ldmia.w sp!, {r4, r5, r6, lr} ==> context restore
807a: 4700 bx r0 ==> jump to application
This changes the application's initial stack pointer. Because of this, the
cloud client example doesn't start anymore when concatenated with the bootloader.
With "while(1);" in place, we get the right behaviour:
806a: f380 8808 msr MSP, r0
806e: 481d ldr r0, [pc, ARMmbed#116] ; (80e4 <forwardControlToApplication+0xe4>)
8070: 6004 str r4, [r0, #0]
8072: 6828 ldr r0, [r5, #0]
8074: 4780 blx r0 ==> jump to application
Tested with armcc 5.03 update 3. Also tested that the GCC compilation still works
with these changes in place.
0 commit comments