2025-06-05 2:12 AM - last edited on 2025-06-05 2:37 AM by Andrew Neil
Hi team,
We are working on the custom bootloader on stm32u073RC. not able to jump on the specific location.
#define APPLICATION_PARTITION_1 0x0801D000
void jump_to_application_partition_1(void)
{
/* Disable Interrupts */
__disable_irq();
/* Get the stack pointer and reset vector from the backup application section */
uint32_t app_stack_pointer_1 = *(volatile uint32_t *) APPLICATION_PARTITION_1;
uint32_t app_reset_vector_1 = *(volatile uint32_t *) (APPLICATION_PARTITION_1 + 4);
/* Mapping of the backup application reset vector */
pfunction app_entry_1 = (pfunction) app_reset_vector_1;
/* Setting of the vector table to backup application */
SCB->VTOR = APPLICATION_PARTITION_1;
/* Setting MSP - (Main Stack Pointer) */
__set_MSP(app_stack_pointer_1);
/* Enable Interrupts */
__enable_irq();
/* Jump to backup application */
app_entry_1();
}
Thanks,
Shubham
2025-06-05 2:35 AM
No source available for "__udivmoddi4() at 0x80003ce"
2025-06-05 4:18 AM
Step through the code, what happens after the call to app_entry_1?
It would be better to disable interrupts as in the example code.
How to jump to system bootloader from application ... - STMicroelectronics Community
2025-06-05 12:33 PM
Your variables app_stack_pointer_1, app_reset_vector_1, app_entry_1 may be located on the stack.
Line 20 (__set_MSP) moves the stack pointer. What do you think happens to the variables on the stack?