From dfb017322519aa2376666b0c1dac2078a5c29be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Sundstr=C3=B6m?= Date: Sun, 8 Feb 2026 23:08:19 +0100 Subject: [PATCH] ch32f1: Fixed hanging gdb load command for CH32F103C8T6 MCU's --- src/target/ch32f1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/target/ch32f1.c b/src/target/ch32f1.c index 8a00b219e8b..78a346d7571 100644 --- a/src/target/ch32f1.c +++ b/src/target/ch32f1.c @@ -219,7 +219,7 @@ static bool ch32f1_flash_busy_wait(target_s *const target) static bool ch32f1_flash_eop_wait(target_s *const target) { uint32_t status = CH32F1_FLASH_STATUS_EOP; - while (status & CH32F1_FLASH_STATUS_EOP) { + while (!(status & CH32F1_FLASH_STATUS_EOP)) { status = target_mem32_read32(target, CH32F1_FLASH_STATUS); if (target_check_error(target)) { DEBUG_ERROR("ch32f1 flash write: comm error\n");