Skip to content

Commit 3c9c7f0

Browse files
committed
[Nucleo L452RE] Add support
Fix stm32duino#425 Signed-off-by: Frederic Pillon <[email protected]>
1 parent 830bb00 commit 3c9c7f0

File tree

7 files changed

+1354
-0
lines changed

7 files changed

+1354
-0
lines changed

boards.txt

+13
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ Nucleo_64.menu.pnum.NUCLEO_L073RZ.build.product_line=STM32L073xx
269269
Nucleo_64.menu.pnum.NUCLEO_L073RZ.build.variant=NUCLEO_L073RZ
270270
Nucleo_64.menu.pnum.NUCLEO_L073RZ.build.cmsis_lib_gcc=arm_cortexM0l_math
271271
Nucleo_64.menu.pnum.NUCLEO_L073RZ.build.extra_flags=-D{build.product_line} {build.enable_usb} {build.xSerial} -D__CORTEX_SC=0
272+
272273
# NUCLEO_L152RE board
273274
# Support: Serial1 (USART1 on PA10, PA9) and Serial2 (UART4 on PC11, PC10)
274275
Nucleo_64.menu.pnum.NUCLEO_L152RE=Nucleo L152RE
@@ -282,6 +283,18 @@ Nucleo_64.menu.pnum.NUCLEO_L152RE.build.product_line=STM32L152xE
282283
Nucleo_64.menu.pnum.NUCLEO_L152RE.build.variant=NUCLEO_L152RE
283284
Nucleo_64.menu.pnum.NUCLEO_L152RE.build.cmsis_lib_gcc=arm_cortexM3l_math
284285

286+
# NUCLEO_L452RE board
287+
Nucleo_64.menu.pnum.NUCLEO_L452RE=Nucleo L452RE
288+
Nucleo_64.menu.pnum.NUCLEO_L452RE.node=NODE_L452RE
289+
Nucleo_64.menu.pnum.NUCLEO_L452RE.upload.maximum_size=524288
290+
Nucleo_64.menu.pnum.NUCLEO_L452RE.upload.maximum_data_size=163840
291+
Nucleo_64.menu.pnum.NUCLEO_L452RE.build.mcu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
292+
Nucleo_64.menu.pnum.NUCLEO_L452RE.build.board=NUCLEO_L452RE
293+
Nucleo_64.menu.pnum.NUCLEO_L452RE.build.series=STM32L4xx
294+
Nucleo_64.menu.pnum.NUCLEO_L452RE.build.product_line=STM32L452xx
295+
Nucleo_64.menu.pnum.NUCLEO_L452RE.build.variant=NUCLEO_L452RE
296+
Nucleo_64.menu.pnum.NUCLEO_L452RE.build.cmsis_lib_gcc=arm_cortexM4l_math
297+
285298
# NUCLEO_L476RG board
286299
# Support: Serial1 (USART1 on PA10, PA9)
287300
Nucleo_64.menu.pnum.NUCLEO_L476RG=Nucleo L476RG

variants/NUCLEO_L452RE/PeripheralPins.c

+325
Large diffs are not rendered by default.

variants/NUCLEO_L452RE/PinNamesVar.h

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* SYS_WKUP */
2+
#ifdef PWR_WAKEUP_PIN1
3+
SYS_WKUP1 = PA_0,
4+
#endif
5+
#ifdef PWR_WAKEUP_PIN2
6+
SYS_WKUP2 = PC_13,
7+
#endif
8+
#ifdef PWR_WAKEUP_PIN3
9+
SYS_WKUP3 = PE_6, /* manually updated */
10+
#endif
11+
#ifdef PWR_WAKEUP_PIN4
12+
SYS_WKUP4 = PA_2,
13+
#endif
14+
#ifdef PWR_WAKEUP_PIN5
15+
SYS_WKUP5 = PC_5, /* manually updated */
16+
#endif
17+
#ifdef PWR_WAKEUP_PIN6
18+
SYS_WKUP6 = NC,
19+
#endif
20+
#ifdef PWR_WAKEUP_PIN7
21+
SYS_WKUP7 = NC,
22+
#endif
23+
#ifdef PWR_WAKEUP_PIN8
24+
SYS_WKUP8 = NC,
25+
#endif
26+
/* USB */
27+
#ifdef USBCON
28+
USB_DM = PA_11,
29+
USB_DP = PA_12,
30+
USB_NOE = PA_13,
31+
/* USB_NOE = PC_9, */
32+
#endif

variants/NUCLEO_L452RE/ldscript.ld

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

0 commit comments

Comments
 (0)