Skip to content

Commit 292819f

Browse files
committed
variants(C0): add generic C011D6, C011F(4-6)(P-U) and C031F(4-6)P
Signed-off-by: Frederic Pillon <[email protected]>
1 parent c6bc5b2 commit 292819f

File tree

4 files changed

+270
-2
lines changed

4 files changed

+270
-2
lines changed

Diff for: README.md

+3
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,10 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
189189

190190
| Status | Device(s) | Name | Release | Notes |
191191
| :----: | :-------: | ---- | :-----: | :---- |
192+
| :yellow_heart: | STM32C011D6 | Generic Board | **2.6.0** | |
193+
| :yellow_heart: | STM32C011F4<br>STM32C011F6 | Generic Board | **2.6.0** | |
192194
| :green_heart: | STM32C031C4<br>STM32C031C6 | Generic Board | *2.5.0* | |
195+
| :yellow_heart: | STM32C031F4<br>STM32C031F6 | Generic Board | **2.6.0** | |
193196

194197
### Generic STM32F0 boards
195198

Diff for: boards.txt

+56
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,46 @@ GenC0.build.flash_offset=0x0
12071207
GenC0.upload.maximum_size=0
12081208
GenC0.upload.maximum_data_size=0
12091209

1210+
# Generic C011D6Yx
1211+
GenC0.menu.pnum.GENERIC_C011D6YX=Generic C011D6Yx
1212+
GenC0.menu.pnum.GENERIC_C011D6YX.upload.maximum_size=32768
1213+
GenC0.menu.pnum.GENERIC_C011D6YX.upload.maximum_data_size=6144
1214+
GenC0.menu.pnum.GENERIC_C011D6YX.build.board=GENERIC_C011D6YX
1215+
GenC0.menu.pnum.GENERIC_C011D6YX.build.product_line=STM32C011xx
1216+
GenC0.menu.pnum.GENERIC_C011D6YX.build.variant=STM32C0xx/C011D6Y_C011F(4-6)(P-U)_C031F(4-6)P
1217+
1218+
# Generic C011F4Px
1219+
GenC0.menu.pnum.GENERIC_C011F4PX=Generic C011F4Px
1220+
GenC0.menu.pnum.GENERIC_C011F4PX.upload.maximum_size=16384
1221+
GenC0.menu.pnum.GENERIC_C011F4PX.upload.maximum_data_size=6144
1222+
GenC0.menu.pnum.GENERIC_C011F4PX.build.board=GENERIC_C011F4PX
1223+
GenC0.menu.pnum.GENERIC_C011F4PX.build.product_line=STM32C011xx
1224+
GenC0.menu.pnum.GENERIC_C011F4PX.build.variant=STM32C0xx/C011D6Y_C011F(4-6)(P-U)_C031F(4-6)P
1225+
1226+
# Generic C011F6Px
1227+
GenC0.menu.pnum.GENERIC_C011F6PX=Generic C011F6Px
1228+
GenC0.menu.pnum.GENERIC_C011F6PX.upload.maximum_size=32768
1229+
GenC0.menu.pnum.GENERIC_C011F6PX.upload.maximum_data_size=6144
1230+
GenC0.menu.pnum.GENERIC_C011F6PX.build.board=GENERIC_C011F6PX
1231+
GenC0.menu.pnum.GENERIC_C011F6PX.build.product_line=STM32C011xx
1232+
GenC0.menu.pnum.GENERIC_C011F6PX.build.variant=STM32C0xx/C011D6Y_C011F(4-6)(P-U)_C031F(4-6)P
1233+
1234+
# Generic C011F4Ux
1235+
GenC0.menu.pnum.GENERIC_C011F4UX=Generic C011F4Ux
1236+
GenC0.menu.pnum.GENERIC_C011F4UX.upload.maximum_size=16384
1237+
GenC0.menu.pnum.GENERIC_C011F4UX.upload.maximum_data_size=6144
1238+
GenC0.menu.pnum.GENERIC_C011F4UX.build.board=GENERIC_C011F4UX
1239+
GenC0.menu.pnum.GENERIC_C011F4UX.build.product_line=STM32C011xx
1240+
GenC0.menu.pnum.GENERIC_C011F4UX.build.variant=STM32C0xx/C011D6Y_C011F(4-6)(P-U)_C031F(4-6)P
1241+
1242+
# Generic C011F6Ux
1243+
GenC0.menu.pnum.GENERIC_C011F6UX=Generic C011F6Ux
1244+
GenC0.menu.pnum.GENERIC_C011F6UX.upload.maximum_size=32768
1245+
GenC0.menu.pnum.GENERIC_C011F6UX.upload.maximum_data_size=6144
1246+
GenC0.menu.pnum.GENERIC_C011F6UX.build.board=GENERIC_C011F6UX
1247+
GenC0.menu.pnum.GENERIC_C011F6UX.build.product_line=STM32C011xx
1248+
GenC0.menu.pnum.GENERIC_C011F6UX.build.variant=STM32C0xx/C011D6Y_C011F(4-6)(P-U)_C031F(4-6)P
1249+
12101250
# Generic C031C4Tx
12111251
GenC0.menu.pnum.GENERIC_C031C4TX=Generic C031C4Tx
12121252
GenC0.menu.pnum.GENERIC_C031C4TX.upload.maximum_size=16384
@@ -1239,6 +1279,22 @@ GenC0.menu.pnum.GENERIC_C031C6UX.build.board=GENERIC_C031C6UX
12391279
GenC0.menu.pnum.GENERIC_C031C6UX.build.product_line=STM32C031xx
12401280
GenC0.menu.pnum.GENERIC_C031C6UX.build.variant=STM32C0xx/C031C(4-6)(T-U)
12411281

