cancel
Showing results for 
Search instead for 
Did you mean: 

Firmware upgrade problem

Hardeep Singh
Associate II

How to make DFU jump to a location from where the Factory USB DFU of STM32F070xx resides and it takes control from there? This task is to be achieved using application code instead of the hardware method to pull BOOT0 pin low.

We are able to do the Firmware upgrade through DFU USB boot loading by pulling BOOT0 pin in hardware externally. In this case STM32 Factory DFU USB Bootloader was called.It was successful.

3 REPLIES 3
Hardeep Singh
Associate II

I was able to run my application code and enter DFU mode by setting up the variable in RAM.

Now next level issue is that I need to enter DFU mode in 3-4 separate conditions where I have a code for each application. In order to achieve this I need to set the STACK Pointer for each application. Please suggest how to do that using __set_MSP(*(__IO uint32_t*)startAddress) function which is used in the available libraries. Kindly provide some sample code snippet which explains how to achieve this.

One of the cleanest ways to ensure the correct stack is to have the code in Reset_Handler explicitly load the SP with __initial_sp

The _set_MSP​ should be pulling the value from the vector table of each app, is it not doing that?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

What exactly will be the __initial_sp here? Do you mean to say that whatever pointer I set, for each application, will automatically be taken by the __set_MSP(), and entering the DFU should be possible in each condition?

How will I provide the address for any application when its corresponding condition arises? In my case, out of 4 conditions, any one will occur at one time and then CPU has to enter DFU mode.

I think I should use the Stack pointer for DFU Bootloader in each application instead of using jump statements in the reset handler, to select which condition occurred. Please suggest.