Skip to content

Commit cbcaa18

Browse files
committed
variant: U5: add U575Z(G-I)TxQ and U585ZETxQ generic support
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 872a0d8 commit cbcaa18

File tree

4 files changed

+272
-2
lines changed

4 files changed

+272
-2
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
6565
- [Generic STM32L1 boards](#generic-stm32l1-boards)
6666
- [Generic STM32L4 boards](#generic-stm32l4-boards)
6767
- [Generic STM32L5 boards](#generic-stm32l5-boards)
68+
- [Generic STM32U5 boards](#generic-stm32u5-boards)
6869
- [Generic STM32WB boards](#generic-stm32wb-boards)
70+
- [Generic STM32WL boards](#generic-stm32wb-boards)
6971
- [3D printer boards](#3d-printer-boards)
7072
- [LoRa boards](#lora-boards)
7173
- [Electronic Speed Controller boards](#electronic-speed-controller-boards)
@@ -409,6 +411,12 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
409411
| :green_heart: | STM32L552ZC-Q<br>STM32L552ZE-Q | Generic Board | *2.0.0* | |
410412
| :green_heart: | STM32L562ZE-Q | Generic Board | *2.0.0* | |
411413

414+
### Generic STM32U5 boards
415+
416+
| Status | Device(s) | Name | Release | Notes |
417+
| :----: | :-------: | ---- | :-----: | :---- |
418+
| :yellow_heart: | STM32U575ZGTxQ<br>STM32U575ZITxQ<br>STM32U585ZETxQ | Generic Board | **2.1.0** | |
419+
412420
### Generic STM32WB boards
413421

414422
| Status | Device(s) | Name | Release | Notes |

boards.txt

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5057,6 +5057,58 @@ GenL5.menu.upload_method.dfuMethod.upload.protocol=2
50575057
GenL5.menu.upload_method.dfuMethod.upload.options=-g
50585058
GenL5.menu.upload_method.dfuMethod.upload.tool=stm32CubeProg
50595059

5060+
################################################################################
5061+
# Generic U5
5062+
GenU5.name=Generic STM32U5 series
5063+
5064+
GenU5.build.core=arduino
5065+
GenU5.build.board=GenU5
5066+
GenU5.build.extra_flags=-D{build.product_line} {build.enable_usb} {build.xSerial}
5067+
GenU5.build.mcu=cortex-m33
5068+
GenU5.build.flags.fp=-mfpu=fpv4-sp-d16 -mfloat-abi=hard
5069+
GenU5.build.series=STM32U5xx
5070+
GenU5.build.cmsis_lib_gcc=arm_ARMv8MMLlfsp_math
5071+
5072+
# Generic U575ZGTxQ
5073+
GenU5.menu.pnum.GENERIC_U575ZGTXQ=Generic U575ZGTxQ
5074+
GenU5.menu.pnum.GENERIC_U575ZGTXQ.upload.maximum_size=1048576
5075+
GenU5.menu.pnum.GENERIC_U575ZGTXQ.upload.maximum_data_size=262144
5076+
GenU5.menu.pnum.GENERIC_U575ZGTXQ.build.board=GENERIC_U575ZGTXQ
5077+
GenU5.menu.pnum.GENERIC_U575ZGTXQ.build.product_line=STM32U575xx
5078+
GenU5.menu.pnum.GENERIC_U575ZGTXQ.build.variant=STM32U5xx/U575Z(G-I)TxQ_U585ZETxQ
5079+
5080+
# Generic U575ZITxQ
5081+
GenU5.menu.pnum.GENERIC_U575ZITXQ=Generic U575ZITxQ
5082+
GenU5.menu.pnum.GENERIC_U575ZITXQ.upload.maximum_size=2097152
5083+
GenU5.menu.pnum.GENERIC_U575ZITXQ.upload.maximum_data_size=262144
5084+
GenU5.menu.pnum.GENERIC_U575ZITXQ.build.board=GENERIC_U575ZITXQ
5085+
GenU5.menu.pnum.GENERIC_U575ZITXQ.build.product_line=STM32U575xx
5086+
GenU5.menu.pnum.GENERIC_U575ZITXQ.build.variant=STM32U5xx/U575Z(G-I)TxQ_U585ZETxQ
5087+
5088+
# Generic U585ZETxQ
5089+
GenU5.menu.pnum.GENERIC_U585ZETXQ=Generic U585ZETxQ
5090+
GenU5.menu.pnum.GENERIC_U585ZETXQ.upload.maximum_size=524288
5091+
GenU5.menu.pnum.GENERIC_U585ZETXQ.upload.maximum_data_size=262144
5092+
GenU5.menu.pnum.GENERIC_U585ZETXQ.build.board=GENERIC_U585ZETXQ
5093+
GenU5.menu.pnum.GENERIC_U585ZETXQ.build.product_line=STM32U585xx
5094+
GenU5.menu.pnum.GENERIC_U585ZETXQ.build.variant=STM32U5xx/U575Z(G-I)TxQ_U585ZETxQ
5095+
5096+
# Upload menu
5097+
GenU5.menu.upload_method.swdMethod=STM32CubeProgrammer (SWD)
5098+
GenU5.menu.upload_method.swdMethod.upload.protocol=0
5099+
GenU5.menu.upload_method.swdMethod.upload.options=-g
5100+
GenU5.menu.upload_method.swdMethod.upload.tool=stm32CubeProg
5101+
5102+
GenU5.menu.upload_method.serialMethod=STM32CubeProgrammer (Serial)
5103+
GenU5.menu.upload_method.serialMethod.upload.protocol=1
5104+
GenU5.menu.upload_method.serialMethod.upload.options={serial.port.file} -s
5105+
GenU5.menu.upload_method.serialMethod.upload.tool=stm32CubeProg
5106+
5107+
GenU5.menu.upload_method.dfuMethod=STM32CubeProgrammer (DFU)
5108+
GenU5.menu.upload_method.dfuMethod.upload.protocol=2
5109+
GenU5.menu.upload_method.dfuMethod.upload.options=-g
5110+
GenU5.menu.upload_method.dfuMethod.upload.tool=stm32CubeProg
5111+
50605112
################################################################################
50615113
# Generic WB
50625114
GenWB.name=Generic STM32WB series

variants/STM32U5xx/U575Z(G-I)TxQ_U585ZETxQ/generic_clock.c

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,51 @@
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 = {0};
25+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
26+
27+
/** Configure the main internal regulator output voltage
28+
*/
29+
if (HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1) != HAL_OK) {
30+
Error_Handler();
31+
}
32+
/** Initializes the CPU, AHB and APB busses clocks
33+
*/
34+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48 | RCC_OSCILLATORTYPE_LSI
35+
| RCC_OSCILLATORTYPE_MSI;
36+
RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
37+
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
38+
RCC_OscInitStruct.MSIState = RCC_MSI_ON;
39+
RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT;
40+
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_0;
41+
RCC_OscInitStruct.LSIDiv = RCC_LSI_DIV1;
42+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
43+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_MSI;
44+
RCC_OscInitStruct.PLL.PLLMBOOST = RCC_PLLMBOOST_DIV4;
45+
RCC_OscInitStruct.PLL.PLLM = 3;
46+
RCC_OscInitStruct.PLL.PLLN = 10;
47+
RCC_OscInitStruct.PLL.PLLP = 4;
48+
RCC_OscInitStruct.PLL.PLLQ = 2;
49+
RCC_OscInitStruct.PLL.PLLR = 1;
50+
RCC_OscInitStruct.PLL.PLLRGE = RCC_PLLVCIRANGE_1;
51+
RCC_OscInitStruct.PLL.PLLFRACN = 0;
52+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
53+
Error_Handler();
54+
}
55+
/** Initializes the CPU, AHB and APB busses clocks
56+
*/
57+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
58+
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2
59+
| RCC_CLOCKTYPE_PCLK3;
60+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
61+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
62+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
63+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
64+
RCC_ClkInitStruct.APB3CLKDivider = RCC_HCLK_DIV1;
65+
66+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4) != HAL_OK) {
67+
Error_Handler();
68+
}
2669
}
2770

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

0 commit comments

Comments
 (0)