Can't make software jump to Bootloader/DFU on STM32F767
I've read various articles/guides how to jump to bootloader form main program (without using boot0 pin and reset). All code that I've tried seems to fail...
My current approach is like this:
#define BOOTLOADER_ADDR 0x1FF00000U
void (*SysMemBootJump)(void);
void JumpToBootloader(void)
{
vTaskSuspendAll();
HAL_RCC_DeInit();
SysTick->CTRL = 0;
SysTick->LOAD = 0;
SysTick->VAL = 0;
__disable_irq();
SysMemBootJump = (void (*)(void)) (*((uint32_t *)(BOOTLOADER_ADDR + 4)));
__set_MSP (*((uint32_t*) BOOTLOADER_ADDR));
SysMemBootJump();
while(1);
}Looks good but it doesn't work... however not completely....
When I use Boot0 pin and reset it STM32F767VIT goes to bootloader/DFU mode and DfuSe detects STM32F7 device correctly.
When runs code as above, it jumps somewhere, but DfuSe do not detect device to flash. After a while Windows reports unknown device - 43 error code (A request for the USB device descriptor failed). It seems that I'm close... but no clue how to fix it :unamused_face:
Edit:
I wonder if FreeRTOS is causing incorrect behaviour of bootloader. I've added "vTaskSuspendAll()" but this seems to be not enough.
Edit2:
To avoid FreeRTOS at this stage, I've called JumptoBootLoader() as first instruction in main() - nothing changes. Detected USB device is broken - 43 error code (A request for the USB device descriptor failed).
best regards
Mikolaj Tutak
