Skip to content

Commit a137815

Browse files
patricklaffpistm
andcommitted
variant(u5): add generic U595Z(I-J)TxQ, U599Z(I-J)TxQ, U5A5ZJTxQ and U5A9ZJTxQ
Signed-off-by: patricklaf <[email protected]> Co-authored-by: Frederic Pillon <[email protected]>
1 parent 0618372 commit a137815

File tree

5 files changed

+285
-2
lines changed

5 files changed

+285
-2
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,11 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
778778
| :green_heart: | STM32U585AIIxQ | Generic Board | *2.1.0* | |
779779
| :green_heart: | STM32U585CIx | Generic Board | *2.7.0* | |
780780
| :green_heart: | STM32U585ZITxQ | Generic Board | *2.1.0* | |
781+
| :yellow_heart: | STM32U595ZITxQ<br>STM32U595ZJTxQ | Generic Board | **2.11.0** | |
782+
| :yellow_heart: | STM32U599ZITxQ<br>STM32U599ZJTxQ | Generic Board | **2.11.0** | |
783+
| :yellow_heart: | STM32U5A5ZJTxQ | Generic Board | **2.11.0** | |
784+
| :yellow_heart: | STM32U5A9ZJTxQ | Generic Board | **2.11.0** | |
785+
781786

782787
### Generic STM32WB boards
783788

boards.txt

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12757,6 +12757,60 @@ GenU5.menu.pnum.GENERIC_U585ZITXQ.build.product_line=STM32U585xx
1275712757
GenU5.menu.pnum.GENERIC_U585ZITXQ.build.variant=STM32U5xx/U575Z(G-I)TxQ_U585ZITxQ
1275812758
GenU5.menu.pnum.GENERIC_U585ZITXQ.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32U5xx/STM32U585.svd
1275912759

