Skip to content

Commit b19c292

Browse files
jamesrlucasfpistm
andauthored
Add STM32F303VDxx and STM32F303VExx Variants (#3016)
variant(f3): add STM32F303VDx and STM32F303VEx Signed-off-by: James <james@jlucas.me.uk> Co-authored-by: Frederic Pillon <frederic.pillon@st.com>
1 parent e3a21a1 commit b19c292

4 files changed

Lines changed: 251 additions & 2 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
359359
| :green_heart: | STM32F303RB<br>STM32F303RC | Generic Board | *2.0.0* | |
360360
| :green_heart: | STM32F303RC | [OLIMEXINO-STM32F3](https://www.olimex.com/Products/Duino/STM32/OLIMEXINO-STM32F3/) | *2.0.0* | |
361361
| :green_heart: | STM32F303VBT<br>STM32F303VCT | Generic Board | *2.0.0* | |
362+
| :yellow_heart: | STM32F303VD<br>STM32F303VE | Generic Board | **3.0.0** | |
362363
| :green_heart: | STM32F318C8 | Generic Board | *2.4.0* | |
363364
| :green_heart: | STM32F318K8 | Generic Board | *2.4.0* | |
364365
| :green_heart: | STM32F328C8 | Generic Board | *2.4.0* | |

‎boards.txt‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4783,6 +4783,42 @@ GenF3.menu.pnum.GENERIC_F303VCTX.build.product_line=STM32F303xC
47834783
GenF3.menu.pnum.GENERIC_F303VCTX.build.variant=STM32F3xx/F303V(B-C)T
47844784
GenF3.menu.pnum.GENERIC_F303VCTX.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32F3xx/STM32F303.svd
47854785

4786+
# Generic F303VDHx
4787+
GenF3.menu.pnum.GENERIC_F303VDHX=Generic F303VDHx
4788+
GenF3.menu.pnum.GENERIC_F303VDHX.upload.maximum_size=393216
4789+
GenF3.menu.pnum.GENERIC_F303VDHX.upload.maximum_data_size=65536
4790+
GenF3.menu.pnum.GENERIC_F303VDHX.build.board=GENERIC_F303VDHX
4791+
GenF3.menu.pnum.GENERIC_F303VDHX.build.product_line=STM32F303xE
4792+
GenF3.menu.pnum.GENERIC_F303VDHX.build.variant=STM32F3xx/F303V(D-E)(H-T)
4793+
GenF3.menu.pnum.GENERIC_F303VDHX.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32F3xx/STM32F303.svd
4794+
4795+
# Generic F303VDTx
4796+
GenF3.menu.pnum.GENERIC_F303VDTX=Generic F303VDTx
4797+
GenF3.menu.pnum.GENERIC_F303VDTX.upload.maximum_size=393216
4798+
GenF3.menu.pnum.GENERIC_F303VDTX.upload.maximum_data_size=65536
4799+
GenF3.menu.pnum.GENERIC_F303VDTX.build.board=GENERIC_F303VDTX
4800+
GenF3.menu.pnum.GENERIC_F303VDTX.build.product_line=STM32F303xE
4801+
GenF3.menu.pnum.GENERIC_F303VDTX.build.variant=STM32F3xx/F303V(D-E)(H-T)
4802+
GenF3.menu.pnum.GENERIC_F303VDTX.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32F3xx/STM32F303.svd
4803+
4804+
# Generic F303VEHx
4805+
GenF3.menu.pnum.GENERIC_F303VEHX=Generic F303VEHx
4806+
GenF3.menu.pnum.GENERIC_F303VEHX.upload.maximum_size=524288
4807+
GenF3.menu.pnum.GENERIC_F303VEHX.upload.maximum_data_size=65536
4808+
GenF3.menu.pnum.GENERIC_F303VEHX.build.board=GENERIC_F303VEHX
4809+
GenF3.menu.pnum.GENERIC_F303VEHX.build.product_line=STM32F303xE
4810+
GenF3.menu.pnum.GENERIC_F303VEHX.build.variant=STM32F3xx/F303V(D-E)(H-T)
4811+
GenF3.menu.pnum.GENERIC_F303VEHX.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32F3xx/STM32F303.svd
4812+
4813+
# Generic F303VETx
4814+
GenF3.menu.pnum.GENERIC_F303VETX=Generic F303VETx
4815+
GenF3.menu.pnum.GENERIC_F303VETX.upload.maximum_size=524288
4816+
GenF3.menu.pnum.GENERIC_F303VETX.upload.maximum_data_size=65536
4817+
GenF3.menu.pnum.GENERIC_F303VETX.build.board=GENERIC_F303VETX
4818+
GenF3.menu.pnum.GENERIC_F303VETX.build.product_line=STM32F303xE
4819+
GenF3.menu.pnum.GENERIC_F303VETX.build.variant=STM32F3xx/F303V(D-E)(H-T)
4820+
GenF3.menu.pnum.GENERIC_F303VETX.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32F3xx/STM32F303.svd
4821+
47864822
# Generic F318C8Tx
47874823
GenF3.menu.pnum.GENERIC_F318C8TX=Generic F318C8Tx
47884824
GenF3.menu.pnum.GENERIC_F318C8TX.upload.maximum_size=65536

‎variants/STM32F3xx/F303V(D-E)(H-T)/generic_clock.c‎

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,41 @@
2121
*/
2222
WEAK void SystemClock_Config(void)
2323
{
24-
/* SystemClock_Config can be generated by STM32CubeMX */
25-
#warning "SystemClock_Config() is empty. Default clock at reset is used."
24+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
25+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
26+
RCC_PeriphCLKInitTypeDef PeriphClkInit = {};
27+
28+
/** Initializes the RCC Oscillators according to the specified parameters
29+
* in the RCC_OscInitTypeDef structure.
30+
*/
31+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
32+
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
33+
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
34+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
35+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
36+
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;
37+
RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1;
38+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
39+
Error_Handler();
40+
}
41+
42+
/** Initializes the CPU, AHB and APB buses clocks
43+
*/
44+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
45+
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
46+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
47+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
48+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
49+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
50+
51+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
52+
Error_Handler();
53+
}
54+
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB;
55+
PeriphClkInit.USBClockSelection = RCC_USBCLKSOURCE_PLL_DIV1_5;
56+
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) {
57+
Error_Handler();
58+
}
2659
}
2760

