cancel
Showing results for 
Search instead for 
Did you mean: 

Hello, I use a stm32F469BG. I create a bootloader but the jump to the function doesn't work.

ludovic-micou2
Associate III

I have coded the function for the jump :

void vd_srv_BOOT_JumpToUserApp(uint32_t u32_AppAddr)

{

uint32_t temp = 0UL;

volatile uint32_t u32_JumpAddr = 0UL;

void (*pJumpToUserApp)(void) = (void*)0;

 /* Disable MPU */

// HAL_MPU_Disable();

 /* Disable HAL and HAL timer (TIM6) */

 HAL_SuspendTick();

 HAL_RCC_DeInit();

 HAL_DeInit();

 /* Disable interrupts for timers */

 HAL_NVIC_DisableIRQ(SysTick_IRQn);

 /* Clear any pending ones */

 HAL_NVIC_ClearPendingIRQ(SysTick_IRQn);

/* Prepare jump address */

SCB->VTOR = (unsigned long)u32_AppAddr;

u32_JumpAddr = *(__IO uint32_t*) (u32_AppAddr + 4UL);

/* Prepare jumping function */

pJumpToUserApp = (void (*)(void)) u32_JumpAddr;

/* Initialize user application's stack pointer */

__set_MSP(*(__IO uint32_t*) u32_AppAddr);

/* Jump.*/

pJumpToUserApp();

}

The u32_AppAddr have the address 0x0800C000. and in the project that is placed at the address 0x0800C000, I have the *.ld file with :

MEMORY

{

 CCMRAM  (xrw)  : ORIGIN = 0x10000000,  LENGTH = 64K

 RAM  (xrw)  : ORIGIN = 0x20000000,  LENGTH = 320K

 FLASH  (rx)  : ORIGIN = 0x800C000,  LENGTH = 976K

}

The function doesn't work. where is the problem?

1 REPLY 1
MM..1
Chief II

Dont place VTOR change to bootloader code, right is app code system_xx

/*!< Uncomment the following line if you need to relocate your vector Table in
     Internal SRAM. */
/* #define VECT_TAB_SRAM */
#define VECT_TAB_OFFSET  0xC000 /*!< Vector Table base offset field.
                                   This value must be a multiple of 0x200. */
/******************************************************************************/