12760+
# Generic U595ZITxQ
12761+
GenU5.menu.pnum.GENERIC_U595ZITXQ=Generic U595ZITxQ
12762+
GenU5.menu.pnum.GENERIC_U595ZITXQ.upload.maximum_size=2097152
12763+
GenU5.menu.pnum.GENERIC_U595ZITXQ.upload.maximum_data_size=2555904
12764+
GenU5.menu.pnum.GENERIC_U595ZITXQ.build.board=GENERIC_U595ZITXQ
12765+
GenU5.menu.pnum.GENERIC_U595ZITXQ.build.product_line=STM32U595xx
12766+
GenU5.menu.pnum.GENERIC_U595ZITXQ.build.variant=STM32U5xx/U595Z(I-J)TxQ_U599Z(I-J)TxQ_U5A5ZJTxQ_U5A9ZJTxQ
12767+
GenU5.menu.pnum.GENERIC_U595ZITXQ.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32U5xx/STM32U595.svd
12768+
12769+
# Generic U595ZJTxQ
12770+
GenU5.menu.pnum.GENERIC_U595ZJTXQ=Generic U595ZJTxQ
12771+
GenU5.menu.pnum.GENERIC_U595ZJTXQ.upload.maximum_size=4194304
12772+
GenU5.menu.pnum.GENERIC_U595ZJTXQ.upload.maximum_data_size=2555904
12773+
GenU5.menu.pnum.GENERIC_U595ZJTXQ.build.board=GENERIC_U595ZJTXQ
12774+
GenU5.menu.pnum.GENERIC_U595ZJTXQ.build.product_line=STM32U595xx
12775+
GenU5.menu.pnum.GENERIC_U595ZJTXQ.build.variant=STM32U5xx/U595Z(I-J)TxQ_U599Z(I-J)TxQ_U5A5ZJTxQ_U5A9ZJTxQ
12776+
GenU5.menu.pnum.GENERIC_U595ZJTXQ.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32U5xx/STM32U595.svd
12777+
12778+
# Generic U599ZITxQ
12779+
GenU5.menu.pnum.GENERIC_U599ZITXQ=Generic U599ZITxQ
12780+
GenU5.menu.pnum.GENERIC_U599ZITXQ.upload.maximum_size=2097152
12781+
GenU5.menu.pnum.GENERIC_U599ZITXQ.upload.maximum_data_size=2555904
12782+
GenU5.menu.pnum.GENERIC_U599ZITXQ.build.board=GENERIC_U599ZITXQ
12783+
GenU5.menu.pnum.GENERIC_U599ZITXQ.build.product_line=STM32U599xx
12784+
GenU5.menu.pnum.GENERIC_U599ZITXQ.build.variant=STM32U5xx/U595Z(I-J)TxQ_U599Z(I-J)TxQ_U5A5ZJTxQ_U5A9ZJTxQ
12785+
GenU5.menu.pnum.GENERIC_U599ZITXQ.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32U5xx/STM32U599.svd
12786+
12787+
# Generic U599ZJTxQ
12788+
GenU5.menu.pnum.GENERIC_U599ZJTXQ=Generic U599ZJTxQ
12789+
GenU5.menu.pnum.GENERIC_U599ZJTXQ.upload.maximum_size=4194304
12790+
GenU5.menu.pnum.GENERIC_U599ZJTXQ.upload.maximum_data_size=2555904
12791+
GenU5.menu.pnum.GENERIC_U599ZJTXQ.build.board=GENERIC_U599ZJTXQ
12792+
GenU5.menu.pnum.GENERIC_U599ZJTXQ.build.product_line=STM32U599xx
12793+
GenU5.menu.pnum.GENERIC_U599ZJTXQ.build.variant=STM32U5xx/U595Z(I-J)TxQ_U599Z(I-J)TxQ_U5A5ZJTxQ_U5A9ZJTxQ
12794+
GenU5.menu.pnum.GENERIC_U599ZJTXQ.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32U5xx/STM32U599.svd
12795+
12796+
# Generic U5A5ZJTxQ
12797+
GenU5.menu.pnum.GENERIC_U5A5ZJTXQ=Generic U5A5ZJTxQ
12798+
GenU5.menu.pnum.GENERIC_U5A5ZJTXQ.upload.maximum_size=4194304
12799+
GenU5.menu.pnum.GENERIC_U5A5ZJTXQ.upload.maximum_data_size=2555904
12800+
GenU5.menu.pnum.GENERIC_U5A5ZJTXQ.build.board=GENERIC_U5A5ZJTXQ
12801+
GenU5.menu.pnum.GENERIC_U5A5ZJTXQ.build.product_line=STM32U5A5xx
12802+
GenU5.menu.pnum.GENERIC_U5A5ZJTXQ.build.variant=STM32U5xx/U595Z(I-J)TxQ_U599Z(I-J)TxQ_U5A5ZJTxQ_U5A9ZJTxQ
12803+
GenU5.menu.pnum.GENERIC_U5A5ZJTXQ.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32U5xx/STM32U5A5.svd
12804+
12805+
# Generic U5A9ZJTxQ
12806+
GenU5.menu.pnum.GENERIC_U5A9ZJTXQ=Generic U5A9ZJTxQ
12807+
GenU5.menu.pnum.GENERIC_U5A9ZJTXQ.upload.maximum_size=4194304
12808+
GenU5.menu.pnum.GENERIC_U5A9ZJTXQ.upload.maximum_data_size=2555904
12809+
GenU5.menu.pnum.GENERIC_U5A9ZJTXQ.build.board=GENERIC_U5A9ZJTXQ
12810+
GenU5.menu.pnum.GENERIC_U5A9ZJTXQ.build.product_line=STM32U5A9xx
12811+
GenU5.menu.pnum.GENERIC_U5A9ZJTXQ.build.variant=STM32U5xx/U595Z(I-J)TxQ_U599Z(I-J)TxQ_U5A5ZJTxQ_U5A9ZJTxQ
12812+
GenU5.menu.pnum.GENERIC_U5A9ZJTXQ.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32U5xx/STM32U5A9.svd
12813+
1276012814
# Upload menu
1276112815
GenU5.menu.upload_method.swdMethod=STM32CubeProgrammer (SWD)
1276212816
GenU5.menu.upload_method.swdMethod.upload.protocol=swd

