Skip to main content
Pranay Dhuri
Associate III
May 16, 2017
Solved

STM32F2 nucleo board not leaving DFU mode.

  • May 16, 2017
  • 1 reply
  • 1162 views
Posted on May 16, 2017 at 12:47

I am using DFU source code for nucleo board available in STM32F2Cube.I have generated .dfu file from existing GPIO code. but when i am upgrading the dfu file into nucleo board it is showing as upgrade successful and after clicking on leave DFU mode it is indicating successfully left DFU mode but it is again coming back to DFU mode.

I am using

-SW4STM32 for generating binary/hex

-DfuSeDemo v3.0.5

-while converting from bin to dfu i am giving address as 0x08008000

Note: this post was migrated and contained many threaded conversations, some content may be missing.
    This topic has been closed for replies.
    Best answer by Imen.D
    Posted on May 16, 2017 at 14:22

    Try to update this code on the main.c of the DFU application as below:

    /* Test if user code is programmed starting from address 0x0800C000 */

    if(((*(__IO uint32_t*)USBD_DFU_APP_DEFAULT_ADD) & 0x2FFE0000 ) == 0x20000000)

    to this line:

    /* Test if user code is programmed starting from address 0x0800C000 */

    if(((*(__IO uint32_t*)USBD_DFU_APP_DEFAULT_ADD) & 0x2FFC0000 ) == 0x20000000)

    Please, keep me informed then about your updates.

    Imen

    1 reply

    Technical Moderator
    May 16, 2017
    Posted on May 16, 2017 at 13:21

    Hi

    Dhuri.Pranay

    ,

    WhichPlatform used (board, device, how USB is connected on the board) ?

    Check the sector count !

    It maybe causes the problem or probablyyou have issue on the file you are using.

    So, please make sure to use a correct .dfu file, to perform download and verify before Leave DFU mode.

    If you are using

    STM32F207ZG-Nucleo, y

    ou can find a reference .dfu file on the last version of Cube firmware STM32CubeF2 v1.4.0:

    STM32Cube_FW_F2_V1.4.0\Projects\STM32F207ZG-Nucleo\Applications\USB_Device\DFU_Standalone\Binary

    I hope this helps you.

    Regards

    Imen

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
    Pranay Dhuri
    Associate III
    May 16, 2017
    Posted on May 16, 2017 at 13:57

    Hi....dfu file which is provided in STM32cubeF2 is working for me but my generated dfu files giving problem...i have attached  dfu file.

    Imen.DBest answer
    Technical Moderator
    May 16, 2017
    Posted on May 16, 2017 at 14:22

    Try to update this code on the main.c of the DFU application as below:

    /* Test if user code is programmed starting from address 0x0800C000 */

    if(((*(__IO uint32_t*)USBD_DFU_APP_DEFAULT_ADD) & 0x2FFE0000 ) == 0x20000000)

    to this line:

    /* Test if user code is programmed starting from address 0x0800C000 */

    if(((*(__IO uint32_t*)USBD_DFU_APP_DEFAULT_ADD) & 0x2FFC0000 ) == 0x20000000)

    Please, keep me informed then about your updates.

    Imen

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks