aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os/hal/ports/STM32/LLD/USBv1/usb_lld.h4
-rw-r--r--os/hal/ports/STM32/STM32F0xx/stm32_registry.h5
-rw-r--r--testhal/STM32/STM32F0xx/USB_CDC/chconf.h4
-rw-r--r--testhal/STM32/STM32F0xx/USB_CDC/mcuconf.h8
4 files changed, 17 insertions, 4 deletions
diff --git a/os/hal/ports/STM32/LLD/USBv1/usb_lld.h b/os/hal/ports/STM32/LLD/USBv1/usb_lld.h
index 3af0f6ded..ece8bf66a 100644
--- a/os/hal/ports/STM32/LLD/USBv1/usb_lld.h
+++ b/os/hal/ports/STM32/LLD/USBv1/usb_lld.h
@@ -94,12 +94,12 @@
#error "USB driver activated but no USB peripheral assigned"
#endif
-#if STM32_USB_USE_USB1 && \
+#if STM32_USB_USE_USB1 && \
!CORTEX_IS_VALID_KERNEL_PRIORITY(STM32_USB_USB1_HP_IRQ_PRIORITY)
#error "Invalid IRQ priority assigned to USB HP"
#endif
-#if STM32_USB_USE_USB1 && \
+#if STM32_USB_USE_USB1 && \
!CORTEX_IS_VALID_KERNEL_PRIORITY(STM32_USB_USB1_LP_IRQ_PRIORITY)
#error "Invalid IRQ priority assigned to USB LP"
#endif
diff --git a/os/hal/ports/STM32/STM32F0xx/stm32_registry.h b/os/hal/ports/STM32/STM32F0xx/stm32_registry.h
index 1dbfefc62..19607550c 100644
--- a/os/hal/ports/STM32/STM32F0xx/stm32_registry.h
+++ b/os/hal/ports/STM32/STM32F0xx/stm32_registry.h
@@ -192,7 +192,12 @@
#define STM32_HAS_USART6 FALSE
/* USB attributes.*/
+#if defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F072xB) || \
+ defined(STM32F078xx)
+#define STM32_HAS_USB TRUE
+#else
#define STM32_HAS_USB FALSE
+#endif
#define STM32_HAS_OTG1 FALSE
#define STM32_HAS_OTG2 FALSE
diff --git a/testhal/STM32/STM32F0xx/USB_CDC/chconf.h b/testhal/STM32/STM32F0xx/USB_CDC/chconf.h
index b6ca0aa69..89abbc2dc 100644
--- a/testhal/STM32/STM32F0xx/USB_CDC/chconf.h
+++ b/testhal/STM32/STM32F0xx/USB_CDC/chconf.h
@@ -137,7 +137,7 @@
*
* @note The default is @p TRUE.
*/
-#define CH_CFG_USE_TM TRUE
+#define CH_CFG_USE_TM FALSE
/**
* @brief Threads registry APIs.
@@ -324,7 +324,7 @@
*
* @note The default is @p FALSE.
*/
-#define CH_DBG_STATISTICS TRUE
+#define CH_DBG_STATISTICS FALSE
/**
* @brief Debug option, system state check.
diff --git a/testhal/STM32/STM32F0xx/USB_CDC/mcuconf.h b/testhal/STM32/STM32F0xx/USB_CDC/mcuconf.h
index ad866ae41..482b6ba11 100644
--- a/testhal/STM32/STM32F0xx/USB_CDC/mcuconf.h
+++ b/testhal/STM32/STM32F0xx/USB_CDC/mcuconf.h
@@ -154,3 +154,11 @@
#define STM32_UART_USART1_DMA_PRIORITY 0
#define STM32_UART_USART2_DMA_PRIORITY 0
#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
+
+/*
+ * USB driver system settings.
+ */
+#define STM32_USB_USE_USB1 TRUE
+#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE
+#define STM32_USB_USB1_HP_IRQ_PRIORITY 2
+#define STM32_USB_USB1_LP_IRQ_PRIORITY 3