variants/STM32U5xx/U595Z(I-J)TxQ_U599Z(I-J)TxQ_U5A5ZJTxQ_U5A9ZJTxQ/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ target_link_libraries(variant INTERFACE variant_usage)
2121
add_library(variant_bin STATIC EXCLUDE_FROM_ALL
2222
generic_clock.c
2323
PeripheralPins.c
24+
PeripheralPins_NUCLEO_U5A5ZJ_Q.c
2425
variant_generic.cpp
2526
)
2627
target_link_libraries(variant_bin PUBLIC variant_usage)

variants/STM32U5xx/U595Z(I-J)TxQ_U599Z(I-J)TxQ_U5A5ZJTxQ_U5A9ZJTxQ/generic_clock.c

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,65 @@
2222
*/
2323
WEAK void SystemClock_Config(void)
2424
{
25-
/* SystemClock_Config can be generated by STM32CubeMX */
26-
#warning "SystemClock_Config() is empty. Default clock at reset is used."
25+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
26+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
27+
RCC_PeriphCLKInitTypeDef PeriphClkInit = {};
28+
29+
/** Configure the main internal regulator output voltage
30+
*/
31+
if (HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1) != HAL_OK) {
32+
Error_Handler();
33+
}
34+
35+
/** Initializes the CPU, AHB and APB buses clocks
36+
*/
37+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48 | RCC_OSCILLATORTYPE_HSI
38+
| RCC_OSCILLATORTYPE_LSI | RCC_OSCILLATORTYPE_MSI;
39+
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
40+
RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
41+
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
42+
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
43+
RCC_OscInitStruct.MSIState = RCC_MSI_ON;
44+
RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT;
45+
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_0;
46+
RCC_OscInitStruct.LSIDiv = RCC_LSI_DIV1;
47+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
48+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_MSI;
49+
RCC_OscInitStruct.PLL.PLLMBOOST = RCC_PLLMBOOST_DIV4;
50+
RCC_OscInitStruct.PLL.PLLM = 3;
51+
RCC_OscInitStruct.PLL.PLLN = 10;
52+
RCC_OscInitStruct.PLL.PLLP = 4;
53+
RCC_OscInitStruct.PLL.PLLQ = 2;
54+
RCC_OscInitStruct.PLL.PLLR = 1;
55+
RCC_OscInitStruct.PLL.PLLRGE = RCC_PLLVCIRANGE_1;
56+
RCC_OscInitStruct.PLL.PLLFRACN = 0;
57+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
58+
Error_Handler();
59+
}
60+
/** Initializes the CPU, AHB and APB buses clocks
61+
*/
62+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
63+
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2
64+
| RCC_CLOCKTYPE_PCLK3;
65+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
66+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
67+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
68+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
69+
RCC_ClkInitStruct.APB3CLKDivider = RCC_HCLK_DIV1;
70+
71+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4) != HAL_OK) {
72+
Error_Handler();
73+
}
74+
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADCDAC | RCC_PERIPHCLK_DAC1
75+
| RCC_PERIPHCLK_CLK48 | RCC_PERIPHCLK_LPUART1;
76+
PeriphClkInit.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_HSI;
77+
PeriphClkInit.AdcDacClockSelection = RCC_ADCDACCLKSOURCE_HSI;
78+
PeriphClkInit.Dac1ClockSelection = RCC_DAC1CLKSOURCE_LSI;
79+
PeriphClkInit.IclkClockSelection = RCC_CLK48CLKSOURCE_HSI48;
80+
81+
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) {
82+
Error_Handler();
83+
}
2784
}
2885

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

0 commit comments

Comments
 (0)