Merge pull request #1467 from dbeinder/stlink-v3-fix

Fixed STLINK-V3 programmer lock up when no target connected
testing
nightwalker-87 2025-04-17 21:46:35 +02:00 zatwierdzone przez GitHub
commit 1894b700de
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
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