2017-11-16 04:01 AM
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 workthe 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 codeCode:
https://forum.mikroe.com/viewtopic.php?f=178&t=71218
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 ;
}