Skip to content

Commit 1188c7f

Browse files
Stanimir-PetevABOSTM
authored andcommitted
[Variant] Add OLIMEXINO-STM32F3
Supersede stm32duino#1115 Signed-off-by: Stanimir Petev <[email protected]> Co-authored-by: Alexandre Bourdiol <[email protected]>
1 parent 0f12f8e commit 1188c7f

File tree

6 files changed

+669
-2
lines changed

6 files changed

+669
-2
lines changed

Diff for: README.md

+2
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
206206
| :green_heart: | STM32F303CC | [RobotDyn Black Pill](https://stm32-base.org/boards/STM32F303CCT6-RobotDyn-Black-Pill) | *1.6.1* | [More info](https://robotdyn.com/catalog/development-boards/stm-boards-and-shields.html) |
207207
| :yellow_heart: | STM32F303K6<br>STM32F303K8 | Generic Board | **2.0.0** | |
208208
| :yellow_heart: | STM32F303RD<br>STM32F303RE | Generic Board | **2.0.0** | |
209+
| :yellow_heart: | STM32F303RB<br>STM32F303RC | Generic Board | **2.0.0** | |
210+
| :yellow_heart: | STM32F303RC | [OLIMEXINO-STM32F3](https://www.olimex.com/Products/Duino/STM32/OLIMEXINO-STM32F3/) | **2.0.0** | |
209211
| :yellow_heart: | STM32F303VBT<br>STM32F303VCT | Generic Board | **2.0.0** | |
210212
| :yellow_heart: | STM32F334K4<br>STM32F334K6<br>STM32F334K8 | Generic Board | **2.0.0** | |
211213

Diff for: boards.txt

+25
Original file line numberDiff line numberDiff line change
@@ -1565,6 +1565,15 @@ GenF3.menu.pnum.BLACKPILL_F303CC.build.product_line=STM32F303xC
15651565
GenF3.menu.pnum.BLACKPILL_F303CC.build.variant_h=variant_{build.board}.h
15661566
GenF3.menu.pnum.BLACKPILL_F303CC.build.variant=STM32F3xx/F303C(B-C)Tx
15671567

1568+
# OLIMEXINO_STM32F3
1569+
GenF3.menu.pnum.OLIMEXINO_STM32F3=OLIMEXINO-STM32F3
1570+
GenF3.menu.pnum.OLIMEXINO_STM32F3.upload.maximum_size=262144
1571+
GenF3.menu.pnum.OLIMEXINO_STM32F3.upload.maximum_data_size=40960
1572+
GenF3.menu.pnum.OLIMEXINO_STM32F3.build.board=OLIMEXINO_STM32F3
1573+
GenF3.menu.pnum.OLIMEXINO_STM32F3.build.product_line=STM32F303xC
1574+
GenF3.menu.pnum.OLIMEXINO_STM32F3.build.variant_h=variant_{build.board}.h
1575+
GenF3.menu.pnum.OLIMEXINO_STM32F3.build.variant=STM32F3xx/F303R(B-C)Tx
1576+
15681577
# Generic F302R6Tx
15691578
GenF3.menu.pnum.GENERIC_F302R6TX=Generic F302R6Tx
15701579
GenF3.menu.pnum.GENERIC_F302R6TX.upload.maximum_size=32768
@@ -1613,6 +1622,22 @@ GenF3.menu.pnum.GENERIC_F303K8TX.build.board=GENERIC_F303K8TX
16131622
GenF3.menu.pnum.GENERIC_F303K8TX.build.product_line=STM32F303x8
16141623
GenF3.menu.pnum.GENERIC_F303K8TX.build.variant=STM32F3xx/F303K(6-8)Tx_F334K(4-6-8)Tx
16151624

1625+
# Generic F303RBTx
1626+
GenF3.menu.pnum.GENERIC_F303RBTX=Generic F303RBTx
1627+
GenF3.menu.pnum.GENERIC_F303RBTX.upload.maximum_size=131072
1628+
GenF3.menu.pnum.GENERIC_F303RBTX.upload.maximum_data_size=32768
1629+
GenF3.menu.pnum.GENERIC_F303RBTX.build.board=GENERIC_F303RBTX
1630+
GenF3.menu.pnum.GENERIC_F303RBTX.build.product_line=STM32F303xC
1631+
GenF3.menu.pnum.GENERIC_F303RBTX.build.variant=STM32F3xx/F303R(B-C)Tx
1632+
1633+
# Generic F303RCTx
1634+
GenF3.menu.pnum.GENERIC_F303RCTX=Generic F303RCTx
1635+
GenF3.menu.pnum.GENERIC_F303RCTX.upload.maximum_size=262144
1636+
GenF3.menu.pnum.GENERIC_F303RCTX.upload.maximum_data_size=40960
1637+
GenF3.menu.pnum.GENERIC_F303RCTX.build.board=GENERIC_F303RCTX
1638+
GenF3.menu.pnum.GENERIC_F303RCTX.build.product_line=STM32F303xC
1639+
GenF3.menu.pnum.GENERIC_F303RCTX.build.variant=STM32F3xx/F303R(B-C)Tx
1640+
16161641
# Generic F303RDTx
16171642
GenF3.menu.pnum.GENERIC_F303RDTX=Generic F303RDTx
16181643
GenF3.menu.pnum.GENERIC_F303RDTX.upload.maximum_size=393216

Diff for: variants/STM32F3xx/F303R(B-C)Tx/generic_clock.c

+65-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,72 @@
1919
* @retval None
2020
*/
2121
WEAK void SystemClock_Config(void)
22+
#if defined(USBCON)
2223
{
23-
/* SystemClock_Config can be generated by STM32CubeMX */
24-
#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_MUL12;
37+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
38+
Error_Handler();
39+
}
40+
/** Initializes the CPU, AHB and APB buses clocks
41+
*/
42+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
43+
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
44+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
45+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
46+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
47+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
48+
49+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) {
50+
Error_Handler();
51+
}
52+
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB;
53+
PeriphClkInit.USBClockSelection = RCC_USBCLKSOURCE_PLL;
54+
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) {
55+
Error_Handler();
56+
}
57+
}
58+
#else
59+
{
60+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
61+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
62+
63+
/** Initializes the RCC Oscillators according to the specified parameters
64+
* in the RCC_OscInitTypeDef structure.
65+
*/
66+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
67+
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
68+
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
69+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
70+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
71+
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL16;
72+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
73+
Error_Handler();
74+
}
75+
/** Initializes the CPU, AHB and APB buses clocks
76+
*/
77+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
78+
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
79+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
80+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
81+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
82+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
83+
84+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
85+
Error_Handler();
86+
}
2587
}
88+
#endif /* USBCON */
2689

2790
#endif /* ARDUINO_GENERIC_* */

Diff for: variants/STM32F3xx/F303R(B-C)Tx/ldscript.ld

+179
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 STM32F303RCTx Device from STM32F3 series
6+
* 256Kbytes FLASH
7+
* 8Kbytes CCMRAM
8+
* 40Kbytes 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 : {
83+
. = ALIGN(4);
84+
*(.ARM.extab* .gnu.linkonce.armextab.*)
85+
. = ALIGN(4);
86+
} >FLASH
87+
88+
.ARM : {
89+
. = ALIGN(4);
90+
__exidx_start = .;
91+
*(.ARM.exidx*)
92+
__exidx_end = .;
93+
. = ALIGN(4);
94+
} >FLASH
95+
96+
.preinit_array :
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 :
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 :
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)