Skip to content

Commit

Permalink
Merge branch 'topic/kliemann/bb-runtimes-85-stm32f4-setup' into 'master'
Browse files Browse the repository at this point in the history
Remove invalid assertion from stm32f4 runtime setup

See merge request eng/toolchain/bb-runtimes!133
  • Loading branch information
jklmnn committed Oct 24, 2024
2 parents c944d7d + fdbfc9d commit 0c21c19
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions arm/stm32/setup_pll.adb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ with System.BB.Parameters; use System.BB.Parameters;
with System.BB.MCU_Parameters;
with System.BB.Board_Parameters; use System.BB.Board_Parameters;
with System.STM32; use System.STM32;
with System.Machine_Reset;

procedure Setup_Pll is
procedure Initialize_Clocks;
Expand Down Expand Up @@ -157,11 +158,15 @@ procedure Setup_Pll is
"Cannot generate requested clock");

-- Cannot be checked at compile time, depends on APB1_PRE and APB2_PRE
pragma Assert
(HCLK not in HCLK_Range
or else PCLK1 not in PCLK1_Range
or else PCLK2 not in PCLK2_Range,
"Invalid AHB/APB prescalers configuration");
if HCLK not in HCLK_Range
or else PCLK1 not in PCLK1_Range
or else PCLK2 not in PCLK2_Range
then
-- Invalid AHB/APB prescalers configuration.
-- We cannot raise an exception here as the runtime is not fully
-- initialized yet.
System.Machine_Reset.Stop;
end if;

-- PWR clock enable

Expand Down

0 comments on commit 0c21c19

Please sign in to comment.