Skip to content

Commit f7c4693

Browse files
committed
Add new target: NUCLEO_L452RE-P
1 parent 706625a commit f7c4693

File tree

17 files changed

+19036
-1
lines changed

17 files changed

+19036
-1
lines changed

platform/mbed_lib.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,10 @@
241241
},
242242
"S5JS100": {
243243
"stdio-baud-rate": 115200
244+
},
245+
"NUCLEO_L452RE-P": {
246+
"crash-capture-enabled": true,
247+
"fatal-error-auto-reboot-enabled": true
244248
}
245249
}
246250
}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/* mbed Microcontroller Library
2+
*******************************************************************************
3+
* Copyright (c) 2015, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
9+
* 1. Redistributions of source code must retain the above copyright notice,
10+
* this list of conditions and the following disclaimer.
11+
* 2. Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following disclaimer in the documentation
13+
* and/or other materials provided with the distribution.
14+
* 3. Neither the name of STMicroelectronics nor the names of its contributors
15+
* may be used to endorse or promote products derived from this software
16+
* without specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
*******************************************************************************
29+
*/
30+
#ifndef MBED_PERIPHERALNAMES_H
31+
#define MBED_PERIPHERALNAMES_H
32+
33+
#include "cmsis.h"
34+
35+
#ifdef __cplusplus
36+
extern "C" {
37+
#endif
38+
39+
typedef enum {
40+
ADC_1 = (int)ADC1_BASE,
41+
} ADCName;
42+
43+
typedef enum {
44+
DAC_1 = (int)DAC_BASE
45+
} DACName;
46+
47+
typedef enum {
48+
UART_1 = (int)USART1_BASE,
49+
UART_2 = (int)USART2_BASE,
50+
UART_3 = (int)USART3_BASE,
51+
UART_4 = (int)UART4_BASE,
52+
LPUART_1 = (int)LPUART1_BASE
53+
} UARTName;
54+
55+
#define DEVICE_SPI_COUNT 3
56+
typedef enum {
57+
SPI_1 = (int)SPI1_BASE,
58+
SPI_2 = (int)SPI2_BASE,
59+
SPI_3 = (int)SPI3_BASE
60+
} SPIName;
61+
62+
typedef enum {
63+
I2C_1 = (int)I2C1_BASE,
64+
I2C_2 = (int)I2C2_BASE,
65+
I2C_3 = (int)I2C3_BASE,
66+
I2C_4 = (int)I2C4_BASE
67+
} I2CName;
68+
69+
typedef enum {
70+
PWM_1 = (int)TIM1_BASE,
71+
PWM_2 = (int)TIM2_BASE, // TIM2 used by usticker
72+
PWM_3 = (int)TIM3_BASE,
73+
PWM_6 = (int)TIM6_BASE,
74+
// PWM_7 = (int)TIM7_BASE,
75+
PWM_15 = (int)TIM15_BASE,
76+
PWM_16 = (int)TIM16_BASE,
77+
} PWMName;
78+
79+
typedef enum {
80+
CAN_1 = (int)CAN1_BASE
81+
} CANName;
82+
83+
typedef enum {
84+
QSPI_1 = (int)QSPI_R_BASE,
85+
} QSPIName;
86+
87+
typedef enum {
88+
USB_FS = (int)USB_BASE,
89+
} USBName;
90+
91+
#ifdef __cplusplus
92+
}
93+
#endif
94+
95+
#endif

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L452xE/TARGET_NUCLEO_L452RE_P/PeripheralPins.c

