diff --git a/drivers/rtc/rtc_ll_stm32.c b/drivers/rtc/rtc_ll_stm32.c index f8af22d00c5..c95c331ee97 100644 --- a/drivers/rtc/rtc_ll_stm32.c +++ b/drivers/rtc/rtc_ll_stm32.c @@ -138,6 +138,11 @@ static int rtc_stm32_set_time(const struct device *dev, const struct rtc_time *t return -EINVAL; } + if (timeptr->tm_wday == -1) { + /* day of the week is expected */ + return -EINVAL; + } + LOG_INF("Setting clock"); LL_RTC_DisableWriteProtection(RTC);