AnsweredAssumed Answered

IAP Issue rebooting with other flash address

Question asked by v.ramasubbu on Nov 16, 2017

Hi,

 

For IAP of STM32F407

 

I am using mikro C pro arm compiler 

 

After written my downloaded application to the flash address from (0x08080000) 

am trying to reboot from that address but its does n't work   

 

 

the below steps i have done 

1,I have changed the vector table offset to that address 
2,I have changed the stack pointer to that address 
3,Switching that address through function pointer 

 

Below i have attached that part of code

 

Code: Select all

typedef void  (*pEntryFunPtr)(void) ;

pEntryFunPtr  pJumpAddress = NULL ;

uint32_t * const vtableoffsetptr = 0xE000ED08 ;

uint8_t  FLash_Reboot_IAP(uint32_t  ui32StAdd){


        uint32_t  uiVt1 ;
        char ucTempArray[20] = "\0" ;
        if(vtableoffsetptr != NULL){
          // relocate the vector table address
          UART6_Write_Text("\r\n Application Rebooting ...");
          
         uiVt1 =  (ui32StAdd & 0xfffff ) << 9 ;
         *vtableoffsetptr |= uiVt1 ;
         pJumpAddress =  (pEntryFunPtr)(ui32StAdd) ;
         SP = ui32StAdd ;
         pJumpAddress();
       }
       return FALSE ;
}

Outcomes