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

Files at this revision

API Documentation at this revision

Comitter:
va009039
Date:
Mon Jan 18 10:47:16 2016 +0000
Parent:
64:c3d0530b6d82
Commit message:
add NUCLEO-F042K6

Changed in this revision

USBDevice/USBEndpoints.h Show annotated file Show diff for this revision Revisions of this file
USBDevice/USBHAL.h Show annotated file Show diff for this revision Revisions of this file
USBDevice/USBHAL_STM32L1.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r c3d0530b6d82 -r 0ba7c5e2b3dc USBDevice/USBEndpoints.h
--- a/USBDevice/USBEndpoints.h	Thu Jun 25 09:33:51 2015 +0900
+++ b/USBDevice/USBEndpoints.h	Mon Jan 18 10:47:16 2016 +0000
@@ -45,7 +45,7 @@
 #include "USBEndpoints_KL25Z.h"
 #elif defined (TARGET_STM32F4)
 #include "USBEndpoints_STM32F4.h"
-#elif defined(TARGET_STM32L1)||defined(TARGET_STM32F1)
+#elif defined(TARGET_STM32L1)||defined(TARGET_STM32F1)||defined(TARGET_STM32F0)
 #include "USBEndpoints_STM32L1.h"
 #elif defined (TARGET_RZ_A1H)
 #include "USBEndpoints_RZ_A1H.h"
diff -r c3d0530b6d82 -r 0ba7c5e2b3dc USBDevice/USBHAL.h
--- a/USBDevice/USBHAL.h	Thu Jun 25 09:33:51 2015 +0900
+++ b/USBDevice/USBHAL.h	Mon Jan 18 10:47:16 2016 +0000
@@ -74,7 +74,7 @@
     virtual bool EP2_IN_callback(){return false;};
     virtual bool EP3_OUT_callback(){return false;};
     virtual bool EP3_IN_callback(){return false;};
-#if !defined(TARGET_STM32F4)||defined(TARGET_STM32L1)||defined(TARGET_STM32F1)
+#if !defined(TARGET_STM32F4)||defined(TARGET_STM32L1)||defined(TARGET_STM32F1)||defined(TARGET_STM32F0)
     virtual bool EP4_OUT_callback(){return false;};
     virtual bool EP4_IN_callback(){return false;};
 #if !(defined(TARGET_LPC11UXX) || defined(TARGET_LPC11U6X) || defined(TARGET_LPC1347) || defined(TARGET_LPC1549))
@@ -117,7 +117,7 @@
 #endif
 
 
-#if defined(TARGET_STM32L1)||defined(TARGET_STM32F1)
+#if defined(TARGET_STM32L1)||defined(TARGET_STM32F1)||defined(TARGET_STM32F0)
 public: // HAL_PCD
     void SetupStageCallback();
     void DataInStageCallback(uint8_t epnum);
diff -r c3d0530b6d82 -r 0ba7c5e2b3dc USBDevice/USBHAL_STM32L1.cpp
--- a/USBDevice/USBHAL_STM32L1.cpp	Thu Jun 25 09:33:51 2015 +0900
+++ b/USBDevice/USBHAL_STM32L1.cpp	Mon Jan 18 10:47:16 2016 +0000
@@ -16,7 +16,7 @@
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
 
-#if defined(TARGET_STM32L1)||defined(TARGET_STM32F1)
+#if defined(TARGET_STM32L1)||defined(TARGET_STM32F1)||defined(TARGET_STM32F0)
 #include "USBDevice.h"
 
 #if defined(TARGET_STM32F1)