Skip to content

Commit 8c52be2

Browse files
committed
variant(H5): add H563IIKxQ and STM32H573IIKxQ generic support
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 37ff544 commit 8c52be2

File tree

4 files changed

+275
-2
lines changed

4 files changed

+275
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,9 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
513513

514514
| Status | Device(s) | Name | Release | Notes |
515515
| :----: | :-------: | ---- | :-----: | :---- |
516+
| :yellow_heart: | STM32H563IIKxQ | Generic Board | **2.6.0** | |
516517
| :yellow_heart: | STM32H563ZG<br>STM32H563ZI | Generic Board | **2.6.0** | |
518+
| :yellow_heart: | STM32H573IIKxQ | Generic Board | **2.6.0** | |
517519
| :yellow_heart: | STM32H573ZI | Generic Board | **2.6.0** | |
518520

519521
### Generic STM32H7 boards

boards.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7156,6 +7156,14 @@ GenH5.build.flash_offset=0x0
71567156
GenH5.upload.maximum_size=0
71577157
GenH5.upload.maximum_data_size=0
71587158

7159+
# Generic H563IIKxQ
7160+
GenH5.menu.pnum.GENERIC_H563IIKXQ=Generic H563IIKxQ
7161+
GenH5.menu.pnum.GENERIC_H563IIKXQ.upload.maximum_size=2097152
7162+
GenH5.menu.pnum.GENERIC_H563IIKXQ.upload.maximum_data_size=655360
7163+
GenH5.menu.pnum.GENERIC_H563IIKXQ.build.board=GENERIC_H563IIKXQ
7164+
GenH5.menu.pnum.GENERIC_H563IIKXQ.build.product_line=STM32H563xx
7165+
GenH5.menu.pnum.GENERIC_H563IIKXQ.build.variant=STM32H5xx/H563IIKxQ_H573IIKxQ
7166+
71597167
# Generic H563ZGTx
71607168
GenH5.menu.pnum.GENERIC_H563ZGTX=Generic H563ZGTx
71617169
GenH5.menu.pnum.GENERIC_H563ZGTX.upload.maximum_size=1048576
@@ -7172,6 +7180,14 @@ GenH5.menu.pnum.GENERIC_H563ZITX.build.board=GENERIC_H563ZITX
71727180
GenH5.menu.pnum.GENERIC_H563ZITX.build.product_line=STM32H563xx
71737181
GenH5.menu.pnum.GENERIC_H563ZITX.build.variant=STM32H5xx/H563Z(G-I)T_H573ZIT
71747182

7183+
# Generic H573IIKxQ
7184+
GenH5.menu.pnum.GENERIC_H573IIKXQ=Generic H573IIKxQ
7185+
GenH5.menu.pnum.GENERIC_H573IIKXQ.upload.maximum_size=2097152
7186+
GenH5.menu.pnum.GENERIC_H573IIKXQ.upload.maximum_data_size=655360
7187+
GenH5.menu.pnum.GENERIC_H573IIKXQ.build.board=GENERIC_H573IIKXQ
7188+
GenH5.menu.pnum.GENERIC_H573IIKXQ.build.product_line=STM32H573xx
7189+
GenH5.menu.pnum.GENERIC_H573IIKXQ.build.variant=STM32H5xx/H563IIKxQ_H573IIKxQ
7190+
71757191
# Generic H573ZITx
71767192
GenH5.menu.pnum.GENERIC_H573ZITX=Generic H573ZITx
71777193
GenH5.menu.pnum.GENERIC_H573ZITX.upload.maximum_size=2097152

variants/STM32H5xx/H563IIKxQ_H573IIKxQ/generic_clock.c

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,78 @@
2020
*/
2121
WEAK void SystemClock_Config(void)
2222
{
23-
/* SystemClock_Config can be generated by STM32CubeMX */
24-
#warning "SystemClock_Config() is empty. Default clock at reset is used."
23+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
24+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
25+
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {};
26+
27+
/** Configure the main internal regulator output voltage
28+
*/
29+
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE0);
30+
31+
while (!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {}
32+
33+
/** Initializes the RCC Oscillators according to the specified parameters
34+
* in the RCC_OscInitTypeDef structure.
35+
*/
36+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48 | RCC_OSCILLATORTYPE_HSI
37+
| RCC_OSCILLATORTYPE_LSI | RCC_OSCILLATORTYPE_CSI;
38+
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
39+
RCC_OscInitStruct.HSIDiv = RCC_HSI_DIV2;
40+
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
41+
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
42+
RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
43+
RCC_OscInitStruct.CSIState = RCC_CSI_ON;
44+
RCC_OscInitStruct.CSICalibrationValue = RCC_CSICALIBRATION_DEFAULT;
45+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
46+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLL1_SOURCE_CSI;
47+
RCC_OscInitStruct.PLL.PLLM = 1;
48+
RCC_OscInitStruct.PLL.PLLN = 125;
49+
RCC_OscInitStruct.PLL.PLLP = 2;
50+
RCC_OscInitStruct.PLL.PLLQ = 4;
51+
RCC_OscInitStruct.PLL.PLLR = 2;
52+
RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1_VCIRANGE_2;
53+
RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1_VCORANGE_WIDE;
54+
RCC_OscInitStruct.PLL.PLLFRACN = 0;
55+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
56+
Error_Handler();
57+
}
58+
59+
/** Initializes the CPU, AHB and APB buses clocks
60+
*/
61+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
62+
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2
63+
| RCC_CLOCKTYPE_PCLK3;
64+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
65+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
66+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
67+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
68+
RCC_ClkInitStruct.APB3CLKDivider = RCC_HCLK_DIV1;
69+
70+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) {
71+
Error_Handler();
72+
}
73+
74+
/** Initializes the peripherals clock
75+
*/
76+
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_ADCDAC | RCC_PERIPHCLK_DAC | RCC_PERIPHCLK_LPUART1 | RCC_PERIPHCLK_OSPI | RCC_PERIPHCLK_SDMMC1 | RCC_PERIPHCLK_USB;
77+
PeriphClkInitStruct.AdcDacClockSelection = RCC_ADCDACCLKSOURCE_HCLK;
78+
PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_HSI;
79+
PeriphClkInitStruct.PLL2.PLL2Source = RCC_PLL2_SOURCE_CSI;
80+
PeriphClkInitStruct.PLL2.PLL2M = 1;
81+
PeriphClkInitStruct.PLL2.PLL2N = 120;
82+
PeriphClkInitStruct.PLL2.PLL2P = 2;
83+
PeriphClkInitStruct.PLL2.PLL2Q = 2;
84+
PeriphClkInitStruct.PLL2.PLL2R = 10;
85+
PeriphClkInitStruct.PLL2.PLL2RGE = RCC_PLL2_VCIRANGE_2;
86+
PeriphClkInitStruct.PLL2.PLL2VCOSEL = RCC_PLL2_VCORANGE_WIDE;
87+
PeriphClkInitStruct.PLL2.PLL2FRACN = 0;
88+
PeriphClkInitStruct.PLL2.PLL2ClockOut = RCC_PLL2_DIVR;
89+
PeriphClkInitStruct.Sdmmc1ClockSelection = RCC_SDMMC1CLKSOURCE_PLL2R;
90+
PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
91+
92+
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) {
93+
Error_Handler();
94+
}
2595
}
2696

2797
#endif /* ARDUINO_GENERIC_* */
Lines changed: 185 additions & 0 deletions
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 STM32H573IIKxQ Device from STM32H5 series
9+
** 2048Kbytes FLASH
10+
** 640Kbytes 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 = 0x08000000 + 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)
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