USB device stack for NUCLEO-F042K6, NUCLEO-L152RE and NUCLEO-F103RB.

Dependents:   LPE-SEM01

Fork of L152RE_USBDevice by Norimasa Okamoto

I tried USB device using HAL_PCD.

/media/uploads/va009039/f042k6_usbdevice_vin.jpg

Nucleo-F042K6USB
PA11 (CN3-13)DM  (2 WHITE)
PA12 (CN3-5)DP  (3 GREEN)
GND (CN3-4)GND (5 BLACK)
VIN (CN4-1)VBUS(1 RED)

Examples

Import programF042K6_USBDevice_example

NUCLEO-F042K6 USBDevice example code

Import programL152RE_USBDevice_example

L152RE_USBDevice example code

Import programF042K6_Simple-CMSIS-DAP

cmsis-dap debug adapter

Import programL152RE_Simple-CMSIS-DAP

cmsis-dap debug adapter

Revision:
45:0f216c4e75e5
Parent:
33:f85ada5a4cef
Child:
52:fb344268a308
--- a/USBDevice/USBHAL_STM32F4.cpp	Tue Mar 24 08:30:19 2015 +0000
+++ b/USBDevice/USBHAL_STM32F4.cpp	Thu Mar 26 14:30:20 2015 +0000
@@ -48,7 +48,7 @@
     // Enable power and clocking
     RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN;
 
-#if defined(TARGET_STM32F407VG) || defined(TARGET_STM32F401RE)
+#if defined(TARGET_STM32F407VG) || defined(TARGET_STM32F401RE) || defined(TARGET_STM32F411RE)
     pin_function(PA_8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_OTG_FS));
     pin_function(PA_9, STM_PIN_DATA(STM_MODE_INPUT, GPIO_PULLDOWN, GPIO_AF10_OTG_FS));
     pin_function(PA_10, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS));