cancel
Showing results for 
Search instead for 
Did you mean: 

How to Jump Bootloader(UART1) from Application for STM32F103

LYS
Associate II

I am new to STM32F103

and My goal is to Update Firmware using Bootloader.

but I do not want to use Hardware way as Pin BOOT0.

I want to enter bootloader mode using Backup Register.

here is my code

============================

if (BKP->DR1 != 0) //DR != 0 means, that boot request has been sent

 {

 uint32_t *stack_ptr = (uint32_t *)FW_ADDR;

  __disable_irq(); // Good idea when messing with MSP/VTOR

 #if 1

  LL_RCC_DeInit();

 #elif 0

  HAL_DeInit();

 #else

  //__HAL_RCC_AHB1_FORCE_RESET();

  //__HAL_RCC_AHB1_RELEASE_RESET();

 #endif

  SysTick->CTRL=0;

  SysTick->LOAD=0;

  SysTick->VAL=0;

  __set_PRIMASK(1);

  SCB->VTOR = FW_ADDR;

 #if 0

  __set_MSP(*(volatile uint32_t *)FW_ADDR);

 #else

   __set_MSP(0x20001000); // Use value found at 0x1FFF0000

 #endif

  __set_CONTROL(0);

  // Call the reset handler (the construct below is 'pointer to a pointer to a function that takes no arguments and returns void')

  void (*SysMemBootJump)(void) = (void *)*(volatile uint32_t *)(FW_ADDR + 4);

  SysMemBootJump();  // Call it as if it were a C function

 }

====================================

But "Flash Loader Demonstrator" says

"Cannot get available commands,..."

If someone has the solution, please share it with me.

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you for the reply.

I got the answer from STMicroelectronics

It is impossible to jump the system Bootloader(0x1FFFF000).

Because STM32F1 series does not support the memory remap function.

View solution in original post

4 REPLIES 4
Uwe Bonnes
Principal II

There have been many threads with good advice on this subject. Search these threads!

I already found some threads but failed.

and there is not much about STM32F1 series.

If you have any threads that could help me, please let me know.

Uwe Bonnes
Principal II

Best way to enter the bootloader is code that just after boot checks for the bootloader condition. No IRQs, no PLL setup and nothing more that could interfere. If things do nor work as expected, single step in the debugger to see what is going wrong.

Thank you for the reply.

I got the answer from STMicroelectronics

It is impossible to jump the system Bootloader(0x1FFFF000).

Because STM32F1 series does not support the memory remap function.