Skip to content

Commit a835086

Browse files
adlerwebfpistm
authored andcommitted
Add STM32F030F4 with internal rc oscillator
1 parent 1582b9d commit a835086

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

boards.txt

+8
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,14 @@ GenF0.menu.pnum.DEMO_F030F4_16M.build.board=DEMO_F030F4_16M
655655
GenF0.menu.pnum.DEMO_F030F4_16M.build.product_line=STM32F030x6
656656
GenF0.menu.pnum.DEMO_F030F4_16M.build.variant=DEMO_F030F4
657657

658+
# DEMO_F030F4_HSI board
659+
GenF0.menu.pnum.DEMO_F030F4_HSI=STM32F030F4 Demo board (internal RC oscillator)
660+
GenF0.menu.pnum.DEMO_F030F4_HSI.upload.maximum_data_size=4096
661+
GenF0.menu.pnum.DEMO_F030F4_HSI.upload.maximum_size=16384
662+
GenF0.menu.pnum.DEMO_F030F4_HSI.build.board=DEMO_F030F4_HSI
663+
GenF0.menu.pnum.DEMO_F030F4_HSI.build.product_line=STM32F030x6
664+
GenF0.menu.pnum.DEMO_F030F4_HSI.build.variant=DEMO_F030F4
665+
658666
# Upload menu
659667
GenF0.menu.upload_method.swdMethod=STM32CubeProgrammer (SWD)
660668
GenF0.menu.upload_method.swdMethod.upload.protocol=0

variants/DEMO_F030F4/variant.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,27 @@ WEAK void SystemClock_Config(void)
8888
RCC_ClkInitTypeDef RCC_ClkInitStruct;
8989

9090
/* Initializes the CPU, AHB and APB busses clocks */
91+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
92+
#ifdef ARDUINO_DEMO_F030F4_HSI
93+
/* Internal HSI, 48MHz system clock */
94+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
95+
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
96+
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
97+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
98+
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL12;
99+
RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1;
100+
#else
91101
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI14 | RCC_OSCILLATORTYPE_HSE;
92102
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
93103
RCC_OscInitStruct.HSI14State = RCC_HSI14_ON;
94104
RCC_OscInitStruct.HSI14CalibrationValue = 16;
95-
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
96105
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
97106
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6;
98107
#ifdef ARDUINO_DEMO_F030F4_16M
99108
RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV2;
100109
#else
101110
RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1;
111+
#endif
102112
#endif
103113
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
104114
_Error_Handler(__FILE__, __LINE__);

0 commit comments

Comments
 (0)