diff --git a/IDE/STM32Cube/wolfssl_example.c b/IDE/STM32Cube/wolfssl_example.c index 724e79770..14bf496a5 100644 --- a/IDE/STM32Cube/wolfssl_example.c +++ b/IDE/STM32Cube/wolfssl_example.c @@ -1496,12 +1496,15 @@ double current_time(void) { RTC_TimeTypeDef time; RTC_DateTypeDef date; - uint32_t subsec; + uint32_t subsec = 0; /* must get time and date here due to STM32 HW bug */ HAL_RTC_GetTime(&hrtc, &time, FORMAT_BIN); HAL_RTC_GetDate(&hrtc, &date, FORMAT_BIN); + /* Not all STM32 RTCs have subseconds in the struct */ +#ifdef RTC_ALARMSUBSECONDMASK_ALL subsec = (255 - time.SubSeconds) * 1000 / 255; +#endif (void) date; diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index a97c29508..989866c52 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -2522,7 +2522,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) #elif defined(WOLFSSL_SAFERTOS) || defined(WOLFSSL_LEANPSK) || \ defined(WOLFSSL_IAR_ARM) || defined(WOLFSSL_MDK_ARM) || \ defined(WOLFSSL_uITRON4) || defined(WOLFSSL_uTKERNEL2) || \ - defined(WOLFSSL_LPC43xx) || defined(WOLFSSL_STM32F2xx) || \ + defined(WOLFSSL_LPC43xx) || defined(NO_STM32_RNG) || \ defined(MBED) || defined(WOLFSSL_EMBOS) || \ defined(WOLFSSL_GENSEED_FORTEST) || defined(WOLFSSL_CHIBIOS) || \ defined(WOLFSSL_CONTIKI) || defined(WOLFSSL_AZSPHERE) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 8331055f9..41bea4efc 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -16343,7 +16343,7 @@ static int dh_ffdhe_test(WC_RNG *rng, const DhParams* params) done: -#ifdef WOLFSSL_SMALL_STACK +#if defined(WOLFSSL_SMALL_STACK) && !defined(WC_NO_RNG) if (priv) XFREE(priv, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER); if (pub)