Skip to content

Commit fddfdeb

Browse files
askuricfpistm
andauthored
variant(l4): add generic L412RB(I-T)xP and Nucleo L412RB-P
Signed-off-by: Antun Skuric <[email protected]> Co-authored-by: Frederic Pillon <[email protected]>
1 parent 5eb19be commit fddfdeb

File tree

6 files changed

+561
-0
lines changed

6 files changed

+561
-0
lines changed

Diff for: README.md

+2
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
148148
| :green_heart: | STM32L053R8 | [Nucleo L053R8](http://www.st.com/en/evaluation-tools/nucleo-l053r8.html) | *0.1.0* | |
149149
| :green_heart: | STM32L073RZ | [Nucleo L073RZ](http://www.st.com/en/evaluation-tools/nucleo-l073rz.html) | *1.4.0* | |
150150
| :green_heart: | STM32L152RE | [Nucleo L152RE](http://www.st.com/en/evaluation-tools/nucleo-l152re.html) | *1.0.0* | |
151+
| :yellow_heart: | STM32L412RB-P | [Nucleo L412RC-P](https://www.st.com/en/evaluation-tools/nucleo-l412rb-p.html) | **2.11.0** | |
151152
| :green_heart: | STM32L433RC-P | [Nucleo L433RC-P](https://www.st.com/en/evaluation-tools/nucleo-l433rc-p.html) | *1.9.0* | |
152153
| :green_heart: | STM32L452RE | [Nucleo L452RE](http://www.st.com/en/evaluation-tools/nucleo-l452re.html) | *1.5.0* | |
153154
| :green_heart: | STM32L452RE-P | [Nucleo L452RE-P](http://www.st.com/en/evaluation-tools/nucleo-l452re-p.html) | *1.8.0* | |
@@ -704,6 +705,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
704705
| Status | Device(s) | Name | Release | Notes |
705706
| :----: | :-------: | ---- | :-----: | :---- |
706707
| :green_heart: | STM32L412K8<br>STM32L412KB<br>STM32L422KB | Generic Board | *2.0.0* | |
708+
| :yellow_heart: | STM32L412RBIxP<br>STM32L412RBTxP | Generic Board | **2.11.0** | |
707709
| :green_heart: | STM32L431CB<br>STM32L431CC | Generic Board | *2.8.1* | |
708710
| :green_heart: | STM32L431RB<br>STM32L431RC | Generic Board | *2.3.0* | |
709711
| :green_heart: | STM32L432KB<br>STM32L432KC<br>STM32L442KC | Generic Board | *2.0.0* | |

Diff for: boards.txt

+33
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,21 @@ Nucleo_64.menu.pnum.NUCLEO_L152RE.build.variant=STM32L1xx/L151RET_L152RET_L162RE
758758
Nucleo_64.menu.pnum.NUCLEO_L152RE.openocd.target=stm32l1
759759
Nucleo_64.menu.pnum.NUCLEO_L152RE.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32L1xx/STM32L152.svd
760760

761+
# NUCLEO_L412RB_P board
762+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P=Nucleo L412RB-P
763+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.node=NODE_L412RB
764+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.upload.maximum_size=131072
765+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.upload.maximum_data_size=40960
766+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.build.mcu=cortex-m4
767+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.build.fpu=-mfpu=fpv4-sp-d16
768+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.build.float-abi=-mfloat-abi=hard
769+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.build.board=NUCLEO_L412RB_P
770+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.build.series=STM32L4xx
771+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.build.product_line=STM32L412xx
772+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.build.variant=STM32L4xx/L412RB(I-T)xP
773+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.openocd.target=stm32l4x
774+
Nucleo_64.menu.pnum.NUCLEO_L412RB_P.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32L4xx/STM32L412.svd
775+
761776
# NUCLEO_L433RC_P board
762777
Nucleo_64.menu.pnum.NUCLEO_L433RC_P=Nucleo L433RC-P
763778
Nucleo_64.menu.pnum.NUCLEO_L433RC_P.node=NODE_L433RC
@@ -11471,6 +11486,24 @@ GenL4.menu.pnum.GENERIC_L412KBUX.build.product_line=STM32L412xx
1147111486
GenL4.menu.pnum.GENERIC_L412KBUX.build.variant=STM32L4xx/L412K(8-B)(T-U)_L422KB(T-U)
1147211487
GenL4.menu.pnum.GENERIC_L412KBUX.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32L4xx/STM32L412.svd
1147311488

11489+
# Generic L412RBIxP
11490+
GenL4.menu.pnum.GENERIC_L412RBIXP=Generic L412RBIxP
11491+
GenL4.menu.pnum.GENERIC_L412RBIXP.upload.maximum_size=131072
11492+
GenL4.menu.pnum.GENERIC_L412RBIXP.upload.maximum_data_size=40960
11493+
GenL4.menu.pnum.GENERIC_L412RBIXP.build.board=GENERIC_L412RBIXP
11494+
GenL4.menu.pnum.GENERIC_L412RBIXP.build.product_line=STM32L412xx
11495+
GenL4.menu.pnum.GENERIC_L412RBIXP.build.variant=STM32L4xx/L412RB(I-T)xP
11496+
GenL4.menu.pnum.GENERIC_L412RBIXP.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32L4xx/STM32L412.svd
11497+
11498+
# Generic L412RBTxP
11499+
GenL4.menu.pnum.GENERIC_L412RBTXP=Generic L412RBTxP
11500+
GenL4.menu.pnum.GENERIC_L412RBTXP.upload.maximum_size=131072
11501+
GenL4.menu.pnum.GENERIC_L412RBTXP.upload.maximum_data_size=40960
11502+
GenL4.menu.pnum.GENERIC_L412RBTXP.build.board=GENERIC_L412RBTXP
11503+
GenL4.menu.pnum.GENERIC_L412RBTXP.build.product_line=STM32L412xx
11504+
GenL4.menu.pnum.GENERIC_L412RBTXP.build.variant=STM32L4xx/L412RB(I-T)xP
11505+
GenL4.menu.pnum.GENERIC_L412RBTXP.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32L4xx/STM32L412.svd
11506+
1147411507
# Generic L422KBTx
1147511508
GenL4.menu.pnum.GENERIC_L422KBTX=Generic L422KBTx
1147611509
GenL4.menu.pnum.GENERIC_L422KBTX.upload.maximum_size=131072

Diff for: variants/STM32L4xx/L412RB(I-T)xP/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ add_library(variant_bin STATIC EXCLUDE_FROM_ALL
2222
generic_clock.c
2323
PeripheralPins.c
2424
variant_generic.cpp
25+
variant_NUCLEO_L412RB_P.cpp
2526
)
2627
target_link_libraries(variant_bin PUBLIC variant_usage)
2728

Diff for: variants/STM32L4xx/L412RB(I-T)xP/ldscript.ld

+208
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
/*
2+
******************************************************************************
3+
**
4+
5+
** File : LinkerScript.ld
6+
**
7+
** Author : STM32CubeMX
8+
**
9+
** Abstract : Linker script for STM32L412RBTxP series
10+
** 128Kbytes FLASH and 40Kbytes 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+
** Distribution: The file is distributed “as is,” without any warranty
19+
** of any kind.
20+
**
21+
*****************************************************************************
22+
** @attention
23+
**
24+
** <h2><center>&copy; COPYRIGHT(c) 2025 STMicroelectronics</center></h2>
25+
**
26+
** Redistribution and use in source and binary forms, with or without modification,
27+
** are permitted provided that the following conditions are met:
28+
** 1. Redistributions of source code must retain the above copyright notice,
29+
** this list of conditions and the following disclaimer.
30+
** 2. Redistributions in binary form must reproduce the above copyright notice,
31+
** this list of conditions and the following disclaimer in the documentation
32+
** and/or other materials provided with the distribution.
33+
** 3. Neither the name of STMicroelectronics nor the names of its contributors
34+
** may be used to endorse or promote products derived from this software
35+
** without specific prior written permission.
36+
**
37+
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
38+
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
39+
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
40+
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
41+
** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
42+
** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
43+
** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
44+
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45+
** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
46+
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47+
**
48+
*****************************************************************************
49+
*/
50+
51+
/* Entry Point */
52+
ENTRY(Reset_Handler)
53+
54+
/* Highest address of the user mode stack */
55+
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of RAM */
56+
/* Generate a link error if heap and stack don't fit into RAM */
57+
_Min_Heap_Size = 0x200; /* required amount of heap */
58+
_Min_Stack_Size = 0x400; /* required amount of stack */
59+
60+
/* Specify the memory areas */
61+
MEMORY
62+
{
63+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
64+
RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 8K
65+
FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
66+
}
67+
68+
/* Define output sections */
69+
SECTIONS
70+
{
71+
/* The startup code goes first into FLASH */
72+
.isr_vector :
73+
{
74+
. = ALIGN(8);
75+
KEEP(*(.isr_vector)) /* Startup code */
76+
. = ALIGN(8);
77+
} >FLASH
78+
79+
/* The program code and other data goes into FLASH */
80+
.text :
81+
{
82+
. = ALIGN(8);
83+
*(.text) /* .text sections (code) */
84+
*(.text*) /* .text* sections (code) */
85+
*(.glue_7) /* glue arm to thumb code */
86+
*(.glue_7t) /* glue thumb to arm code */
87+
*(.eh_frame)
88+
89+
KEEP (*(.init))
90+
KEEP (*(.fini))
91+
92+
. = ALIGN(8);
93+
_etext = .; /* define a global symbols at end of code */
94+
} >FLASH
95+
96+
/* Constant data goes into FLASH */
97+
.rodata :
98+
{
99+
. = ALIGN(8);
100+
*(.rodata) /* .rodata sections (constants, strings, etc.) */
101+
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
102+
. = ALIGN(8);
103+
} >FLASH
104+
105+
.ARM.extab (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
106+
{
107+
. = ALIGN(8);
108+
*(.ARM.extab* .gnu.linkonce.armextab.*)
109+
. = ALIGN(8);
110+
} >FLASH
111+
112+
.ARM (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
113+
{
114+
. = ALIGN(8);
115+
__exidx_start = .;
116+
*(.ARM.exidx*)
117+
__exidx_end = .;
118+
. = ALIGN(8);
119+
} >FLASH
120+
121+
.preinit_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
122+
{
123+
. = ALIGN(8);
124+
PROVIDE_HIDDEN (__preinit_array_start = .);
125+
KEEP (*(.preinit_array*))
126+
PROVIDE_HIDDEN (__preinit_array_end = .);
127+
. = ALIGN(8);
128+
} >FLASH
129+
130+
.init_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
131+
{
132+
. = ALIGN(8);
133+
PROVIDE_HIDDEN (__init_array_start = .);
134+
KEEP (*(SORT(.init_array.*)))
135+
KEEP (*(.init_array*))
136+
PROVIDE_HIDDEN (__init_array_end = .);
137+
. = ALIGN(8);
138+
} >FLASH
139+
140+
.fini_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
141+
142+
{
143+
. = ALIGN(8);
144+
PROVIDE_HIDDEN (__fini_array_start = .);
145+
KEEP (*(SORT(.fini_array.*)))
146+
KEEP (*(.fini_array*))
147+
PROVIDE_HIDDEN (__fini_array_end = .);
148+
. = ALIGN(8);
149+
} >FLASH
150+
151+
/* used by the startup to initialize data */
152+
_sidata = LOADADDR(.data);
153+
154+
/* Initialized data sections goes into RAM, load LMA copy after code */
155+
.data :
156+
{
157+
. = ALIGN(8);
158+
_sdata = .; /* create a global symbol at data start */
159+
*(.data) /* .data sections */
160+
*(.data*) /* .data* sections */
161+
*(.RamFunc) /* .RamFunc sections */
162+
*(.RamFunc*) /* .RamFunc* sections */
163+
164+
. = ALIGN(8);
165+
_edata = .; /* define a global symbol at data end */
166+
} >RAM AT> FLASH
167+
168+
169+
/* Uninitialized data section */
170+
. = ALIGN(4);
171+
.bss :
172+
{
173+
/* This is used by the startup in order to initialize the .bss section */
174+
_sbss = .; /* define a global symbol at bss start */
175+
__bss_start__ = _sbss;
176+
*(.bss)
177+
*(.bss*)
178+
*(COMMON)
179+
180+
. = ALIGN(4);
181+
_ebss = .; /* define a global symbol at bss end */
182+
__bss_end__ = _ebss;
183+
} >RAM
184+
185+
/* User_heap_stack section, used to check that there is enough RAM left */
186+
._user_heap_stack :
187+
{
188+
. = ALIGN(8);
189+
PROVIDE ( end = . );
190+
PROVIDE ( _end = . );
191+
. = . + _Min_Heap_Size;
192+
. = . + _Min_Stack_Size;
193+
. = ALIGN(8);
194+
} >RAM
195+
196+
197+
198+
/* Remove information from the standard libraries */
199+
/DISCARD/ :
200+
{
201+
libc.a ( * )
202+
libm.a ( * )
203+
libgcc.a ( * )
204+
}
205+
206+
}
207+
208+

0 commit comments

Comments
 (0)