cancel
Showing results for 
Search instead for 
Did you mean: 

how to call the STM32 embedded USB DFU bootloader from the application without using boot pin?

VK Verma
Senior

Hi,

I tried all available suggestions in this community on similar topic but non worked to call the STM32 embedded USB DFU bootloader from the application without using boot pin.

Whereas It is successfully able to  enter in STM32 DFU mode when boot pin set to low.

Another important issue is with STM32cubeProgramer Version  2.13.0 on windows 11 which is not unable to detect the STM32 DFU device, whereas Dfuse Demo Version 3.0.6 is able to detect it.

Any support will be appreciated.

Regards,

VK Verma

@Peter BENSCH 

 

 

6 REPLIES 6
MM..1
Chief II

First search then test and then write here what is problem.

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

Hi,

I have used below code taken from the CubeF7 repository, it only reset the device but does not enumerate as DFU device in windows device manager, but same can be achievable using hardwired boot pin.

Regards,

VK Verma

 

void Jump_2_bootloader (void)
{
/* Reinitialize the Stack pointer and jump to application address */
JumpAddress = *(__IO uint32_t *) (0x1FFF0000 + 4);
Jump_To_Application = (pFunction) JumpAddress;
/* Initialize user application's Stack Pointer */
__set_MSP(*(__IO uint32_t*) 0x1FFF0000);
Jump_To_Application();
}

MM..1
Chief II

Your jump seems dont handle ISRs if any enabled in your APP. For check call your jump as first line in main.

I preffer this method with watchdog reset flags use...

Hi,

I did as you suggested and called the bootloader jump in the starting of main and it worked, but not at another location when called in some function. Can you suggest some way to call it from other file or inside other function as this does not serve any purpose at all.

Thanks for your value able suggestions.

Regards,

VK Verma

 

 

MM..1
Chief II

Have you unused IWDG or WWDG ? If yes then use it on place where you need start bootloader. 

And in main leave call to jump

void main()
{
if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST))
{	__HAL_RCC_CLEAR_RESET_FLAGS();
jumpcall
}
VK Verma
Senior

Hi,

Your suggestions greatly helped me. The problem is solved.

Thanks a lot,

Regards,

VK verma