Skip to content

Commit 4719fe8

Browse files
committed
feat: add STM32U073C(8-B-C) and STM32U083CC generic board support
Signed-off-by: Andrew Yong <me@ndoo.sg>
1 parent 8da0622 commit 4719fe8

File tree

4 files changed

+311
-2
lines changed

4 files changed

+311
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
763763

764764
| Status | Device(s) | Name | Release | Notes |
765765
| :----: | :-------: | ---- | :-----: | :---- |
766+
| :yellow_heart: | STM32U073C8<br>STM32U073CB<br>STM32U073CC<br>STM32U083CC | Generic Board | *2.11.0* | |
766767
| :green_heart: | STM32U073R8<br>STSTM32U073RB<br>STM32U073RC | Generic Board | *2.9.0* | |
767768
| :green_heart: | STM32U083RC | Generic Board | *2.9.0* | |
768769

boards.txt

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12499,6 +12499,78 @@ GenU0.openocd.target=stm32u0x
1249912499
GenU0.vid.0=0x0483
1250012500
GenU0.pid.0=0x5740
1250112501

12502+
# Generic U073C8Tx
12503+
GenU0.menu.pnum.GENERIC_U073C8TX=Generic U073C8Tx
12504+
GenU0.menu.pnum.GENERIC_U073C8TX.upload.maximum_size=65536
12505+
GenU0.menu.pnum.GENERIC_U073C8TX.upload.maximum_data_size=40960
12506+
GenU0.menu.pnum.GENERIC_U073C8TX.build.board=GENERIC_U073C8TX
12507+
GenU0.menu.pnum.GENERIC_U073C8TX.build.product_line=STM32U073xx
12508+
GenU0.menu.pnum.GENERIC_U073C8TX.build.variant=STM32U0xx/U073C(8-B-C)(T-U)_U083CC(T-U)
12509+
GenU0.menu.pnum.GENERIC_U073C8TX.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32U0xx/STM32U073.svd
12510+
12511+
# Generic U073C8Ux
12512+
GenU0.menu.pnum.GENERIC_U073C8UX=Generic U073C8Ux
12513+
GenU0.menu.pnum.GENERIC_U073C8UX.upload.maximum_size=65536
12514+
GenU0.menu.pnum.GENERIC_U073C8UX.upload.maximum_data_size=40960
12515+
GenU0.menu.pnum.GENERIC_U073C8UX.build.board=GENERIC_U073C8UX
12516+
GenU0.menu.pnum.GENERIC_U073C8UX.build.product_line=STM32U073xx
12517+
GenU0.menu.pnum.GENERIC_U073C8UX.build.variant=STM32U0xx/U073C(8-B-C)(T-U)_U083CC(T-U)
12518+
GenU0.menu.pnum.GENERIC_U073C8UX.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32U0xx/STM32U073.svd
12519+
12520+
# Generic U073CBTx
12521+
GenU0.menu.pnum.GENERIC_U073CBTX=Generic U073CBTx
12522+
GenU0.menu.pnum.GENERIC_U073CBTX.upload.maximum_size=131072
12523+
GenU0.menu.pnum.GENERIC_U073CBTX.upload.maximum_data_size=40960
12524+
GenU0.menu.pnum.GENERIC_U073CBTX.build.board=GENERIC_U073CBTX
12525+
GenU0.menu.pnum.GENERIC_U073CBTX.build.product_line=STM32U073xx
12526+
GenU0.menu.pnum.GENERIC_U073CBTX.build.variant=STM32U0xx/U073C(8-B-C)(T-U)_U083CC(T-U)
12527+
GenU0.menu.pnum.GENERIC_U073CBTX.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32U0xx/STM32U073.svd
12528+
12529+
# Generic U073CBUx
12530+
GenU0.menu.pnum.GENERIC_U073CBUX=Generic U073CBUx
12531+
GenU0.menu.pnum.GENERIC_U073CBUX.upload.maximum_size=131072
12532+
GenU0.menu.pnum.GENERIC_U073CBUX.upload.maximum_data_size=40960
12533+
GenU0.menu.pnum.GENERIC_U073CBUX.build.board=GENERIC_U073CBUX
12534+
GenU0.menu.pnum.GENERIC_U073CBUX.build.product_line=STM32U073xx
12535+
GenU0.menu.pnum.GENERIC_U073CBUX.build.variant=STM32U0xx/U073C(8-B-C)(T-U)_U083CC(T-U)
12536+
GenU0.menu.pnum.GENERIC_U073CBUX.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32U0xx/STM32U073.svd
12537+
12538+
# Generic U073CCTx
12539+
GenU0.menu.pnum.GENERIC_U073CCTX=Generic U073CCTx
12540+
GenU0.menu.pnum.GENERIC_U073CCTX.upload.maximum_size=262144
12541+
GenU0.menu.pnum.GENERIC_U073CCTX.upload.maximum_data_size=40960
12542+
GenU0.menu.pnum.GENERIC_U073CCTX.build.board=GENERIC_U073CCTX
12543+
GenU0.menu.pnum.GENERIC_U073CCTX.build.product_line=STM32U073xx
12544+
GenU0.menu.pnum.GENERIC_U073CCTX.build.variant=STM32U0xx/U073C(8-B-C)(T-U)_U083CC(T-U)
12545+
GenU0.menu.pnum.GENERIC_U073CCTX.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32U0xx/STM32U073.svd
12546+
12547+
# Generic U073CCUx
12548+
GenU0.menu.pnum.GENERIC_U073CCUX=Generic U073CCUx
12549+
GenU0.menu.pnum.GENERIC_U073CCUX.upload.maximum_size=262144
12550+
GenU0.menu.pnum.GENERIC_U073CCUX.upload.maximum_data_size=40960
12551+
GenU0.menu.pnum.GENERIC_U073CCUX.build.board=GENERIC_U073CCUX
12552+
GenU0.menu.pnum.GENERIC_U073CCUX.build.product_line=STM32U073xx
12553+
GenU0.menu.pnum.GENERIC_U073CCUX.build.variant=STM32U0xx/U073C(8-B-C)(T-U)_U083CC(T-U)
12554+
GenU0.menu.pnum.GENERIC_U073CCUX.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32U0xx/STM32U073.svd
12555+
12556+
# Generic U083CCTx
12557+
GenU0.menu.pnum.GENERIC_U083CCTX=Generic U083CCTx
12558+
GenU0.menu.pnum.GENERIC_U083CCTX.upload.maximum_size=262144
12559+
GenU0.menu.pnum.GENERIC_U083CCTX.upload.maximum_data_size=40960
12560+
GenU0.menu.pnum.GENERIC_U083CCTX.build.board=GENERIC_U083CCTX
12561+
GenU0.menu.pnum.GENERIC_U083CCTX.build.product_line=STM32U083xx
12562+
GenU0.menu.pnum.GENERIC_U083CCTX.build.variant=STM32U0xx/U073C(8-B-C)(T-U)_U083CC(T-U)
12563+
GenU0.menu.pnum.GENERIC_U083CCTX.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32U0xx/STM32U083.svd
12564+
12565+
# Generic U083CCUx
12566+
GenU0.menu.pnum.GENERIC_U083CCUX=Generic U083CCUx
12567+
GenU0.menu.pnum.GENERIC_U083CCUX.upload.maximum_size=262144
12568+
GenU0.menu.pnum.GENERIC_U083CCUX.upload.maximum_data_size=40960
12569+
GenU0.menu.pnum.GENERIC_U083CCUX.build.board=GENERIC_U083CCUX
12570+
GenU0.menu.pnum.GENERIC_U083CCUX.build.product_line=STM32U083xx
12571+
GenU0.menu.pnum.GENERIC_U083CCUX.build.variant=STM32U0xx/U073C(8-B-C)(T-U)_U083CC(T-U)
12572+
GenU0.menu.pnum.GENERIC_U083CCUX.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32U0xx/STM32U083.svd
12573+
1250212574
# Generic U073R8Ix
1250312575
GenU0.menu.pnum.GENERIC_U073R8IX=Generic U073R8Ix
1250412576
GenU0.menu.pnum.GENERIC_U073R8IX.upload.maximum_size=65536

