Skip to main content
Graduate
May 1, 2021
Solved

How to configure DFU from Cube MX

  • May 1, 2021
  • 3 replies
  • 2008 views

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.

    This topic has been closed for replies.
    Best answer by ABatt.1

    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

    3 replies

    Technical Moderator
    May 10, 2021

    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

    Technical Moderator
    May 18, 2021

    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

    ABatt.1AuthorAnswer
    Graduate
    May 23, 2021

    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

    Technical Moderator
    May 24, 2021

    Thanks @ABatt.1​ :smiling_face_with_smiling_eyes: