I am trying to jump from my application into the bootloader. It works as long as I pull the pin BOOT0 high, which in my case means setting a jumper.
Is there a way to get into the bootloader while BOOT0 is pulled low?
My device is STM32L412.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-03 2:10 AM
Device: STM32L412
Code:
typedef void (*pFunction)(void);
volatile uint32_t addr = 0x1FFF0000;
uint32_t JumpAddress = *(__IO uint32_t*) (addr + 4);
pFunction Jump_To_Boot = (pFunction) JumpAddress;
#if defined(USE_HAL_DRIVER)
HAL_RCC_DeInit();
#endif /* defined(USE_HAL_DRIVER) */
#if defined(USE_STDPERIPH_DRIVER)
RCC_DeInit();
#endif /* defined(USE_STDPERIPH_DRIVER) */
SysTick->CTRL = 0;
SysTick->LOAD = 0;
SysTick->VAL = 0;
__disable_irq();
__HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH();
__set_MSP(*(__IO uint32_t*) addr);
Jump_To_Boot();
SOURCE: https://stm32f4-discovery.net/2017/04/tutorial-jump-system-memory-software-stm32/
I also tried configuring BOOT0 pin as ouput and setting it high before Jump_To_Boot() but without success.
- Labels:
-
Bootloader
-
STM32F4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-03 3:16 AM
The hardware method
Add some external components to the pin so it can hold its state for a couple of microseconds.
The software method
Boot pins can be overridden by the nSWBOOT0, nBOOT0, nBOOT1 user option bits
but then you'll have to change them back through the DFU or serial bootloader interface to be able to boot from main flash again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-03 4:37 AM
Thank you for this very fast and accurate response. Amazing!
:)
(I will implement the hardware method on the next board revision.)