variants/STM32U0xx/U073C(8-B-C)(T-U)_U083CC(T-U)/generic_clock.c

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,57 @@
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+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
27+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
28+
RCC_PeriphCLKInitTypeDef PeriphClkInit = {};
29+
30+
/** Configure the main internal regulator output voltage
31+
*/
32+
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1);
33+
34+
/** Initializes the RCC Oscillators according to the specified parameters
35+
* in the RCC_OscInitTypeDef structure.
36+
*/
37+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSI48;
38+
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
39+
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
40+
RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
41+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
42+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
43+
RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV1;
44+
RCC_OscInitStruct.PLL.PLLN = 7;
45+
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
46+
RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2;
47+
RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2;
48+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
49+
Error_Handler();
50+
}
51+
52+
/** Initializes the CPU, AHB and APB buses clocks
53+
*/
54+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
55+
| RCC_CLOCKTYPE_PCLK1;
56+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
57+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
58+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
59+
60+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
61+
Error_Handler();
62+
}
63+
64+
/** Initializes the peripherals clocks
65+
*/
66+
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_LPUART1 | RCC_PERIPHCLK_LPUART2
67+
| RCC_PERIPHCLK_LPUART3 | RCC_PERIPHCLK_USB;
68+
PeriphClkInit.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_HSI;
69+
PeriphClkInit.Lpuart2ClockSelection = RCC_LPUART2CLKSOURCE_HSI;
70+
PeriphClkInit.Lpuart3ClockSelection = RCC_LPUART3CLKSOURCE_HSI;
71+
PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
72+
73+
74+
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) {
75+
Error_Handler();
76+
}
2877
}
2978

