Skip to content

Commit df79609

Browse files
authored
Merge pull request #11675 from jeromecoutant/PR_USB_STEP1
STM32 USB update step 1
2 parents 4b21157 + dab09f3 commit df79609

File tree

151 files changed

+1595
-355
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+1595
-355
lines changed

targets/TARGET_STM/PeripheralPins.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#include "pinmap.h"
3535
#include "PeripheralNames.h"
3636

37+
#define GPIO_AF_NONE 0
38+
3739
//*** ADC ***
3840
#if DEVICE_ANALOGIN
3941
extern const PinMap PinMap_ADC[];
@@ -89,4 +91,16 @@ extern const PinMap PinMap_QSPI_SCLK[];
8991
extern const PinMap PinMap_QSPI_SSEL[];
9092
#endif
9193

94+
#if DEVICE_USBDEVICE
95+
96+
#define USE_USB_NO_OTG 0
97+
#define USE_USB_OTG_FS 1
98+
#define USE_USB_OTG_HS 2
99+
#define USE_USB_HS_IN_FS 3
100+
101+
extern const PinMap PinMap_USB_HS[];
102+
extern const PinMap PinMap_USB_FS[];
103+
104+
#endif /* DEVICE_USBDEVICE */
105+
92106
#endif

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F042K6/PeripheralNames.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ typedef enum {
6969
CAN_1 = (int)CAN_BASE
7070
} CANName;
7171

72+
typedef enum {
73+
USB_FS = (int)USB_BASE,
74+
} USBName;
75+
7276
#ifdef __cplusplus
7377
}
7478
#endif

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F042K6/PeripheralPins.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,14 @@ MBED_WEAK const PinMap PinMap_CAN_TD[] = {
195195
{PA_12, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF4_CAN)},
196196
{NC, NC, 0}
197197
};
198+
199+
//*** USBDEVICE ***
200+
201+
MBED_WEAK const PinMap PinMap_USB_FS[] = {
202+
// {PA_4, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_USB)}, // USB_NOE
203+
{PA_11, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DM
204+
{PA_12, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DP
205+
// {PA_13, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_USB)}, // USB_NOE // Connected to SWDIO
206+
// {PA_15, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_USB)}, // USB_NOE // Connected to STDIO_UART_RX
207+
{NC, NC, 0}
208+
};

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F070RB/PeripheralNames.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ typedef enum {
6767
PWM_17 = (int)TIM17_BASE
6868
} PWMName;
6969

70+
typedef enum {
71+
USB_FS = (int)USB_BASE,
72+
} USBName;
73+
7074
#ifdef __cplusplus
7175
}
7276
#endif

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F070RB/PeripheralPins.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,12 @@ MBED_WEAK const PinMap PinMap_SPI_SSEL[] = {
218218
{PB_12, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI2)},
219219
{NC, NC, 0}
220220
};
221+
222+
//*** USBDEVICE ***
223+
224+
MBED_WEAK const PinMap PinMap_USB_FS[] = {
225+
{PA_11, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DM
226+
{PA_12, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DP
227+
// {PA_13, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_USB)}, // USB_NOE // Connected to TMS
228+
{NC, NC, 0}
229+
};

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F072RB/PeripheralNames.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ typedef enum {
7676
CAN_1 = (int)CAN_BASE
7777
} CANName;
7878

79+
typedef enum {
80+
USB_FS = (int)USB_BASE,
81+
} USBName;
82+
7983
#ifdef __cplusplus
8084
}
8185
#endif

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F072RB/PeripheralPins.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,12 @@ MBED_WEAK const PinMap PinMap_CAN_TD[] = {
250250
{PB_9, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF4_CAN)},
251251
{NC, NC, 0}
252252
};
253+
254+
//*** USBDEVICE ***
255+
256+
MBED_WEAK const PinMap PinMap_USB_FS[] = {
257+
{PA_11, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DM
258+
{PA_12, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DP
259+
// {PA_13, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_USB)}, // USB_NOE // Connected to TMS
260+
{NC, NC, 0}
261+
};

targets/TARGET_STM/TARGET_STM32F1/TARGET_NUCLEO_F103RB/PeripheralNames.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ typedef enum {
6868
CAN_1 = (int)CAN1_BASE
6969
} CANName;
7070

71+
typedef enum {
72+
USB_FS = (int)USB_BASE,
73+
} USBName;
74+
7175
#ifdef __cplusplus
7276
}
7377
#endif

targets/TARGET_STM/TARGET_STM32F1/TARGET_NUCLEO_F103RB/PeripheralPins.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,11 @@ MBED_WEAK const PinMap PinMap_CAN_TD[] = {
207207
{PB_9, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, 10)}, // Remap CAN_TX to PB_9
208208
{NC, NC, 0}
209209
};
210+
211+
//*** USBDEVICE ***
212+
213+
MBED_WEAK const PinMap PinMap_USB_FS[] = {
214+
{PA_11, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0)}, // USB_DM
215+
{PA_12, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0)}, // USB_DP
216+
{NC, NC, 0}
217+
};

