From 1bf0f58525600481f34c81bc804e00ea4afc928a Mon Sep 17 00:00:00 2001 From: cinsights Date: Wed, 10 Nov 2021 11:12:12 +0000 Subject: [PATCH] Update STM32WB to new SPIV2. Fix compile error for IWDG due missing LSI define git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15047 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/hal/ports/STM32/STM32WBxx/hal_lld.h | 16 +++++++++++++++- os/hal/ports/STM32/STM32WBxx/platform.mk | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/os/hal/ports/STM32/STM32WBxx/hal_lld.h b/os/hal/ports/STM32/STM32WBxx/hal_lld.h index 72323a14a..c83e3cb0c 100644 --- a/os/hal/ports/STM32/STM32WBxx/hal_lld.h +++ b/os/hal/ports/STM32/STM32WBxx/hal_lld.h @@ -45,6 +45,11 @@ /* Driver constants. */ /*===========================================================================*/ +/** + * @brief Requires use of SPIv2 driver model. + */ +#define HAL_LLD_SELECT_SPI_V2 TRUE + /** * @name Platform identification * @{ @@ -502,6 +507,13 @@ #define STM32_LSI1_ENABLED TRUE #endif +/** + * @brief Enables or disables the LSI2 clock source. + */ +#if !defined(STM32_LSI2_ENABLED) || defined(__DOXYGEN__) +#define STM32_LSI2_ENABLED FALSE +#endif + /** * @brief Enables or disables the HSE clock source. */ @@ -1127,7 +1139,9 @@ #if STM32_RNGSEL == STM32_RNGSEL_LSI #error "LSI1 or LSI2 not enabled, required by STM32_RNGSEL" #endif - +#else + /* Define required for IWDG.*/ + #define STM32_LSI_ENABLED TRUE #endif /* !(STM32_LSI1_ENABLED || STM32_LSI2_ENABLED) */ #if !STM32_LSI1_ENABLED diff --git a/os/hal/ports/STM32/STM32WBxx/platform.mk b/os/hal/ports/STM32/STM32WBxx/platform.mk index b397932b6..1a360510c 100644 --- a/os/hal/ports/STM32/STM32WBxx/platform.mk +++ b/os/hal/ports/STM32/STM32WBxx/platform.mk @@ -35,7 +35,7 @@ include $(CHIBIOS)/os/hal/ports/STM32/LLD/QUADSPIv1/driver.mk include $(CHIBIOS)/os/hal/ports/STM32/LLD/RCCv1/driver.mk include $(CHIBIOS)/os/hal/ports/STM32/LLD/RNGv1/driver.mk include $(CHIBIOS)/os/hal/ports/STM32/LLD/RTCv2/driver.mk -include $(CHIBIOS)/os/hal/ports/STM32/LLD/SPIv2/driver.mk +include $(CHIBIOS)/os/hal/ports/STM32/LLD/SPIv2/driver_v2.mk include $(CHIBIOS)/os/hal/ports/STM32/LLD/SYSTICKv1/driver.mk include $(CHIBIOS)/os/hal/ports/STM32/LLD/TIMv1/driver.mk include $(CHIBIOS)/os/hal/ports/STM32/LLD/USARTv2/driver.mk