Skip to content

Commit b23a041

Browse files
Add rudimentary STM32G0 USB PHY support
1 parent 13f43cc commit b23a041

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

targets/TARGET_STM/USBPhyHw.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@
4747
#define USBHAL_IRQn USB_LP_IRQn
4848
#elif defined(TARGET_STM32F3)
4949
#define USBHAL_IRQn USB_LP_CAN_RX0_IRQn
50+
#elif defined(TARGET_STM32G0)
51+
#define USB USB_DRD_FS
52+
#if defined(STM32G0B1xx)
53+
#define USBHAL_IRQn USB_UCPD1_2_IRQn
54+
#else
55+
#define USBHAL_IRQn USB_IRQn
56+
#endif
5057
#elif defined(TARGET_STM32L5)
5158
#define USBHAL_IRQn USB_FS_IRQn
5259
#else

targets/targets.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2939,8 +2939,14 @@
29392939
"STM32G0B1xx"
29402940
],
29412941
"device_has_add": [
2942-
"ANALOGOUT"
2943-
]
2942+
"ANALOGOUT",
2943+
"USBDEVICE"
2944+
],
2945+
"config": {
2946+
"usb_speed": {
2947+
"value": "USE_USB_NO_OTG"
2948+
}
2949+
}
29442950
},
29452951
"NUCLEO_G0B1RE": {
29462952
"inherits": [

0 commit comments

Comments
 (0)