targets/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/PeripheralNames.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ typedef enum {
8888
CAN_2 = (int)CAN2_BASE
8989
} CANName;
9090

91+
typedef enum {
92+
USB_FS = (int)USB_OTG_FS_PERIPH_BASE,
93+
USB_HS = (int)USB_OTG_HS_PERIPH_BASE
94+
} USBName;
95+
9196
#ifdef __cplusplus
9297
}
9398
#endif

targets/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/PeripheralPins.c

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,3 +335,40 @@ MBED_WEAK const PinMap PinMap_CAN_TD[] = {
335335
{PD_1, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)},
336336
{NC, NC, 0}
337337
};
338+
339+
//*** USBDEVICE ***
340+
341+
MBED_WEAK const PinMap PinMap_USB_FS[] = {
342+
// {PA_8, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF // Connected to USB_SOF [TP1]
343+
{PA_9, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_FS_VBUS // Connected to USB_VBUS
344+
{PA_10, USB_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_ID // Connected to USB_ID
345+
{PA_11, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DM // Connected to USB_DM
346+
{PA_12, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP // Connected to USB_DP
347+
{NC, NC, 0}
348+
};
349+
350+
//*** USBDEVICE ***
351+
352+
MBED_WEAK const PinMap PinMap_USB_HS[] = {
353+
#if (MBED_CONF_TARGET_USB_SPEED == USE_USB_HS_IN_FS)
354+
// {PA_4, USB_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_SOF
355+
{PB_12, USB_HS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_ID
356+
{PB_13, USB_HS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_VBUS // Connected to RMII_TXD1 [LAN8742A-CZ-TR_TXD1]
357+
{PB_14, USB_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_DM // Connected to LD3 [Red]
358+
{PB_15, USB_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_DP
359+
#else /* MBED_CONF_TARGET_USB_SPEED */
360+
{PA_3, USB_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D0
361+
{PA_5, USB_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_CK
362+
{PB_0, USB_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D1
363+
{PB_1, USB_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D2
364+
{PB_5, USB_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D7
365+
{PB_10, USB_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D3
366+
{PB_11, USB_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D4
367+
{PB_12, USB_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D5
368+
{PB_13, USB_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D6 // Connected to RMII_TXD1 [LAN8742A-CZ-TR_TXD1]
369+
{PC_0, USB_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_STP
370+
{PC_2, USB_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_DIR
371+
{PC_3, USB_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_NXT
372+
#endif /* MBED_CONF_TARGET_USB_SPEED */
373+
{NC, NC, 0}
374+
};

targets/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/PinNames.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,14 @@ typedef enum {
272272
SPI_CS = D10,
273273
PWM_OUT = D9,
274274

275-
/**** USB pins ****/
275+
/**** USB FS pins ****/
276276
USB_OTG_FS_DM = PA_11,
277277
USB_OTG_FS_DP = PA_12,
278278
USB_OTG_FS_ID = PA_10,
279279
USB_OTG_FS_SOF = PA_8,
280280
USB_OTG_FS_VBUS = PA_9,
281+
282+
/**** USB HS pins ****/
281283
USB_OTG_HS_DM = PB_14,
282284
USB_OTG_HS_DP = PB_15,
283285
USB_OTG_HS_ID = PB_12,

targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F302x8/TARGET_NUCLEO_F302R8/PeripheralNames.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ typedef enum {
7474
CAN_1 = (int)CAN_BASE
7575
} CANName;
7676

77+
typedef enum {
78+
USB_FS = (int)USB_BASE,
79+
} USBName;
80+
7781
#ifdef __cplusplus
7882
}
7983
#endif

targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F302x8/TARGET_NUCLEO_F302R8/PeripheralPins.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,11 @@ MBED_WEAK const PinMap PinMap_CAN_TD[] = {
250250
{PB_9, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN)},
251251
{NC, NC, 0}
252252
};
253+
254+
//*** USBDEVICE ***
255+
256+
MBED_WEAK const PinMap PinMap_USB_FS[] = {
257+
{PA_11, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DM
258+
{PA_12, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DP
259+
{NC, NC, 0}
260+
};

targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC/TARGET_DISCO_F303VC/PeripheralNames.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ typedef enum {
8282
CAN_1 = (int)CAN_BASE
8383
} CANName;
8484

85+
typedef enum {
86+
USB_FS = (int)USB_BASE,
87+
} USBName;
88+
8589
#ifdef __cplusplus
8690
}
8791
#endif

targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC/TARGET_DISCO_F303VC/PeripheralPins.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,3 +372,11 @@ MBED_WEAK const PinMap PinMap_CAN_TD[] = {
372372
{PD_1, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF7_CAN)},
373373
{NC, NC, 0}
374374
};
375+
376+
//*** USBDEVICE ***
377+
378+
MBED_WEAK const PinMap PinMap_USB_FS[] = {
379+
{PA_11, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF14_USB)}, // USB_DM // Connected to DM
380+
{PA_12, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF14_USB)}, // USB_DP // Connected to DP
381+
{NC, NC, 0}
382+
};

targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/TARGET_NUCLEO_F303RE/PeripheralNames.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ typedef enum {
8585
CAN_1 = (int)CAN_BASE
8686
} CANName;
8787

88+
typedef enum {
89+
USB_FS = (int)USB_BASE,
90+
} USBName;
91+
8892
#ifdef __cplusplus
8993
}
9094
#endif

targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/TARGET_NUCLEO_F303RE/PeripheralPins.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,3 +319,11 @@ MBED_WEAK const PinMap PinMap_CAN_TD[] = {
319319
{PB_9, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN)},
320320
{NC, NC, 0}
321321
};
322+
323+
//*** USBDEVICE ***
324+
325+
MBED_WEAK const PinMap PinMap_USB_FS[] = {
326+
{PA_11, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DM
327+
{PA_12, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DP
328+
{NC, NC, 0}
329+
};

targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/TARGET_NUCLEO_F303ZE/PeripheralNames.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ typedef enum {
8585
CAN_1 = (int)CAN_BASE
8686
} CANName;
8787

88+
typedef enum {
89+
USB_FS = (int)USB_BASE,
90+
} USBName;
91+
8892
#ifdef __cplusplus
8993
}
9094
#endif

targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/TARGET_NUCLEO_F303ZE/PeripheralPins.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,3 +415,11 @@ MBED_WEAK const PinMap PinMap_CAN_TD[] = {
415415
{PD_1, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF7_CAN)},
416416
{NC, NC, 0}
417417
};
418+
419+
//*** USBDEVICE ***
420+
421+
MBED_WEAK const PinMap PinMap_USB_FS[] = {
422+
{PA_11, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DM // Connected to USB_DM
423+
{PA_12, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DP // Connected to USB_DP
424+
{NC, NC, 0}
425+
};

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xC/TARGET_DISCO_F401VC/PeripheralNames.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ typedef enum {
7171
PWM_11 = (int)TIM11_BASE
7272
} PWMName;
7373

74+
typedef enum {
75+
USB_FS = (int)USB_OTG_FS_PERIPH_BASE
76+
} USBName;
77+
7478
#ifdef __cplusplus
7579
}
7680
#endif

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xC/TARGET_DISCO_F401VC/PeripheralPins.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,3 +245,14 @@ MBED_WEAK const PinMap PinMap_SPI_SSEL[] = {
245245
{PE_11, SPI_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI4)},
246246
{NC, NC, 0}
247247
};
248+
249+
//*** USBDEVICE ***
250+
251+
MBED_WEAK const PinMap PinMap_USB_FS[] = {
252+
// {PA_8, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF
253+
{PA_9, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_FS_VBUS // Connected to VBUS_FS
254+
{PA_10, USB_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_ID // Connected to OTG_FS_ID
255+
{PA_11, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DM // Connected to OTG_FS_DM
256+
{PA_12, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP // Connected to OTG_FS_DP
257+
{NC, NC, 0}
258+
};

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xC/TARGET_DISCO_F401VC/PinNames.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ typedef enum {
184184
SPI_CS = PB_6,
185185
PWM_OUT = PB_3,
186186

187-
/**** USB pins ****/
187+
/**** USB FS pins ****/
188188
USB_OTG_FS_DM = PA_11,
189189
USB_OTG_FS_DP = PA_12,
190190
USB_OTG_FS_ID = PA_10,

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TARGET_NUCLEO_F401RE/PeripheralNames.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ typedef enum {
7171
PWM_11 = (int)TIM11_BASE
7272
} PWMName;
7373

74+
typedef enum {
75+
USB_FS = (int)USB_OTG_FS_PERIPH_BASE
76+
} USBName;
77+
7478
#ifdef __cplusplus
7579
}
7680
#endif

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TARGET_NUCLEO_F401RE/PeripheralPins.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,3 +226,14 @@ MBED_WEAK const PinMap PinMap_SPI_SSEL[] = {
226226
{PB_12, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI2)},
227227
{NC, NC, 0}
228228
};
229+
230+
//*** USBDEVICE ***
231+
232+
MBED_WEAK const PinMap PinMap_USB_FS[] = {
233+
// {PA_8, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF
234+
{PA_9, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_FS_VBUS
235+
{PA_10, USB_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_ID
236+
{PA_11, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DM
237+
{PA_12, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP
238+
{NC, NC, 0}
239+
};

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TARGET_NUCLEO_F401RE/PinNames.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ typedef enum {
175175
SPI_CS = PB_6,
176176
PWM_OUT = PB_3,
177177

178-
/**** USB pins ****/
178+
/**** USB FS pins ****/
179179
USB_OTG_FS_DM = PA_11,
180180
USB_OTG_FS_DP = PA_12,
181181
USB_OTG_FS_ID = PA_10,

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TARGET_STEVAL_3DP001V1/PeripheralNames.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ typedef enum {
7171
PWM_11 = (int)TIM11_BASE
7272
} PWMName;
7373

74+
typedef enum {
75+
USB_FS = (int)USB_OTG_FS_PERIPH_BASE
76+
} USBName;
77+
7478
#ifdef __cplusplus
7579
}
7680
#endif

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TARGET_STEVAL_3DP001V1/PeripheralPins.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,3 +253,14 @@ MBED_WEAK const PinMap PinMap_SPI_SSEL[] = {
253253
{PE_11, SPI_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)},
254254
{NC, NC, 0}
255255
};
256+
257+
//*** USBDEVICE ***
258+
259+
MBED_WEAK const PinMap PinMap_USB_FS[] = {
260+
// {PA_8, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF
261+
{PA_9, USB_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_FS_VBUS
262+
{PA_10, USB_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_ID
263+
{PA_11, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DM
264+
{PA_12, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP
265+
{NC, NC, 0}
266+
};

0 commit comments

Comments
 (0)