Skip to content

Commit 610118b

Browse files
committed
stm32f1: Enable non-halting SRAM access for RTT on tested chips
* Tested chips include GD32F103CB, GD32F303CC, GD32E508ZE
1 parent ad2ebea commit 610118b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/target/stm32f1.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,10 @@ bool gd32f1_probe(target_s *target)
286286
switch (device_id) {
287287
case 0x414U: /* GD32F30x_HD, High density */
288288
case 0x430U: /* GD32F30x_XD, XL-density */
289-
target->driver = "GD32F3";
289+
target->driver = "GD32F3 HD/XD";
290290
block_size = 0x800;
291+
/* On this SoC, Cortex-M4F allows SRAM access without halting */
292+
target->target_options |= TOPT_NON_HALTING_MEM_IO;
291293
break;
292294
case 0x418U: /* Connectivity Line */
293295
target->driver = "GD32F2";
@@ -297,14 +299,19 @@ bool gd32f1_probe(target_s *target)
297299
if ((target->cpuid & CORTEX_CPUID_PARTNO_MASK) == CORTEX_M23)
298300
target->driver = "GD32E230"; /* GD32E230, 64 KiB max in 1 KiB pages */
299301
else if ((target->cpuid & CORTEX_CPUID_PARTNO_MASK) == CORTEX_M4) {
300-
target->driver = "GD32F3";
302+
target->driver = "GD32F3 MD";
301303
block_size = 0x800;
302-
} else
304+
} else {
303305
target->driver = "GD32F1"; /* GD32F103, 1 KiB pages */
306+
/* On this SoC, Cortex-M3 allows SRAM access without halting */
307+
target->target_options |= TOPT_NON_HALTING_MEM_IO;
308+
}
304309
break;
305310
case 0x444U: /* GD32E50x_CL, 512 KiB max in 8 KiB pages */
306311
target->driver = "GD32E5";
307312
block_size = 0x2000;
313+
/* On this SoC, Cortex-M33 allows SRAM access without halting */
314+
target->target_options |= TOPT_NON_HALTING_MEM_IO;
308315
break;
309316
default:
310317
return false;

0 commit comments

Comments
 (0)