diff --git a/os/hal/ports/STM32/LLD/RNGv1/hal_trng_lld.c b/os/hal/ports/STM32/LLD/RNGv1/hal_trng_lld.c index c81e433f6..3c80ebfc6 100644 --- a/os/hal/ports/STM32/LLD/RNGv1/hal_trng_lld.c +++ b/os/hal/ports/STM32/LLD/RNGv1/hal_trng_lld.c @@ -82,6 +82,12 @@ void trng_lld_init(void) { */ void trng_lld_start(TRNGDriver *trngp) { +#if !defined(STM32_DISABLE_RNG_CLOCK_CHECK) + osalDbgAssert(((STM32_RNGCLK >= 47000000) && (STM32_RNGCLK <= 49000000)) || + ((STM32_RNGCLK >= 3500000) && (STM32_RNGCLK <= 4500000)), + "invalid RNG frequency"); +#endif + /* There is no real configuration but setting up a valid pointer anyway.*/ if (trngp->config == NULL) { trngp->config = &default_cfg; diff --git a/os/hal/ports/STM32/LLD/RNGv1/hal_trng_lld.h b/os/hal/ports/STM32/LLD/RNGv1/hal_trng_lld.h index 2a1e9ba46..a7c069049 100644 --- a/os/hal/ports/STM32/LLD/RNGv1/hal_trng_lld.h +++ b/os/hal/ports/STM32/LLD/RNGv1/hal_trng_lld.h @@ -85,14 +85,6 @@ #error "STM32_RNGCLK not defined in this HAL" #endif -#if ((STM32_RNGCLK < 47000000) || (STM32_RNGCLK > 49000000)) && \ - ((STM32_RNGCLK < 3500000) || (STM32_RNGCLK > 4500000)) -#if !defined(STM32_DISABLE_RNG_CLOCK_CHECK) -#error "STM32_RNGCLK is not within a tested clock range" -#error "define STM32_DISABLE_RNG_CLOCK_CHECK to override this check" -#endif -#endif - /*===========================================================================*/ /* Driver data structures and types. */ /*===========================================================================*/