jump function
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-26 5:30 AM - last edited on 2025-03-26 5:33 AM by mƎALLEm
I have jump function this like that but this method don't work. Please I need help immedietly
void jumpToAddress(uint32_t jump_address)
{
void (*jumpFunction)(void);
static constexpr uint32_t SHIFTED_JUMP_ADDRESS_DUE_TO_RESET_HANDLER = 4;
static constexpr uint8_t NVIC_REGISTER_LENGTH = 8;
SCB_DisableDCache();
SCB_DisableICache();
__disable_irq();
SysTick->CTRL = 0;
HAL_RCC_DeInit();
for (uint8_t i = 0; i < NVIC_REGISTER_LENGTH; i++)
{
NVIC->ICER[i] = 0xFFFFFFFF;
NVIC->ICPR[i] = 0xFFFFFFFF;
}
SCB->VTOR = jump_address;
__set_MSP(*((uint32_t *)jump_address + SHIFTED_JUMP_ADDRESS_DUE_TO_RESET_HANDLER));
jumpFunction = (void (*)(void))(*((uint32_t *)((jump_address + SHIFTED_JUMP_ADDRESS_DUE_TO_RESET_HANDLER))));
__enable_irq();
jumpFunction();
while (1);
}
View more
Labels:
- Labels:
-
Bootloader
-
STM32H7 Series
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-26 5:31 AM
Hello,
Please use </> button to share your code.
See the tips on this link. I'm editing your post.
Thank you for your understanding.
To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