Lines changed: 331 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
/* mbed Microcontroller Library
2+
*******************************************************************************
3+
* Copyright (c) 2020, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
9+
* 1. Redistributions of source code must retain the above copyright notice,
10+
* this list of conditions and the following disclaimer.
11+
* 2. Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following disclaimer in the documentation
13+
* and/or other materials provided with the distribution.
14+
* 3. Neither the name of STMicroelectronics nor the names of its contributors
15+
* may be used to endorse or promote products derived from this software
16+
* without specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
*******************************************************************************
29+
*/
30+
31+
#ifndef MBED_PINNAMES_H
32+
#define MBED_PINNAMES_H
33+
34+
#include "cmsis.h"
35+
#include "PinNamesTypes.h"
36+
37+
#ifdef __cplusplus
38+
extern "C" {
39+
#endif
40+
41+
typedef enum {
42+
ALT0 = 0x100,
43+
ALT1 = 0x200,
44+
ALT2 = 0x300,
45+
ALT3 = 0x400
46+
} ALTx;
47+
48+
typedef enum {
49+
PA_0 = 0x00,
50+
PA_1 = 0x01,
51+
PA_1_ALT0 = PA_1 | ALT0,
52+
PA_2 = 0x02,
53+
PA_2_ALT0 = PA_2 | ALT0,
54+
PA_3 = 0x03,
55+
PA_3_ALT0 = PA_3 | ALT0,
56+
PA_4 = 0x04,
57+
PA_4_ALT0 = PA_4 | ALT0,
58+
PA_5 = 0x05,
59+
PA_6 = 0x06,
60+
PA_6_ALT0 = PA_6 | ALT0,
61+
PA_7 = 0x07,
62+
PA_7_ALT0 = PA_7 | ALT0,
63+
PA_8 = 0x08,
64+
PA_9 = 0x09,
65+
PA_10 = 0x0A,
66+
PA_11 = 0x0B,
67+
PA_12 = 0x0C,
68+
PA_13 = 0x0D,
69+
PA_13_ALT0 = PA_13 | ALT0,
70+
PA_14 = 0x0E,
71+
PA_14_ALT0 = PA_14 | ALT0,
72+
PA_15 = 0x0F,
73+
PA_15_ALT0 = PA_15 | ALT0,
74+
75+
PB_0 = 0x10,
76+
PB_0_ALT0 = PB_0 | ALT0,
77+
PB_1 = 0x11,
78+
PB_1_ALT0 = PB_1 | ALT0,
79+
PB_2 = 0x12,
80+
PB_3 = 0x13,
81+
PB_3_ALT0 = PB_3 | ALT0,
82+
PB_4 = 0x14,
83+
PB_4_ALT0 = PB_4 | ALT0,
84+
PB_5 = 0x15,
85+
PB_5_ALT0 = PB_5 | ALT0,
86+
PB_6 = 0x16,
87+
PB_6_ALT0 = PB_6 | ALT0,
88+
PB_7 = 0x17,
89+
PB_7_ALT0 = PB_7 | ALT0,
90+
PB_8 = 0x18,
91+
PB_9 = 0x19,
92+
PB_10 = 0x1A,
93+
PB_10_ALT0 = PB_10 | ALT0,
94+
PB_11 = 0x1B,
95+
PB_11_ALT0 = PB_11 | ALT0,
96+
PB_12 = 0x1C,
97+
PB_13 = 0x1D,
98+
PB_13_ALT0 = PB_13 | ALT0,
99+
PB_14 = 0x1E,
100+
PB_14_ALT0 = PB_14 | ALT0,
101+
PB_15 = 0x1F,
102+
PB_15_ALT0 = PB_15 | ALT0,
103+
104+
PC_0 = 0x20,
105+
PC_0_ALT0 = PC_0 | ALT0,
106+
PC_1 = 0x21,
107+
PC_1_ALT0 = PC_1 | ALT0,
108+
PC_2 = 0x22,
109+
PC_3 = 0x23,
110+
PC_4 = 0x24,
111+
// PC_5 = 0x25, // There is no PC_5 on an LQFP64 SMPS package (for the -P Nucleo)
112+
PC_6 = 0x26,
113+
PC_7 = 0x27,
114+
PC_8 = 0x28,
115+
PC_9 = 0x29,
116+
PC_10 = 0x2A,
117+
PC_10_ALT0 = PC_10 | ALT0,
118+
PC_11 = 0x2B,
119+
PC_11_ALT0 = PC_11 | ALT0,
120+
PC_12 = 0x2C,
121+
PC_13 = 0x2D,
122+
PC_14 = 0x2E,
123+
PC_15 = 0x2F,
124+
125+
PH_0 = 0x70,
126+
PH_1 = 0x71,
127+
128+
PH_3 = 0x73,
129+
130+
// ADC internal channels
131+
ADC_TEMP = 0xF0,
132+
ADC_VREF = 0xF1,
133+
ADC_VBAT = 0xF2,
134+
135+
// Arduino connector namings
136+
A0 = PA_0,
137+
A1 = PA_1,
138+
A2 = PC_3,
139+
A3 = PC_2,
140+
A4 = PC_1,
141+
A5 = PC_0,
142+
D0 = PA_3,
143+
D1 = PA_2,
144+
D2 = PA_10,
145+
D3 = PB_3,
146+
D4 = PB_5,
147+
D5 = PA_15,
148+
D6 = PB_10,
149+
D7 = PC_7,
150+
D8 = PB_6,
151+
D9 = PA_8,
152+
D10 = PA_11,
153+
D11 = PB_15,
154+
D12 = PB_14,
155+
D13 = PB_13,
156+
D14 = PB_7,
157+
D15 = PB_8,
158+
159+
// STDIO for console print
160+
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
161+
STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX,
162+
#else
163+
STDIO_UART_TX = PA_2,
164+
#endif
165+
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
166+
STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
167+
#else
168+
STDIO_UART_RX = PA_3,
169+
#endif
170+
171+
// Generic signals namings
172+
LED1 = PB_13,
173+
LED2 = PB_13,
174+
LED3 = PB_13,
175+
LED4 = PB_13,
176+
USER_BUTTON = PC_13,
177+
BUTTON1 = USER_BUTTON,
178+
SERIAL_TX = STDIO_UART_TX,
179+
SERIAL_RX = STDIO_UART_RX,
180+
USBTX = STDIO_UART_TX,
181+
USBRX = STDIO_UART_RX,
182+
I2C_SCL = PB_8,
183+
I2C_SDA = PB_7,
184+
SPI_MOSI = D11,
185+
SPI_MISO = D12,
186+
SPI_SCK = D13,
187+
SPI_CS = D10,
188+
PWM_OUT = D9,
189+
190+
/**** USB pins ****/
191+
USB_DM = PA_11,
192+
USB_DP = PA_12,
193+
USB_NOE = PA_13,
194+
USB_NOE_ALT0 = PC_9,
195+
196+
/**** OSCILLATOR pins ****/
197+
RCC_OSC32_IN = PC_14,
198+
RCC_OSC32_OUT = PC_15,
199+
RCC_OSC_IN = PH_0,
200+
RCC_OSC_OUT = PH_1,
201+
202+
/**** DEBUG pins ****/
203+
SYS_JTCK_SWCLK = PA_14,
204+
SYS_JTDI = PA_15,
205+
SYS_JTDO_SWO = PB_3,
206+
SYS_JTMS_SWDIO = PA_13,
207+
SYS_JTRST = PB_4,
208+
SYS_PVD_IN = PB_7,
209+
SYS_TRACED0 = PC_1,
210+
SYS_TRACED1 = PC_10,
211+
SYS_TRACED3 = PC_12,
212+
SYS_WKUP1 = PA_0,
213+
SYS_WKUP2 = PC_13,
214+
SYS_WKUP4 = PA_2,
215+
216+
// Not connected
217+
NC = (int)0xFFFFFFFF
218+
} PinName;
219+
220+
#ifdef __cplusplus
221+
}
222+
#endif
223+
224+
#endif

0 commit comments

Comments
 (0)