cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure DFU from Cube MX

ABatt.1
Senior

Hi to all,

I want to configure DFU to create a USB bootloader for STM32F401RE (I need to understand it on this hardware for future implementation on different MCU). I have some questions.

I configure CubeMX as the .ioc file attached.

The main settings are:

USBD_DFU_APP_DEFAULT_ADD = 0x08008000

USBD_DFU_MEDIA Interface = @Internal Flash  /0x08000000/02*016Ka,02*016Kg,01*064Kg,03*128Kg

my main.c and usbd_dfu_if.c are attached.

I installed en.stsw-stm32080.

When I connect the STM32F401 to PC, Windows 10 recognize the device (enumerated as "STM32 DownLoad Firmware Update") but in DeFuSe Demo v3.0.6 I don't see any device available.

1) What can be the problem ?

Setting Application firmware.

First I compile th application after change th linker lik this

 FLASH  (rx)  : ORIGIN = 0x8008000,  LENGTH = 512K

Then I have to generate a .dfu file using "Dfu File manager":

VID and PID are ok, I get them from CubeMX, but

2) what do I put in Version and Target name?

After this, once "Multi BIN" has been opened,

3) what value should be entered in "Address 0x"?

I can't find any information about this questions, and watch example doesn't helped me.

Thanks for you answers.

1 ACCEPTED SOLUTION

Accepted Solutions
ABatt.1
Senior

Hi Imen,

I was unable to devote any more time to the project, I hope next week ... I have resolved the point indicated here by configuring the USB interrupt preemption priority to 1 in the NVIC settings in CubeMX.

For the other settings I am referring to MOOC video:

https://www.youtube.com/watch?v=n_LDXOQHerU&t=675s

I close this post at the moment, to reopen a second one in case of problems.

thanks for your help

View solution in original post

4 REPLIES 4
Imen.D
ST Employee

Hello @ABatt.1​ ,

Have a look at this article "DFU mode with system bootloader is not working, while USB does", and check if you have the same conditions as described.

Check also the USB cable, connectors and try with different cable.

I hope this helps and answers your question!

When your question is answered, please close this topic by choosing "Select as Best". This will help other users find that answer faster.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Imen.D
ST Employee

Hi @ABatt.1​ ,

Do you have still this problem to solve?

If your issue is solved, please do not hesitate to share the final solution you found.

Thanks by advance.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
ABatt.1
Senior

Hi Imen,

I was unable to devote any more time to the project, I hope next week ... I have resolved the point indicated here by configuring the USB interrupt preemption priority to 1 in the NVIC settings in CubeMX.

For the other settings I am referring to MOOC video:

https://www.youtube.com/watch?v=n_LDXOQHerU&t=675s

I close this post at the moment, to reopen a second one in case of problems.

thanks for your help

Thanks @ABatt.1​ :smiling_face_with_smiling_eyes:

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen