diff --git a/components/DAP/source/DAP.c b/components/DAP/source/DAP.c index f3a243a..aac3e0e 100644 --- a/components/DAP/source/DAP.c +++ b/components/DAP/source/DAP.c @@ -273,22 +273,6 @@ static uint32_t DAP_Disconnect(uint8_t *response) { // return: number of bytes in response static uint32_t DAP_ResetTarget(uint8_t *response) { -#if (USE_FORCE_SYSRESETREQ_AFTER_FLASH) - if (DAP_Data.debug_port == DAP_PORT_SWD) { - /* Workaround for software reset when nRESET is not connected */ - uint8_t ack; - uint32_t AIRCR_REG_ADDR = 0xE000ED0C; - uint32_t AIRCR_RESET_VAL = 0x05FA << 16 | 1 << 2; /* Vector key | SYSRESETREQ bit */ - uint8_t req = DAP_TRANSFER_APnDP | 0 | DAP_TRANSFER_A2 | 0; - ack = SWD_Transfer(req,&AIRCR_REG_ADDR); - if (ack == DAP_TRANSFER_OK) { - dap_os_delay(2); - req = DAP_TRANSFER_APnDP | 0 | DAP_TRANSFER_A2 | DAP_TRANSFER_A3; - SWD_Transfer(req,&AIRCR_RESET_VAL); - } - } -#endif - *(response+1) = RESET_TARGET(); *(response+0) = DAP_OK; return (2U); @@ -1866,4 +1850,4 @@ void DAP_Setup(void) { void dap_os_delay(int ms) { vTaskDelay(pdMS_TO_TICKS(ms)); -} +} \ No newline at end of file diff --git a/main/dap_configuration.h b/main/dap_configuration.h index 8d90aa1..1c6efdf 100644 --- a/main/dap_configuration.h +++ b/main/dap_configuration.h @@ -39,20 +39,5 @@ #define DAP_PACKET_SIZE 255U // 255 for USB HID #endif -/** - * @brief Enable this option to force a software reset when resetting the device - * - * Some debugger software (e.g. Keil) does not perform a software reset when - * resetting the target. When this option enabled, a soft reset is attempted - * when DAP_ResetTarget() is performed. This is done by writing to the - * SYSRESETREQ field of the AIRCR register in the Cortex-M architecture. - * - * This should work for ARMv6-m, ARMv7-m and ARMv8-m architecture. However, - * there is no guarantee that the reset operation will be executed correctly. - * - * Only available for SWD. - * - */ -#define USE_FORCE_SYSRESETREQ_AFTER_FLASH 0 #endif