1282+
# Generic C031F4Px
1283+
GenC0.menu.pnum.GENERIC_C031F4PX=Generic C031F4Px
1284+
GenC0.menu.pnum.GENERIC_C031F4PX.upload.maximum_size=16384
1285+
GenC0.menu.pnum.GENERIC_C031F4PX.upload.maximum_data_size=12288
1286+
GenC0.menu.pnum.GENERIC_C031F4PX.build.board=GENERIC_C031F4PX
1287+
GenC0.menu.pnum.GENERIC_C031F4PX.build.product_line=STM32C031xx
1288+
GenC0.menu.pnum.GENERIC_C031F4PX.build.variant=STM32C0xx/C011D6Y_C011F(4-6)(P-U)_C031F(4-6)P
1289+
1290+
# Generic C031F6Px
1291+
GenC0.menu.pnum.GENERIC_C031F6PX=Generic C031F6Px
1292+
GenC0.menu.pnum.GENERIC_C031F6PX.upload.maximum_size=32768
1293+
GenC0.menu.pnum.GENERIC_C031F6PX.upload.maximum_data_size=12288
1294+
GenC0.menu.pnum.GENERIC_C031F6PX.build.board=GENERIC_C031F6PX
1295+
GenC0.menu.pnum.GENERIC_C031F6PX.build.product_line=STM32C031xx
1296+
GenC0.menu.pnum.GENERIC_C031F6PX.build.variant=STM32C0xx/C011D6Y_C011F(4-6)(P-U)_C031F(4-6)P
1297+
12421298
# Upload menu
12431299
GenC0.menu.upload_method.swdMethod=STM32CubeProgrammer (SWD)
12441300
GenC0.menu.upload_method.swdMethod.upload.protocol=0

Diff for: variants/STM32C0xx/C011D6Y_C011F(4-6)(P-U)_C031F(4-6)P/generic_clock.c

+26-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,32 @@
2323
*/
2424
WEAK void SystemClock_Config(void)
2525
{
26-
/* SystemClock_Config can be generated by STM32CubeMX */
27-
#warning "SystemClock_Config() is empty. Default clock at reset is used."
26+
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
27+
28+
/* HSI configuration and activation */
29+
LL_RCC_HSI_Enable();
30+
while (LL_RCC_HSI_IsReady() != 1) {
31+
}
32+
33+
LL_RCC_HSI_SetCalibTrimming(64);
34+
LL_RCC_SetHSIDiv(LL_RCC_HSI_DIV_1);
35+
/* Set AHB prescaler*/
36+
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
37+
38+
/* Sysclk activation on the HSI */
39+
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSI);
40+
while (LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_HSI) {
41+
}
42+
43+
/* Set APB1 prescaler*/
44+
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
45+
/* Update CMSIS variable (which can be updated also through SystemCoreClockUpdate function) */
46+
LL_SetSystemCoreClock(48000000);
47+
48+
/* Update the time base */
49+
if (HAL_InitTick(TICK_INT_PRIORITY) != HAL_OK) {
50+
Error_Handler();
51+
}
2852
}
2953

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

0 commit comments

Comments
 (0)