cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure the DFU ( bootloader USB ) on stm32f7 ?

elmzaiti youssef
Associate II
Posted on June 22, 2017 at 09:07

hello , 

      How to configure the DFU ( bootloader USB ) on stm32f7  ? 

2 REPLIES 2
Nesrine M_O
Lead II
Posted on June 22, 2017 at 10:41

Hi

youssef.elmzaiti

,

I recommend you to have alook to :

Please refer to UM0412,

http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/stsw-stm32html

USB device firmware upgrade STMicroelectronics extension for more details

on the driver installation and PC host user interface.

-Nesrine-

Posted on June 22, 2017 at 15:16

Hi Nisrina 

we want to migrate from stm32f4xx to stm32f7xx , so this program bootloader DFU on stm32f4xx , it's works , and no on stm32f7xx 

void bootloader_DFU_400(void )

{

/* La fonction est compilée uniquement si on est sur un micro STM32F4xx */

typedef void (*pFunction)(void);

pFunction Jump_To_Application;

vu32 JumpAddress;

GPIO_InitTypeDef GPIO_InitStructure;

vu8 bouton_DFU;

/* Activation Clock GPIO_BP_DFU */

RCC_AHB1PeriphClockCmd( RCC_GPIO_BP_DFU, ENABLE );

/* Configuration de PE3 en entrée */

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;

GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;

GPIO_InitStructure.GPIO_Pin = PIN_BP_DFU;

GPIO_Init( GPIO_BP_DFU, &GPIO_InitStructure );

/*

Lecture de l'état du bouton DFU

0 : Bouton DFU appuyé

1 : Bouton DFU relaché

*/

bouton_DFU = GPIO_ReadInputDataBit( GPIO_BP_DFU, PIN_BP_DFU );

/* Si le bouton est appuyé (bouton_DFU = 0) on lance le programme du DFU */

if ( bouton_DFU == 0x00 )

{

JumpAddress = *(vu32*) (ADRESSE_FLASH_DFU + 4);

Jump_To_Application = (pFunction) JumpAddress;

RCC->APB2ENR = 0x00004000; //ChL 15/04/2016 besoin de ces 2 lignes pour les micros serie F42x et supérieurs

SYSCFG->MEMRMP = 0x00000001; //ChL 15/04/2016 besoin de ces 2 lignes pour les micros serie F42x et supérieurs

/* Initialize user application's Stack Pointer */

__set_MSP(*(vu32*) ADRESSE_FLASH_DFU);

Jump_To_Application();

}

else

{

if (((*(vu32*)ApplicationAddress) & 0x2FFE0000 ) == 0x20000000)

{ /* Jump to user application */

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

/* Jump to user application */

JumpAddress = *(vu32*) (ApplicationAddress + 4);

Jump_To_Application = (pFunction) JumpAddress;

/* Initialize user application's Stack Pointer */

__set_MSP(*(vu32*) ApplicationAddress);

Jump_To_Application();

}

}

}