3079
#endif /* ARDUINO_GENERIC_* */
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
/*
2+
******************************************************************************
3+
**
4+
** @file : LinkerScript.ld
5+
**
6+
** @author : Auto-generated by STM32CubeIDE
7+
**
8+
** @brief : Linker script for STM32U073CCTx Device from STM32U0 series
9+
** 256KBytes FLASH
10+
** 32KBytes 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) 2025 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 (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
89+
{
90+
. = ALIGN(4);
91+
*(.ARM.extab* .gnu.linkonce.armextab.*)
92+
. = ALIGN(4);
93+
} >FLASH
94+
95+
.ARM (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
96+
{
97+
. = ALIGN(4);
98+
__exidx_start = .;
99+
*(.ARM.exidx*)
100+
__exidx_end = .;
101+
. = ALIGN(4);
102+
} >FLASH
103+
104+
.preinit_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
105+
{
106+
. = ALIGN(4);
107+
PROVIDE_HIDDEN (__preinit_array_start = .);
108+
KEEP (*(.preinit_array*))
109+
PROVIDE_HIDDEN (__preinit_array_end = .);
110+
. = ALIGN(4);
111+
} >FLASH
112+
113+
.init_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
114+
{
115+
. = ALIGN(4);
116+
PROVIDE_HIDDEN (__init_array_start = .);
117+
KEEP (*(SORT(.init_array.*)))
118+
KEEP (*(.init_array*))
119+
PROVIDE_HIDDEN (__init_array_end = .);
120+
. = ALIGN(4);
121+
} >FLASH
122+
123+
.fini_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
124+
{
125+
. = ALIGN(4);
126+
PROVIDE_HIDDEN (__fini_array_start = .);
127+
KEEP (*(SORT(.fini_array.*)))
128+
KEEP (*(.fini_array*))
129+
PROVIDE_HIDDEN (__fini_array_end = .);
130+
. = ALIGN(4);
131+
} >FLASH
132+
133+
/* Used by the startup to initialize data */
134+
_sidata = LOADADDR(.data);
135+
136+
/* Initialized data sections into "RAM" Ram type memory */
137+
.data :
138+
{
139+
. = ALIGN(4);
140+
_sdata = .; /* create a global symbol at data start */
141+
*(.data) /* .data sections */
142+
*(.data*) /* .data* sections */
143+
*(.RamFunc) /* .RamFunc sections */
144+
*(.RamFunc*) /* .RamFunc* sections */
145+
146+
. = ALIGN(4);
147+
_edata = .; /* define a global symbol at data end */
148+
149+
} >RAM AT> FLASH
150+
151+
/* Uninitialized data section into "RAM" Ram type memory */
152+
. = ALIGN(4);
153+
.bss :
154+
{
155+
/* This is used by the startup in order to initialize the .bss section */
156+
_sbss = .; /* define a global symbol at bss start */
157+
__bss_start__ = _sbss;
158+
*(.bss)
159+
*(.bss*)
160+
*(COMMON)
161+
162+
. = ALIGN(4);
163+
_ebss = .; /* define a global symbol at bss end */
164+
__bss_end__ = _ebss;
165+
} >RAM
166+
167+
/* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
168+
._user_heap_stack :
169+
{
170+
. = ALIGN(8);
171+
PROVIDE ( end = . );
172+
PROVIDE ( _end = . );
173+
. = . + _Min_Heap_Size;
174+
. = . + _Min_Stack_Size;
175+
. = ALIGN(8);
176+
} >RAM
177+
178+
/* Remove information from the compiler libraries */
179+
/DISCARD/ :
180+
{
181+
libc.a ( * )
182+
libm.a ( * )
183+
libgcc.a ( * )
184+
}
185+
186+
.ARM.attributes 0 : { *(.ARM.attributes) }
187+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy