We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello, I am trying to build a custom bootloader which is jumping in the application. In order to do this in a first approach, i wrote a Bootloder which jumps as follows:
For the application I changed the VET_TAB_OFFSET to 0x000A0000UL.
In Keil Settings Target I changed the Read/only Memory Areas:
IROM1 : Start 0x80A000 Size 0x60000
In the Target Options I unchecked Use Memory Layout from Target Dialog
For R/O Base I put 0x080A0000
My scatter file for the application:
LR_IROM1 0x080A0000 0x00060000 { ; load region size_region ER_IROM1 0x080A0000 0x00060000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) .ANY (+XO) } RW_IRAM1 0x20000000 0x00020000 { ; RW data .ANY (+RW +ZI) } RW_IRAM2 0x24000000 0x00080000 { .ANY (+RW +ZI) } } LR_IROM2 0x08100000 0x00100000 { ER_IROM2 0x08100000 0x00100000 { ; load address = execution address .ANY (+RO) } }
For the Bootloader
; ************************************************************* ; *** Scatter-Loading Description File generated by uVision *** ; ************************************************************* LR_IROM1 0x08000000 0x000A0000 { ; load region size_region ER_IROM1 0x08000000 0x00A0000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) .ANY (+XO) } RW_IRAM1 0x20000000 0x00020000 { ; RW data .ANY (+RW +ZI) } RW_IRAM2 0x24000000 0x00080000 { .ANY (+RW +ZI) } } LR_IROM2 0x08100000 0x00100000 { ER_IROM2 0x08100000 0x00100000 { ; load address = execution address .ANY (+RO) } }
I use Keil with the MDK Plus Toolchain on the STM32H753.
I do the jump on the bootloader as follows and nothing happens:
void start_app() { uint32_t JumpAddress = *(volatile uint32_t*) (JUMP_ADDR+4); void (*jump_to_application)(void)= (void*) JumpAddress; HAL_RCC_DeInit(); __disable_irq(); __set_MSP(*(__IO uint32_t*) JUMP_ADDR); // Disable systick timer and reset it to default values SysTick->CTRL = 0; SysTick->LOAD = 0; SysTick->VAL = 0; //__disable_irq(); //__DSB(); SCB->VTOR = JUMP_ADDR; jump_to_application(); }
What could be the reason?