Skip to content

Commit 54f0642

Browse files
authored
Add Blackpill-F411CE (ARMmbed#123)
* add target Blackpill-F411CE * correction of Blackpill-F411CE * add Blackpill to targets.json * correction of STM32F411xE system_clock.c * Update BLACKPILL_F411CE.cmake Typo * Update PinNames.h LED correction * Update PinNames.h * Update BLACKPILL_F411CE.cmake Correcting the wrong name in the Note2 about pyOCD. * Update BLACKPILL_F411CE.cmake Updated notes - an external debugger is required
1 parent b91fc21 commit 54f0642

File tree

9 files changed

+793
-1
lines changed

9 files changed

+793
-1
lines changed

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
add_subdirectory(TARGET_MTS_DRAGONFLY_F411RE EXCLUDE_FROM_ALL)
55
add_subdirectory(TARGET_MTS_MDOT_F411RE EXCLUDE_FROM_ALL)
66
add_subdirectory(TARGET_NUCLEO_F411RE EXCLUDE_FROM_ALL)
7+
add_subdirectory(TARGET_BLACKPILL_F411CE EXCLUDE_FROM_ALL)
78

89
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
910
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32f411xe.S)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
add_library(mbed-blackpill-f411ce INTERFACE)
5+
6+
target_sources(mbed-blackpill-f411ce
7+
INTERFACE
8+
system_clock_override.c
9+
PeripheralPins.c
10+
)
11+
12+
target_include_directories(mbed-blackpill-f411ce
13+
INTERFACE
14+
.
15+
)
16+
17+
target_link_libraries(mbed-blackpill-f411ce INTERFACE mbed-stm32f411xe)

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/TARGET_BLACKPILL_F411CE/PeripheralPinMaps.h

Lines changed: 263 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* mbed Microcontroller Library
2+
*******************************************************************************
3+
* Copyright (c) 2018, 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+
#include "PeripheralPins.h"
32+
#include "mbed_toolchain.h"
33+
#include "PeripheralPinMaps.h"
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
/* mbed Microcontroller Library
2+
*******************************************************************************
3+
* Copyright (c) 2018, 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+
/* If this macro is defined, then constexpr utility functions for pin-map seach can be used. */
42+
#define STATIC_PINMAP_READY 1
43+
44+
typedef enum {
45+
ALT0 = 0x100,
46+
ALT1 = 0x200,
47+
ALT2 = 0x300,
48+
ALT3 = 0x400
49+
} ALTx;
50+
51+
typedef enum {
52+
// Not connected
53+
NC = (int)0xFFFFFFFF,
54+
55+
PA_0 = 0x00,
56+
PA_1 = 0x01,
57+
PA_1_ALT0 = PA_1 | ALT0,
58+
PA_2 = 0x02,
59+
PA_3 = 0x03,
60+
PA_4 = 0x04,
61+
PA_4_ALT0 = PA_4 | ALT0,
62+
PA_5 = 0x05,
63+
PA_6 = 0x06,
64+
PA_7 = 0x07,
65+
PA_7_ALT0 = PA_7 | ALT0,
66+
PA_7_ALT1 = PA_7 | ALT1,
67+
PA_7_ALT2 = PA_7 | ALT2,
68+
PA_8 = 0x08,
69+
PA_9 = 0x09,
70+
PA_10 = 0x0A,
71+
PA_11 = 0x0B,
72+
PA_12 = 0x0C,
73+
PA_13 = 0x0D,
74+
PA_14 = 0x0E,
75+
PA_15 = 0x0F,
76+
PA_15_ALT0 = PA_15 | ALT0,
77+
78+
PB_0 = 0x10,
79+
PB_0_ALT0 = PB_0 | ALT0,
80+
PB_0_ALT1 = PB_0 | ALT1,
81+
PB_1 = 0x11,
82+
PB_1_ALT0 = PB_1 | ALT0,
83+
PB_1_ALT1 = PB_1 | ALT1,
84+
PB_2 = 0x12,
85+
PB_3 = 0x13,
86+
PB_3_ALT0 = PB_3 | ALT0,
87+
PB_4 = 0x14,
88+
PB_4_ALT0 = PB_4 | ALT0,
89+
PB_4_ALT1 = PB_4 | ALT1,
90+
PB_5 = 0x15,
91+
PB_5_ALT0 = PB_5 | ALT0,
92+
PB_5_ALT1 = PB_5 | ALT1,
93+
PB_6 = 0x16,
94+
PB_7 = 0x17,
95+
PB_8 = 0x18,
96+
PB_8_ALT0 = PB_8 | ALT0,
97+
PB_8_ALT1 = PB_8 | ALT1,
98+
PB_9 = 0x19,
99+
PB_9_ALT0 = PB_9 | ALT0,
100+
PB_9_ALT1 = PB_9 | ALT1,
101+
PB_10 = 0x1A,
102+
PB_12 = 0x1C,
103+
PB_12_ALT0 = PB_12 | ALT0,
104+
PB_13 = 0x1D,
105+
PB_13_ALT0 = PB_13 | ALT0,
106+
PB_14 = 0x1E,
107+
PB_15 = 0x1F,
108+
109+
PC_0 = 0x20,
110+
PC_1 = 0x21,
111+
PC_2 = 0x22,
112+
PC_3 = 0x23,
113+
PC_4 = 0x24,
114+
PC_5 = 0x25,
115+
PC_6 = 0x26,
116+
PC_7 = 0x27,
117+
PC_8 = 0x28,
118+
PC_9 = 0x29,
119+
PC_10 = 0x2A,
120+
PC_11 = 0x2B,
121+
PC_12 = 0x2C,
122+
PC_13 = 0x2D,
123+
PC_14 = 0x2E,
124+
PC_15 = 0x2F,
125+
126+
PD_2 = 0x32,
127+
128+
PH_0 = 0x70,
129+
PH_1 = 0x71,
130+
131+
// ADC internal channels
132+
ADC_TEMP = 0xF0,
133+
ADC_VREF = 0xF1,
134+
ADC_VBAT = 0xF2,
135+
136+
// Arduino connector namings
137+
A0 = PA_0,
138+
A1 = PA_1,
139+
A2 = PA_4,
140+
A3 = PB_0,
141+
A4 = NC,
142+
A5 = NC,
143+
D0 = PA_3,
144+
D1 = PA_2,
145+
D2 = PA_10,
146+
D3 = PB_3,
147+
D4 = PB_5,
148+
D5 = PB_4,
149+
D6 = PB_10,
150+
D7 = PA_8,
151+
D8 = PA_9,
152+
D9 = NC,
153+
D10 = PB_6,
154+
D11 = PA_7,
155+
D12 = PA_6,
156+
D13 = PA_5,
157+
D14 = PB_9,
158+
D15 = PB_8,
159+
160+
// STDIO for console print
161+
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
162+
CONSOLE_TX = MBED_CONF_TARGET_STDIO_UART_TX,
163+
#else
164+
CONSOLE_TX = PA_2,
165+
#endif
166+
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
167+
CONSOLE_RX = MBED_CONF_TARGET_STDIO_UART_RX,
168+
#else
169+
CONSOLE_RX = PA_3,
170+
#endif
171+
172+
// Generic signals namings
173+
#define LED1 = PC_13,
174+
// Standardized button names
175+
#define BUTTON1 = USER_BUTTON,
176+
177+
/**** USB FS pins ****/
178+
USB_OTG_FS_DM = PA_11,
179+
USB_OTG_FS_DP = PA_12,
180+
USB_OTG_FS_ID = PA_10,
181+
USB_OTG_FS_SOF = PA_8,
182+
USB_OTG_FS_VBUS = PA_9,
183+
184+
/**** OSCILLATOR pins ****/
185+
RCC_OSC32_IN = PC_14,
186+
RCC_OSC32_OUT = PC_15,
187+
RCC_OSC_IN = PH_0,
188+
RCC_OSC_OUT = PH_1,
189+
190+
/**** DEBUG pins ****/
191+
DEBUG_JTCK_SWCLK = PA_14,
192+
DEBUG_JTDI = PA_15,
193+
DEBUG_JTDO_SWO = PB_3,
194+
DEBUG_JTMS_SWDIO = PA_13,
195+
DEBUG_JTRST = PB_4,
196+
SYS_WKUP = PA_0,
197+
198+
} PinName;
199+
200+
#ifdef __cplusplus
201+
}
202+
#endif
203+
204+
#endif

0 commit comments

Comments
 (0)