Skip to content

Commit

Permalink
stm32f4: Implemented control over when the GigaDevice parts support i…
Browse files Browse the repository at this point in the history
…s built
  • Loading branch information
dragonmux committed Oct 18, 2024
1 parent c00efff commit 4234cb4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/target/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,13 @@ target_stm32f1 = declare_dependency(
dependencies: target_stm32f1_deps,
)

target_stm32f4 = declare_dependency(
sources: files(
'stm32f4.c',
),
dependencies: [target_cortexm, target_stm_common],
)

target_ch32 = declare_dependency(
sources: files(
'ch32f1.c',
Expand All @@ -283,7 +290,6 @@ target_ch32 = declare_dependency(

target_stm = declare_dependency(
sources: files(
'stm32f4.c',
'stm32g0.c',
'stm32h5.c',
'stm32h7.c',
Expand All @@ -292,11 +298,11 @@ target_stm = declare_dependency(
'stm32mp15.c',
'stm32wb0.c',
),
dependencies: [target_cortexm, target_stm_common, target_stm32f1],
dependencies: [target_cortexm, target_stm_common, target_stm32f1, target_stm32f4],
)

target_gd32 = declare_dependency(
dependencies: target_stm32f1,
dependencies: [target_stm32f1, target_stm32f4],
compile_args: ['-DCONFIG_GD32=1'],
)

Expand Down
4 changes: 4 additions & 0 deletions src/target/stm32f4.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ bool stm32f4_probe(target_s *target)
return true;
}

#ifdef CONFIG_GD32
bool gd32f4_probe(target_s *target)
{
if (target->part_id != ID_GD32F450 && target->part_id != ID_GD32F470 && target->part_id != ID_GD32F405)
Expand Down Expand Up @@ -331,6 +332,7 @@ bool gd32f4_probe(target_s *target)

return true;
}
#endif

static inline bool stm32f4_device_is_f7(const uint16_t part_id)
{
Expand Down Expand Up @@ -495,6 +497,7 @@ static bool stm32f4_attach(target_s *target)
return true;
}

#ifdef CONFIG_GD32
static bool gd32f4_attach(target_s *const target)
{
/*
Expand All @@ -503,6 +506,7 @@ static bool gd32f4_attach(target_s *const target)
*/
return cortexm_attach(target) && stm32f4_configure_dbgmcu(target);
}
#endif

static void stm32f4_detach(target_s *target)
{
Expand Down

0 comments on commit 4234cb4

Please sign in to comment.