Skip to content

Commit

Permalink
stm32f1: Increase block size of GD32F3/F2 to 2 KiB in first bank
Browse files Browse the repository at this point in the history
* Both GD32F205 (HD) / F207 (CL) and GD32F30x_HD/_XD/_CL have their flash in erase blocks of 2 KiB
* Save some time by not submitting 1 KiB-wise erase commands on these targets
  • Loading branch information
ALTracer committed Jan 4, 2024
1 parent e0dfcea commit f88ea02
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/target/stm32f1.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,19 @@ bool gd32f1_probe(target_s *target)
case 0x414U: /* Gigadevice gd32f303 */
case 0x430U: /* XL-density */
target->driver = "GD32F3";
block_size = 0x800;
break;
case 0x418U:
target->driver = "GD32F2";
block_size = 0x800;
break;
case 0x410U: /* Gigadevice gd32f103, gd32e230 */
if ((target->cpuid & CORTEX_CPUID_PARTNO_MASK) == CORTEX_M23)
target->driver = "GD32E230";
else if ((target->cpuid & CORTEX_CPUID_PARTNO_MASK) == CORTEX_M4)
else if ((target->cpuid & CORTEX_CPUID_PARTNO_MASK) == CORTEX_M4) {
target->driver = "GD32F3";
else
block_size = 0x800;
} else
target->driver = "GD32F1";
break;
case 0x444U: /* Gigadevice gd32e50x */
Expand Down

0 comments on commit f88ea02

Please sign in to comment.