diff --git a/src/platforms/common/cdcacm.c b/src/platforms/common/cdcacm.c index ccf6706e..c16ddfea 100644 --- a/src/platforms/common/cdcacm.c +++ b/src/platforms/common/cdcacm.c @@ -416,7 +416,7 @@ static void dfu_detach_complete(usbd_device *dev, struct usb_setup_data *req) platform_request_boot(); /* Reset core to enter bootloader */ - scb_reset_core(); + SCB_RESET(); } static int cdcacm_control_request(usbd_device *dev, diff --git a/src/platforms/f4discovery/platform.h b/src/platforms/f4discovery/platform.h index 971ebc28..c3c37edc 100644 --- a/src/platforms/f4discovery/platform.h +++ b/src/platforms/f4discovery/platform.h @@ -35,6 +35,8 @@ #define BOARD_IDENT "Black Magic Probe (F4Discovery), (Firmware " FIRMWARE_VERSION ")" #define DFU_IDENT "Black Magic Firmware Upgrade (F4Discovery)" +#define SCB_RESET() scb_reset_core(); + /* Important pin mappings for STM32 implementation: * * LED0 = PD12 (Green LED : Running) diff --git a/src/platforms/hydrabus/platform.h b/src/platforms/hydrabus/platform.h index d0ba61aa..dcc752ef 100644 --- a/src/platforms/hydrabus/platform.h +++ b/src/platforms/hydrabus/platform.h @@ -37,6 +37,8 @@ #define BOARD_IDENT_DFU "Black Magic (Upgrade) for HydraBus, (Firmware " FIRMWARE_VERSION ")" #define DFU_IDENT "Black Magic Firmware Upgrade (HydraBus)" +#define SCB_RESET() scb_reset_core(); + /* Important pin mappings for STM32 implementation: * * LED0 = PA4 (Green LED : Running) diff --git a/src/platforms/launchpad-icdi/platform.h b/src/platforms/launchpad-icdi/platform.h index a710c52b..0ae8a837 100644 --- a/src/platforms/launchpad-icdi/platform.h +++ b/src/platforms/launchpad-icdi/platform.h @@ -28,6 +28,8 @@ #define DFU_IDENT "Black Magic Firmware Upgrade (Launchpad)" #define DFU_IFACE_STRING "lolwut" +#define SCB_RESET() scb_reset_core(); + extern uint8_t running_status; #define TMS_PORT GPIOA_BASE diff --git a/src/platforms/native/platform.h b/src/platforms/native/platform.h index a261cbca..be98147e 100644 --- a/src/platforms/native/platform.h +++ b/src/platforms/native/platform.h @@ -40,6 +40,8 @@ #define DFU_IDENT "Black Magic Firmware Upgrade" #define UPD_IFACE_STRING "@Internal Flash /0x08000000/8*001Kg" +#define SCB_RESET() scb_reset_core(); + /* Important pin mappings for STM32 implementation: * * LED0 = PB2 (Yellow LED : Running) diff --git a/src/platforms/stlink/platform.h b/src/platforms/stlink/platform.h index cadb5d80..bf5597d8 100644 --- a/src/platforms/stlink/platform.h +++ b/src/platforms/stlink/platform.h @@ -44,6 +44,8 @@ #define DFU_IDENT "Black Magic Firmware Upgrade (STLINK)" #define UPD_IFACE_STRING "@Internal Flash /0x08000000/8*001Kg" +#define SCB_RESET() scb_reset_system(); + /* Hardware definitions... */ #define TDI_PORT GPIOA #define TMS_PORT GPIOB diff --git a/src/platforms/swlink/platform.h b/src/platforms/swlink/platform.h index 748c31fd..1c20f220 100644 --- a/src/platforms/swlink/platform.h +++ b/src/platforms/swlink/platform.h @@ -35,6 +35,8 @@ #define DFU_IDENT "Black Magic Firmware Upgrade (SWLINK)" #define UPD_IFACE_STRING "@Internal Flash /0x08000000/8*001Kg" +#define SCB_RESET() scb_reset_system(); + /* Hardware definitions... */ #define TMS_PORT GPIOA #define TCK_PORT GPIOA