Skip to content

Commit

Permalink
HAL_ChibiOS: enable clock management on G4
Browse files Browse the repository at this point in the history
this allows for a different clock tree in the main fw from the
bootloader
  • Loading branch information
tridge committed Jan 25, 2024
1 parent 743b126 commit a2707b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libraries/AP_HAL_ChibiOS/CANFDIface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ extern const AP_HAL::HAL& hal;

#define STR(x) #x
#define XSTR(x) STR(x)
#if !defined(HAL_LLD_USE_CLOCK_MANAGEMENT)
static_assert(STM32_FDCANCLK == 80U*1000U*1000U, "FDCAN clock must be 80MHz, got " XSTR(STM32_FDCANCLK));
#endif

using namespace ChibiOS;

Expand Down
6 changes: 6 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/common/stm32g4_mcuconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
#define STM32_LSEDRV (3U << 3U)
#endif

/*
we need to use HAL_LLD_USE_CLOCK_MANAGEMENT in order to allow a
different clock tree in the main firmware from the bootloader.
*/
#define HAL_LLD_USE_CLOCK_MANAGEMENT 1

/*
* STM32G4xx drivers configuration.
* The following settings override the default settings present in
Expand Down

0 comments on commit a2707b4

Please sign in to comment.