diff options
| author | sakumisu <[email protected]> | 2023-12-26 20:11:23 +0800 |
|---|---|---|
| committer | sakumisu <[email protected]> | 2023-12-26 20:11:23 +0800 |
| commit | 8cd31e6be0a894c5e89beebb3ab377d3405fe44e (patch) | |
| tree | 0db1ff1467acdb51b2d384d4d4def247df6f5561 | |
| parent | 56c2b3413151a638ade84df3068992511e70de3c (diff) | |
add check for dwc2 ramsize and ep num
| -rw-r--r-- | port/dwc2/usb_dc_dwc2.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/port/dwc2/usb_dc_dwc2.c b/port/dwc2/usb_dc_dwc2.c index 76169b6e..a40d6350 100644 --- a/port/dwc2/usb_dc_dwc2.c +++ b/port/dwc2/usb_dc_dwc2.c @@ -564,6 +564,18 @@ int usb_dc_init(void) USB_LOG_INFO("dwc2 has %d endpoints, default config: %d endpoints\r\n", endpoints, CONFIG_USBDEV_EP_NUM); USB_LOG_INFO("=================================\r\n"); + if (endpoints < CONFIG_USBDEV_EP_NUM) { + USB_LOG_ERR("dwc2 has less endpoints than config, please check\r\n"); + while (1) { + } + } + + if ((hsphy_type == 0) && (CONFIG_USB_DWC2_RAM_SIZE != 1280)) { + USB_LOG_ERR("dwc2 hsphy type is 0, but ram size is not 1280, please check\r\n"); + while (1) { + } + } + USB_OTG_DEV->DCTL |= USB_OTG_DCTL_SDIS; USB_OTG_GLB->GAHBCFG &= ~USB_OTG_GAHBCFG_GINT; |
