I am new to boot loader program so this question may seem obvious. The main() codes for the STM USB DFU program for the STM32F4 is pasted below. I am a bit confused that I thought the USB DFU boot loader program should resides at address 0x1FFF77DE stated on STM AN2606 Application note. But on this USB DFU example, this program is supposed to be loaded onto memory location 0x8000000 which is usually for application. So if the program below is used to program a user binary, where would the user app go if the USB DFU is already at 0x8000000?
Thanks.
/* Check if the USER Button is pressed */ if(BSP_PB_GetState(BUTTON_USER) == 0x00) { /* 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(); } }
/* Otherwise enters DFU mode to allow user programming his application */ /* Init Device Library */ USBD_Init(&USBD_Device, &DFU_Desc, 0);
/* Add Supported Class */ USBD_RegisterClass(&USBD_Device, USBD_DFU_CLASS);
/* Add DFU Media interface */ USBD_DFU_RegisterMedia(&USBD_Device, &USBD_DFU_Flash_fops);
/* Start Device Process */ USBD_Start(&USBD_Device);