From 55b30588ed6acd10096f524e7d15638923df352a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Thu, 2 Jan 2020 13:00:49 +0100 Subject: [PATCH] bootloader: add legacy DFU force method --- bootloader.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bootloader.c b/bootloader.c index 7a47a96..e322f40 100644 --- a/bootloader.c +++ b/bootloader.c @@ -44,6 +44,8 @@ void main(void) __dfu_magic[1] = 0; __dfu_magic[2] = 0; __dfu_magic[3] = 0; + } else if (0 == (RCC_CSR & 0xfc000000)) { // no reset flag present -> this was a soft reset using scb_reset_core() after clearing the flags using RCC_CSR_RMVF, this was the legacy way to start the DFU mode + dfu_force = true; } else { // check if the force DFU mode input is set // disable SWJ pin to use as GPIO #if (GPIO(B) == GPIO_PORT(DFU_FORCE_PIN)) && (GPIO(4) == GPIO_PIN(DFU_FORCE_PIN))