USB DFU on STM32F407IG not recognized by Windows 10
Hi,
I use the following code to jump to the bootloader:
typedef void (*pFunction)(void); /*!< Function pointer definition */
#define SYSMEM_ADDRESS (uint32_t)0x1FFF0000
void Bootloader_JumpToSysMem(void)
{
uint32_t JumpAddress = *(__IO uint32_t*)(SYSMEM_ADDRESS + 4);
pFunction Jump = (pFunction)JumpAddress;
HAL_RCC_DeInit();
HAL_DeInit();
SysTick->CTRL = 0;
SysTick->LOAD = 0;
SysTick->VAL = 0;
__HAL_RCC_SYSCFG_CLK_ENABLE();
__HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH();
__set_MSP(*(__IO uint32_t*)SYSMEM_ADDRESS);
Jump();
while(1)
;
}
int main(void)
{
HAL_Init();
SystemClock_Config();
Bootloader_JumpToSysMem();
}
Notes:
- The app HAL-based skeleton is generated by the latest STM32CubeMX separatelly for STM32F411CE and STM32F407IG
- The code works FINE on STM32F411CE (W10 recognizes the USB and I am able to upload the code through STM32Programmer)
- The code fails when I use STM32F407IG (W10 does NOT recognize the USB device)
- Same W10 PC used in both cases
- PA11/PA12 in both cases are connected the same way (no external D+ pull-up used but the voltmeter shows that that D+ is pull-ed up - probably internally)
- I CANNOT set boot0/boot1 pins to test the USB DFU functionality without jumping to the bootloader from my app (these pins are not available to me)
- 25MHz crystal is used in the case of STM32F407
If you could share any tips why the STM32F411 may behave differently than STM32F407 in this case.
