Skip to content

Commit 2ef2edb

Browse files
haydenthfpistm
andcommitted
variant(l5): add generic L552Q(C-E)IxQ and L562QEIxQ
Signed-off-by: Tom Hayden <thayden@gmail.com> Co-Authored-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 7ef0723 commit 2ef2edb

File tree

4 files changed

+272
-1
lines changed

4 files changed

+272
-1
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,9 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
743743
| Status | Device(s) | Name | Release | Notes |
744744
| :----: | :-------: | ---- | :-----: | :---- |
745745
| :green_heart: | STM32L552ZC-Q<br>STM32L552ZE-Q | Generic Board | *2.0.0* | |
746+
| :yellow_heart: | STM32L552QCIxQ<br>STM32L552QEIxQ | Generic Board | **2.11.0** | |
746747
| :green_heart: | STM32L562ZE-Q | Generic Board | *2.0.0* | |
748+
| :yellow_heart: | STM32L562QEIxQ | Generic Board | **2.11.0** | |
747749

748750
### Generic STM32U0 boards
749751

boards.txt

+27
Original file line numberDiff line numberDiff line change
@@ -12226,6 +12226,24 @@ GenL5.openocd.target=stm32l5x
1222612226
GenL5.vid.0=0x0483
1222712227
GenL5.pid.0=0x5740
1222812228

12229+
# Generic L552QCIxQ
12230+
GenL5.menu.pnum.GENERIC_L552QCIXQ=Generic L552QCIxQ
12231+
GenL5.menu.pnum.GENERIC_L552QCIXQ.upload.maximum_size=262144
12232+
GenL5.menu.pnum.GENERIC_L552QCIXQ.upload.maximum_data_size=262144
12233+
GenL5.menu.pnum.GENERIC_L552QCIXQ.build.board=GENERIC_L552QCIXQ
12234+
GenL5.menu.pnum.GENERIC_L552QCIXQ.build.product_line=STM32L552xx
12235+
GenL5.menu.pnum.GENERIC_L552QCIXQ.build.variant=STM32L5xx/L552Q(C-E)IxQ_L562QEIxQ
12236+
GenL5.menu.pnum.GENERIC_L552QCIXQ.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32L5xx/STM32L552.svd
12237+
12238+
# Generic L552QEIxQ
12239+
GenL5.menu.pnum.GENERIC_L552QEIXQ=Generic L552QEIxQ
12240+
GenL5.menu.pnum.GENERIC_L552QEIXQ.upload.maximum_size=524288
12241+
GenL5.menu.pnum.GENERIC_L552QEIXQ.upload.maximum_data_size=262144
12242+
GenL5.menu.pnum.GENERIC_L552QEIXQ.build.board=GENERIC_L552QEIXQ
12243+
GenL5.menu.pnum.GENERIC_L552QEIXQ.build.product_line=STM32L552xx
12244+
GenL5.menu.pnum.GENERIC_L552QEIXQ.build.variant=STM32L5xx/L552Q(C-E)IxQ_L562QEIxQ
12245+
GenL5.menu.pnum.GENERIC_L552QEIXQ.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32L5xx/STM32L552.svd
12246+
1222912247
# Generic L552ZCTxQ
1223012248
GenL5.menu.pnum.GENERIC_L552ZCTXQ=Generic L552ZCTxQ
1223112249
GenL5.menu.pnum.GENERIC_L552ZCTXQ.upload.maximum_size=262144
@@ -12244,6 +12262,15 @@ GenL5.menu.pnum.GENERIC_L552ZETXQ.build.product_line=STM32L552xx
1224412262
GenL5.menu.pnum.GENERIC_L552ZETXQ.build.variant=STM32L5xx/L552Z(C-E)TxQ_L562ZETxQ
1224512263
GenL5.menu.pnum.GENERIC_L552ZETXQ.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32L5xx/STM32L552.svd
1224612264

12265+
# Generic L562QC-EIxQ
12266+
GenL5.menu.pnum.GENERIC_L562QEIXQ=Generic L562QC-EIxQ
12267+
GenL5.menu.pnum.GENERIC_L562QEIXQ.upload.maximum_size=524288
12268+
GenL5.menu.pnum.GENERIC_L562QEIXQ.upload.maximum_data_size=196608
12269+
GenL5.menu.pnum.GENERIC_L562QEIXQ.build.board=GENERIC_L562QEIXQ
12270+
GenL5.menu.pnum.GENERIC_L562QEIXQ.build.product_line=STM32L562xx
12271+
GenL5.menu.pnum.GENERIC_L562QEIXQ.build.variant=STM32L5xx/L552Q(C-E)IxQ_L562QEIxQ
12272+
GenL5.menu.pnum.GENERIC_L562QEIXQ.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32L5xx/STM32L562.svd
12273+
1224712274
# Generic L562ZETxQ
1224812275
GenL5.menu.pnum.GENERIC_L562ZETXQ=Generic L562ZETxQ
1224912276
GenL5.menu.pnum.GENERIC_L562ZETXQ.upload.maximum_size=524288

variants/STM32L5xx/L552Q(C-E)IxQ_L562QEIxQ/generic_clock.c

+57-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,63 @@
2222
WEAK void SystemClock_Config(void)
2323
{
2424
/* SystemClock_Config can be generated by STM32CubeMX */
25-
#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_SCALE0) != HAL_OK) {
32+
Error_Handler();
33+
}
34+
35+
/** Initializes the RCC Oscillators according to the specified parameters
36+
* in the RCC_OscInitTypeDef structure.
37+
*/
38+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48 | RCC_OSCILLATORTYPE_HSI
39+
| RCC_OSCILLATORTYPE_MSI;
40+
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
41+
RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
42+
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
43+
RCC_OscInitStruct.MSIState = RCC_MSI_ON;
44+
RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT;
45+
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_6;
46+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
47+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_MSI;
48+
RCC_OscInitStruct.PLL.PLLM = 1;
49+
RCC_OscInitStruct.PLL.PLLN = 55;
50+
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV7;
51+
RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2;
52+
RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2;
53+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
54+
Error_Handler();
55+
}
56+
57+
/** Initializes the CPU, AHB and APB buses clocks
58+
*/
59+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
60+
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
61+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
62+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
63+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
64+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
65+
66+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) {
67+
Error_Handler();
68+
}
69+
70+
/** Initializes the peripherals clock
71+
*/
72+
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_LPUART1 | RCC_PERIPHCLK_USB;
73+
PeriphClkInit.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_HSI;
74+
PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
75+
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) {
76+
Error_Handler();
77+
}
78+
79+
/** Enable MSI Auto calibration
80+
*/
81+
HAL_RCCEx_EnableMSIPLLMode();
2682
}
2783

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

0 commit comments

Comments
 (0)