[STM32L476RG] Jump to Bootloader from Software.
Hello,
I want to use DFU for update my program on the STM32L476RG. I use a personnal board. When I put BOOT0 to VCC, the Bootloader start and we can change the firmware but my system is on battery and I have no access to BOOT0 pin and RESET.
So I want to jump in bootloader directly from software for that I have search the start addresse of system memory of the MCU -> 0x1FFF0000. So this is my code :
#define USBD_DFU_APP_DEFAULT_ADD 0x1FFF0000
pFunction JumpToApplication;
uint32_t JumpAddress;
/***
**** some code HERE
***/
HAL_RCC_DeInit();
HAL_DeInit();
SysTick->CTRL = 0;
SysTick->LOAD = 0;
SysTick->VAL = 0;
//_HAL_REMAPMEMORY_SYSTEMFLASH();
/* Jump to user application */
JumpAddress = *(__IO uint32_t*) (USBD_DFU_APP_DEFAULT_ADD + 4);
JumpToApplication = (pFunction) JumpAddress;
/**
* Step: Disable all interrupts
*/
__disable_irq();
__HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH();
/* Initialize user application's Stack Pointer */
__set_MSP(*(__IO uint32_t*) USBD_DFU_APP_DEFAULT_ADD);
JumpToApplication(); �?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?
When I use this code the system reset but not in DFU mode. What I have miss for do a good reset DFU ?
I have try theUSBD_DFU_APP_DEFAULT_ADD to 0x00000000 no change.
Thanks,
Loïc
