Skip to main content
Associate II
May 1, 2026 04:42 UTC
Solved

jump to bootloader failed in stm32f765

Hi all,

I am trying to develop a bootloader software for STM32F765.

I requires two features in it.

1) jumping from Bootloader to Application

2) jumping from Application to Bootloader

I could make jump from Bootloader to Application very easily.

But I am suffering with jumping from Application to Bootloader for 4-5 days now.

The final code I tried is given below:

void Bootloader_JumpToBootloader_Program(void)
{
void (*app_reset_handler)(void);

__disable_irq();

SysTick->CTRL = 0 ;
SysTick->LOAD = 0;
SysTick->VAL = 0;
HAL_RCC_DeInit();
HAL_DeInit();

/* 2) disable all enabled interrupts */
NVIC->ICER[ 0 ] = 0xFFFFFFFF ;
NVIC->ICER[ 1 ] = 0xFFFFFFFF ;
NVIC->ICER[ 2 ] = 0xFFFFFFFF ;
NVIC->ICER[ 3 ] = 0xFFFFFFFF ;
NVIC->ICER[ 4 ] = 0xFFFFFFFF ;
NVIC->ICER[ 5 ] = 0xFFFFFFFF ;
NVIC->ICER[ 6 ] = 0xFFFFFFFF ;
NVIC->ICER[ 7 ] = 0xFFFFFFFF ;

NVIC->ICPR[ 0 ] = 0xFFFFFFFF ;
NVIC->ICPR[ 1 ] = 0xFFFFFFFF ;
NVIC->ICPR[ 2 ] = 0xFFFFFFFF ;
NVIC->ICPR[ 3 ] = 0xFFFFFFFF ;
NVIC->ICPR[ 4 ] = 0xFFFFFFFF ;
NVIC->ICPR[ 5 ] = 0xFFFFFFFF ;
NVIC->ICPR[ 6 ] = 0xFFFFFFFF ;
NVIC->ICPR[ 7 ] = 0xFFFFFFFF ;

// Set embedded bootloader vector table base offset
WRITE_REG(SCB->VTOR, SCB_VTOR_TBLOFF_Msk & 0x00000000);
__enable_irq();

// Instruction synchronization barrier
__ISB();

uint32_t msp_val = *(uint32_t *)SYSTEM_START_ADDRESS;////SYSTEM_START_ADDRESS

__set_MSP(msp_val);
__DSB(); // Data synchronization barrier
__ISB(); // Instruction synchronization barrier

uint32_t reset_handler_address = *(uint32_t *)(SYSTEM_START_ADDRESS + 4);////SYSTEM_START_ADDRESS

/* assign the reset handler address to reset handler */
app_reset_handler = (void *)reset_handler_address;
app_reset_handler = (void (*) (void))reset_handler_address;
/* Jump to reset handler of the User Application */
app_reset_handler();
}

Please share your valuable suggestions to solve the issue.

 

Sajeevan.K

 

 

MM..1
MM..1Best answer
Super User
May 1, 2026 06:53 UTC

Jumping into , dont work on MCUs with empty flash checks. I dont test 765, but other require before jump erase flash part 0. How you try this ? First step is test with hw way .

MM1_0-1777618366383.png

after this work, do jump from app.

8 replies

MM..1
MM..1Best answer
Super User
May 1, 2026 06:53 UTC

Jumping into , dont work on MCUs with empty flash checks. I dont test 765, but other require before jump erase flash part 0. How you try this ? First step is test with hw way .

MM1_0-1777618366383.png

after this work, do jump from app.

sajeevanAuthor
Associate II
May 8, 2026 05:30 UTC

Hi MM,

I have gone through the following link:

https://community.st.com/t5/stm32-mcus/empty-check-mechanism-on-stm32/ta-p/49369

This says Empty check mechanism need to be done only for the following series:

F0, C0, G0, L0, L4, U0, WL & WB. 

The series I am using is F7. I think Empty Check Mechanism is not applicable for STM32F765. 

MM..1
Super User
May 8, 2026 10:00 UTC

Empty check is only in system bootloaders. Your own bootloader is normal application here... RESET jump to it one line of code. Call NVIC Reset or start watchdog = reset.

Shirley.Ye
ST Employee
May 2, 2026 14:09 UTC

do you mean you want to jump from the application to the bootloader software you are writing? the bootloader here means the software you are writing or the bootloader inside the STM32F765 system memory and flashed in the manufacture?

Pavel A.
May 2, 2026 20:38 UTC

The OP says: "embedded bootloader". That's system memory.

 

ST Technical Moderator
May 5, 2026 15:10 UTC

Hello @sajeevan 

Please refer to the article below for inspiration. 

How to jump to system bootloader from application ... - STMicroelectronics Community

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om