Skip to content

Commit 45ac79a

Browse files
pennamfacchinm
authored andcommitted
STM32H7: define RCC_LSE_BYPASS to allow using PC_15 as gpio
1 parent 73b7e45 commit 45ac79a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

targets/TARGET_STM/lp_ticker.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,11 @@ void lp_ticker_init(void)
170170

171171
/* Enable LSE clock */
172172
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
173+
#if MBED_CONF_TARGET_LSE_BYPASS
174+
RCC_OscInitStruct.LSEState = RCC_LSE_BYPASS;
175+
#else
173176
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
177+
#endif
174178
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
175179

176180
/* Select the LSE clock as LPTIM peripheral clock */

targets/TARGET_STM/rtc_api.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ void rtc_init(void)
6565
#if MBED_CONF_TARGET_LSE_AVAILABLE
6666
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
6767
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
68+
#if MBED_CONF_TARGET_LSE_BYPASS
69+
RCC_OscInitStruct.LSEState = RCC_LSE_BYPASS;
70+
#else
6871
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
72+
#endif
6973

7074
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
7175
error("Cannot initialize RTC with LSE\n");

0 commit comments

Comments
 (0)