We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hallo
I have a bootloader and a application. My bootloader sets up the stack sizes in its startup file. My application setes them up differently.!
So when my bootloader jumps to the main application are the stack setup those from the bootloader or are they setup as in my application?
Thomas
No. you will have to make your jump function a SWI function:
// switch to supervisor mode so that stacks in the next startup file can be set (once is // user mode, only an exception can bring the processor out of it. SWI is such an exception.) void __swi(0) jump_to_application_code(void); void __SWI_0 (void) { void (*lp_application_start)(void); // interrupt vectors are mapped using the RAM_INTVEC REMAP RAM_MODE macros in the ASM tab of uv3 lp_application_start = (void (*)(void))APPLICATION_FLASH_START; lp_application_start(); } int main(void) { init_firmware() ; jump_to_application_code() ; }
Ok, I see. Thanks a lot.
But another way could be to just have identical startup files in the two application (Share the startup.s file between the two projects). I know its not pretty. but then there is no need for set new stacks