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:
25:7c72828865f3
Parent:
16:4f6df64750bd
Child:
30:4408411999c8
--- a/USBDevice/USBHAL.h	Fri May 16 09:00:39 2014 +0100
+++ b/USBDevice/USBHAL.h	Tue Jun 03 11:30:32 2014 +0100
@@ -58,7 +58,7 @@
     bool realiseEndpoint(uint8_t endpoint, uint32_t maxPacket, uint32_t options);
     bool getEndpointStallState(unsigned char endpoint);
     uint32_t endpointReadcore(uint8_t endpoint, uint8_t *buffer);
-    
+
 protected:
     virtual void busReset(void){};
     virtual void EP0setupCallback(void){};
@@ -67,7 +67,7 @@
     virtual void connectStateChanged(unsigned int connected){};
     virtual void suspendStateChanged(unsigned int suspended){};
     virtual void SOF(int frameNumber){};
-            
+
     virtual bool EP1_OUT_callback(){return false;};
     virtual bool EP1_IN_callback(){return false;};
     virtual bool EP2_OUT_callback(){return false;};
@@ -102,7 +102,7 @@
     virtual bool EP15_IN_callback(){return false;};
 #endif
 #endif
-    
+
 private:
     void usbisr(void);
     static void _usbisr(void);
@@ -116,6 +116,6 @@
         bool (USBHAL::*epCallback[32 - 2])(void);
 #endif
 
-        
+
 };
 #endif