This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Startup.s settings with two applications

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

Parents
  • 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() ;
    }
    

Reply
  • 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() ;
    }
    

Children