Fix STLINK-V3 lock up when no target connected

pull/1467/head
david-beinder 2025-04-17 19:03:42 +02:00
rodzic b149e2448e
commit 911e2cb9a6
Nie znaleziono w bazie danych klucza dla tego podpisu
1 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -444,6 +444,11 @@ int32_t stlink_enter_swd_mode(stlink_t *sl) {
int32_t stlink_exit_debug_mode(stlink_t *sl) {
DLOG("*** stlink_exit_debug_mode ***\n");
if(stlink_current_mode(sl) != STLINK_DEV_DEBUG_MODE) {
// STLINK-V3 locks up completely when calling DEBUG_EXIT in MASS mode
return 0;
}
if(sl->flash_type != STM32_FLASH_TYPE_UNKNOWN &&
sl->core_stat != TARGET_RESET) {
// stop debugging if the target has been identified