File tree Expand file tree Collapse file tree 5 files changed +16
-2
lines changed Expand file tree Collapse file tree 5 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -430,6 +430,9 @@ typedef struct
430430/** @defgroup RCC_RTC_Clock_Source RCC RTC Clock Source
431431 * @{
432432 */
433+ /* MBED */
434+ #define RCC_RTCCLKSOURCE_NO_CLK (0x00000000U)
435+ /* MBED */
433436#define RCC_RTCCLKSOURCE_LSE (0x00000100U)
434437#define RCC_RTCCLKSOURCE_LSI (0x00000200U)
435438#define RCC_RTCCLKSOURCE_HSE_DIV2 (0x00002300U)
Original file line number Diff line number Diff line change 29292929#define RCC_MCOSOURCE_PLLCLK_NODIV RCC_MCO1SOURCE_PLLCLK
29302930#define RCC_MCOSOURCE_PLLCLK_DIV2 RCC_MCO1SOURCE_PLLCLK_DIV2
29312931
2932- #if defined(STM32L4 )
2932+ #if defined(STM32L4 ) || defined( STM32WB )
29332933#define RCC_RTCCLKSOURCE_NO_CLK RCC_RTCCLKSOURCE_NONE
2934- #elif defined(STM32WB ) || defined(STM32G0 )
29352934#else
29362935#define RCC_RTCCLKSOURCE_NONE RCC_RTCCLKSOURCE_NO_CLK
29372936#endif
Original file line number Diff line number Diff line change @@ -113,7 +113,11 @@ void lp_ticker_init(void)
113113#else /* MBED_CONF_TARGET_LSE_AVAILABLE */
114114
115115 /* Enable LSI clock */
116+ #if TARGET_STM32WB
117+ RCC_OscInitStruct .OscillatorType = RCC_OSCILLATORTYPE_LSI1 ;
118+ #else
116119 RCC_OscInitStruct .OscillatorType = RCC_OSCILLATORTYPE_LSI ;
120+ #endif
117121 RCC_OscInitStruct .LSIState = RCC_LSI_ON ;
118122 RCC_OscInitStruct .PLL .PLLState = RCC_PLL_NONE ;
119123
Original file line number Diff line number Diff line change @@ -61,7 +61,11 @@ void mbed_sdk_init()
6161 RCC_OscInitTypeDef RCC_OscInitStruct = {0 };
6262
6363 if (__HAL_RCC_GET_RTC_SOURCE () != RCC_RTCCLKSOURCE_NO_CLK ) {
64+ #if TARGET_STM32WB
65+ RCC_OscInitStruct .OscillatorType = RCC_OSCILLATORTYPE_LSI1 ;
66+ #else
6467 RCC_OscInitStruct .OscillatorType = RCC_OSCILLATORTYPE_LSI ;
68+ #endif
6569 RCC_OscInitStruct .PLL .PLLState = RCC_PLL_NONE ;
6670 RCC_OscInitStruct .LSIState = RCC_LSI_ON ;
6771 if (HAL_RCC_OscConfig (& RCC_OscInitStruct ) != HAL_OK ) {
Original file line number Diff line number Diff line change @@ -74,7 +74,11 @@ void rtc_init(void)
7474 error ("PeriphClkInitStruct RTC failed with LSE\n" );
7575 }
7676#else /* MBED_CONF_TARGET_LSE_AVAILABLE */
77+ #if TARGET_STM32WB
78+ RCC_OscInitStruct .OscillatorType = RCC_OSCILLATORTYPE_LSI1 ;
79+ #else
7780 RCC_OscInitStruct .OscillatorType = RCC_OSCILLATORTYPE_LSI ;
81+ #endif
7882 RCC_OscInitStruct .PLL .PLLState = RCC_PLL_NONE ;
7983 RCC_OscInitStruct .LSIState = RCC_LSI_ON ;
8084 if (HAL_RCC_OscConfig (& RCC_OscInitStruct ) != HAL_OK ) {
You can’t perform that action at this time.
0 commit comments