What is the correct way to jump from application FW to the DFU bootloader on the STM32F078VB, using a project generated with the latest STM32CubeMX?
I have an existing STM32F078VB firmware application. The following code used to work perfectly fine to jump to the DFU bootloader shortly after power up, based on the application firmware detecting 2 buttons being pressed on the board:
#define BOOT_STACK_ADDR 0x200014A8 /**< Bootloader stack address */
#define SYS_MEM_START_ADDR 0x1FFFC800 /**< System memory start address */
void DfuStart(void)
{
void (*boot_jump)(void);
/**
* Disable peripheral clocks
*/
__HAL_RCC_GPIOE_CLK_DISABLE();
__HAL_RCC_GPIOD_CLK_DISABLE();
__HAL_RCC_GPIOA_CLK_DISABLE();
__HAL_RCC_GPIOB_CLK_DISABLE();
__HAL_RCC_GPIOC_CLK_DISABLE();
__HAL_RCC_GPIOF_CLK_DISABLE();
HAL_DeInit();
HAL_RCC_DeInit();
/**
* Disable systick
*/
SysTick->CTRL = 0;
SysTick->LOAD = 0;
SysTick->VAL = 0;
/* Disable Timer 6 which is used as HAL tick source. */
__HAL_RCC_TIM6_CLK_DISABLE();
/* NOTE WELL: Do NOT disable interrupts here! */
/**
* Run to stack pointer and execute code from system memory
*/
__set_MSP(BOOT_STACK_ADDR);
boot_jump = (void (*)(void))(*((uint32_t *)(SYS_MEM_START_ADDR + 4)));
boot_jump();
while (1);
}Recently, I upgraded from STM32CubeMX 5.2.1 to version 5.6.0, and regenerated the project files (with no other changes to my application). Now, the above code no longer works, it just resets and restarts the application firmware, rather then entering the DFU bootloader.
Any ideas what changed in the CubeMX generated startup code that would cause this?
