cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F427 USB DFU DEMO PROJECT

stefanofante9
Associate II
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?

1 REPLY 1
Imen.D
ST Employee
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

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