2861
#endif /* ARDUINO_GENERIC_* */
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
/**
2+
******************************************************************************
3+
* @file LinkerScript.ld
4+
* @author Auto-generated by STM32CubeIDE
5+
* @brief Linker script for STM32F303VDxx / STM32F303VExx Devices from STM32F3 series
6+
* 384 Kbytes (F303VDxx) or 512 Kbytes (F303VExx) FLASH
7+
* 16Kbytes CCMRAM
8+
* 64Kbytes RAM
9+
*
10+
* Set heap size, stack size and stack location according
11+
* to application requirements.
12+
*
13+
* Set memory bank area and size if external memory is used
14+
******************************************************************************
15+
* @attention
16+
*
17+
* <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
18+
* All rights reserved.</center></h2>
19+
*
20+
* This software component is licensed by ST under BSD 3-Clause license,
21+
* the "License"; You may not use this file except in compliance with the
22+
* License. You may obtain a copy of the License at:
23+
* opensource.org/licenses/BSD-3-Clause
24+
*
25+
******************************************************************************
26+
*/
27+
28+
/* Entry Point */
29+
ENTRY(Reset_Handler)
30+
31+
/* Highest address of the user mode stack */
32+
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */
33+
34+
_Min_Heap_Size = 0x200; /* required amount of heap */
35+
_Min_Stack_Size = 0x400; /* required amount of stack */
36+
37+
/* Memories definition */
38+
MEMORY
39+
{
40+
CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 8K
41+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
42+
FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
43+
}
44+
45+
/* Sections */
46+
SECTIONS
47+
{
48+
/* The startup code into "FLASH" Rom type memory */
49+
.isr_vector :
50+
{
51+
. = ALIGN(4);
52+
KEEP(*(.isr_vector)) /* Startup code */
53+
. = ALIGN(4);
54+
} >FLASH
55+
56+
/* The program code and other data into "FLASH" Rom type memory */
57+
.text :
58+
{
59+
. = ALIGN(4);
60+
*(.text) /* .text sections (code) */
61+
*(.text*) /* .text* sections (code) */
62+
*(.glue_7) /* glue arm to thumb code */
63+
*(.glue_7t) /* glue thumb to arm code */
64+
*(.eh_frame)
65+
66+
KEEP (*(.init))
67+
KEEP (*(.fini))
68+
69+
. = ALIGN(4);
70+
_etext = .; /* define a global symbols at end of code */
71+
} >FLASH
72+
73+
/* Constant data into "FLASH" Rom type memory */
74+
.rodata :
75+
{
76+
. = ALIGN(4);
77+
*(.rodata) /* .rodata sections (constants, strings, etc.) */
78+
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
79+
. = ALIGN(4);
80+
} >FLASH
81+
82+
.ARM.extab (READONLY) : {
83+
. = ALIGN(4);
84+
*(.ARM.extab* .gnu.linkonce.armextab.*)
85+
. = ALIGN(4);
86+
} >FLASH
87+
88+
.ARM (READONLY) : {
89+
. = ALIGN(4);
90+
__exidx_start = .;
91+
*(.ARM.exidx*)
92+
__exidx_end = .;
93+
. = ALIGN(4);
94+
} >FLASH
95+
96+
.preinit_array (READONLY) :
97+
{
98+
. = ALIGN(4);
99+
PROVIDE_HIDDEN (__preinit_array_start = .);
100+
KEEP (*(.preinit_array*))
101+
PROVIDE_HIDDEN (__preinit_array_end = .);
102+
. = ALIGN(4);
103+
} >FLASH
104+
105+
.init_array (READONLY) :
106+
{
107+
. = ALIGN(4);
108+
PROVIDE_HIDDEN (__init_array_start = .);
109+
KEEP (*(SORT(.init_array.*)))
110+
KEEP (*(.init_array*))
111+
PROVIDE_HIDDEN (__init_array_end = .);
112+
. = ALIGN(4);
113+
} >FLASH
114+
115+
.fini_array (READONLY) :
116+
{
117+
. = ALIGN(4);
118+
PROVIDE_HIDDEN (__fini_array_start = .);
119+
KEEP (*(SORT(.fini_array.*)))
120+
KEEP (*(.fini_array*))
121+
PROVIDE_HIDDEN (__fini_array_end = .);
122+
. = ALIGN(4);
123+
} >FLASH
124+
125+
/* Used by the startup to initialize data */
126+
_sidata = LOADADDR(.data);
127+
128+
/* Initialized data sections into "RAM" Ram type memory */
129+
.data :
130+
{
131+
. = ALIGN(4);
132+
_sdata = .; /* create a global symbol at data start */
133+
*(.data) /* .data sections */
134+
*(.data*) /* .data* sections */
135+
*(.RamFunc) /* .RamFunc sections */
136+
*(.RamFunc*) /* .RamFunc* sections */
137+
138+
. = ALIGN(4);
139+
_edata = .; /* define a global symbol at data end */
140+
141+
} >RAM AT> FLASH
142+
143+
/* Uninitialized data section into "RAM" Ram type memory */
144+
. = ALIGN(4);
145+
.bss :
146+
{
147+
/* This is used by the startup in order to initialize the .bss section */
148+
_sbss = .; /* define a global symbol at bss start */
149+
__bss_start__ = _sbss;
150+
*(.bss)
151+
*(.bss*)
152+
*(COMMON)
153+
154+
. = ALIGN(4);
155+
_ebss = .; /* define a global symbol at bss end */
156+
__bss_end__ = _ebss;
157+
} >RAM
158+
159+
/* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
160+
._user_heap_stack :
161+
{
162+
. = ALIGN(8);
163+
PROVIDE ( end = . );
164+
PROVIDE ( _end = . );
165+
. = . + _Min_Heap_Size;
166+
. = . + _Min_Stack_Size;
167+
. = ALIGN(8);
168+
} >RAM
169+
170+
/* Remove information from the compiler libraries */
171+
/DISCARD/ :
172+
{
173+
libc.a ( * )
174+
libm.a ( * )
175+
libgcc.a ( * )
176+
}
177+
178+
.ARM.attributes 0 : { *(.ARM.attributes) }
179+
}

0 commit comments

Comments
 (0)