Skip to main content
stefanofante9
Associate II
August 4, 2017
Question

STM32F427 USB DFU DEMO PROJECT

  • August 4, 2017
  • 1 reply
  • 692 views
Posted on August 04, 2017 at 11:24

Hi, the STM32F427 has 256KB ram.

In the file  USB_Device/DFU_Standalone/Src/main.c

/* Test if user code is programmed starting from USBD_DFU_APP_DEFAULT_ADD address */

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

{

/* Jump to user application */

JumpAddress = *(__IO uint32_t*) (USBD_DFU_APP_DEFAULT_ADD + 4);

JumpToApplication = (pFunction) JumpAddress;

/* Initialize user application's Stack Pointer */

__set_MSP((*(__IO uint32_t*) USBD_DFU_APP_DEFAULT_ADD ));

JumpToApplication();

}

the boot fail at the BOLD line.

If the initial stack pointer is located in a position greater than 64K the IF fail.

I think that for a microcontroller with 256KB of ram the condition shold be:

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

Do you have any comment?

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    August 4, 2017
    Posted on August 04, 2017 at 12:16

    Hello,

    You are right

    Fante.Stefano

    .

    We are aware about this issue related tothe DFU application on HAL firmware and it will fixed in coming releases.

    You should 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)

    Best 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