DFU: fix transitions between runtime and DFU mode

we now always go through a processor reset to avoid any state that might
be persistent/left-over during the switch.
This commit is contained in:
Harald Welte committed 2017-03-03 00:34:17 +01:00
1 parent db17e83960
commit d1e963479e
5 files changed
+27 -13

No files matched your search

@@ -457,7 +457,7 @@ void USBDFU_Initialize(const USBDDriverDescriptors *pDescriptors)
void USBDFU_SwitchToApp(void)
{
/* make sure the MAGIC is not set to enter DFU again */
*(unsigned int *)USB_DFU_MAGIC_ADDR = 0;
g_dfu->magic = 0;
printf("switching to app\r\n");
@@ -468,7 +468,6 @@ void USBDFU_SwitchToApp(void)
__disable_irq();
/* Tell the hybrid to execute FTL JUMP! */
//BootIntoApp();
NVIC_SystemReset();
}