diff --git a/src/target/meson.build b/src/target/meson.build index 8cc07cf5b65..06a80201c34 100644 --- a/src/target/meson.build +++ b/src/target/meson.build @@ -295,6 +295,11 @@ target_stm = declare_dependency( dependencies: [target_cortexm, target_stm_common, target_stm32f1], ) +target_gd32 = declare_dependency( + dependencies: target_stm32f1, + compile_args: ['-DCONFIG_GD32=1'], +) + target_mm32 = declare_dependency( dependencies: target_stm32f1, compile_args: ['-DCONFIG_MM32=1'], @@ -367,6 +372,7 @@ libbmd_target_deps = [ target_ch32, target_ch579, target_efm, + target_gd32, target_hc32, target_lpc, target_mm32, diff --git a/src/target/stm32f1.c b/src/target/stm32f1.c index e7db59667f6..f285ca0bb87 100644 --- a/src/target/stm32f1.c +++ b/src/target/stm32f1.c @@ -243,6 +243,7 @@ static bool stm32f1_configure_dbgmcu(target_s *const target, const target_addr32 return true; } +#ifdef CONFIG_GD32 /* Identify GD32F1, GD32F2, GD32F3, GD32E230 and GD32E5 chips */ bool gd32f1_probe(target_s *target) { @@ -361,6 +362,7 @@ static void gd32vf1_detach(target_s *const target) riscv_detach(target); } #endif +#endif static bool at32f40_is_dual_bank(const uint16_t part_id) {