Reputation: 9
i write bootloader in 0x8000000 to flash data of new code in address 0x800D000 by this function :
void flash_jump_to_app(void)
{
HAL_RCC_DeInit();
HAL_DeInit();
__disable_irq();
SCB->VTOR = FIRST_TARGET_ADDRESS;
asm("movw r0,#0xD000 \n");
asm("ldr sp , [r0] \n");
asm("ldr r0 , [r0,#4] \n");
asm("bx r0 \n");
}
and when new main_app start generate HardFault with these data
HSFR = 0x40000000
BFSR = 0x00000082
BFAR = 0X20005000
i think its error in vector table but i don't find it
LINKER FOR BOOTLOADER :
/* Entry Point */
ENTRY(Reset_Handler)
/* Highest address of the user mode stack */
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of RAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x200; /* required amount of heap */
_Min_Stack_Size = 0x400; /* required amount of stack */
/* Specify the memory areas */
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 30K
}
LINKER OF APPLICATION :
ENTRY(Reset_Handler)
/* Highest address of the user mode stack */
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */
_Min_Heap_Size = 0x200; /* required amount of heap */
_Min_Stack_Size = 0x400; /* required amount of stack */
/* Memories definition */
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K
FLASH (rx) : ORIGIN = 0x800D000, LENGTH = 33K
}
I TRY MANY TIMES TO CHANGE LINKER BUT CAN'T
Upvotes: 0
Views: 44