summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/stm32/boards/B_L475E_IOT01A/mpconfigboard.h4
-rw-r--r--ports/stm32/boards/B_L475E_IOT01A/stm32l4xx_hal_conf.h1
-rw-r--r--ports/stm32/boards/CERB40/mpconfigboard.h2
-rw-r--r--ports/stm32/boards/CERB40/stm32f4xx_hal_conf.h2
-rw-r--r--ports/stm32/boards/ESPRUINO_PICO/mpconfigboard.h4
-rw-r--r--ports/stm32/boards/ESPRUINO_PICO/stm32f4xx_hal_conf.h2
-rw-r--r--ports/stm32/boards/HYDRABUS/mpconfigboard.h2
-rw-r--r--ports/stm32/boards/HYDRABUS/stm32f4xx_hal_conf.h2
-rw-r--r--ports/stm32/boards/LIMIFROG/mpconfigboard.h2
-rw-r--r--ports/stm32/boards/LIMIFROG/stm32l4xx_hal_conf.h1
-rw-r--r--ports/stm32/boards/NETDUINO_PLUS_2/mpconfigboard.h4
-rw-r--r--ports/stm32/boards/NETDUINO_PLUS_2/stm32f4xx_hal_conf.h2
-rw-r--r--ports/stm32/boards/NUCLEO_F401RE/stm32f4xx_hal_conf.h4
-rw-r--r--ports/stm32/boards/NUCLEO_F411RE/stm32f4xx_hal_conf.h4
-rw-r--r--ports/stm32/boards/NUCLEO_F429ZI/mpconfigboard.h2
-rw-r--r--ports/stm32/boards/NUCLEO_F429ZI/stm32f4xx_hal_conf.h2
-rw-r--r--ports/stm32/boards/NUCLEO_F446RE/stm32f4xx_hal_conf.h4
-rw-r--r--ports/stm32/boards/NUCLEO_F746ZG/mpconfigboard.h2
-rw-r--r--ports/stm32/boards/NUCLEO_F746ZG/stm32f7xx_hal_conf.h2
-rw-r--r--ports/stm32/boards/NUCLEO_F767ZI/mpconfigboard.h2
-rw-r--r--ports/stm32/boards/NUCLEO_F767ZI/stm32f7xx_hal_conf.h2
-rw-r--r--ports/stm32/boards/NUCLEO_L476RG/mpconfigboard.h4
-rwxr-xr-xports/stm32/boards/NUCLEO_L476RG/stm32l4xx_hal_conf.h1
-rw-r--r--ports/stm32/boards/OLIMEX_E407/mpconfigboard.h2
-rw-r--r--ports/stm32/boards/OLIMEX_E407/stm32f4xx_hal_conf.h2
-rw-r--r--ports/stm32/boards/PYBLITEV10/mpconfigboard.h2
-rw-r--r--ports/stm32/boards/PYBLITEV10/stm32f4xx_hal_conf.h2
-rw-r--r--ports/stm32/boards/PYBV10/mpconfigboard.h2
-rw-r--r--ports/stm32/boards/PYBV10/stm32f4xx_hal_conf.h2
-rw-r--r--ports/stm32/boards/PYBV11/mpconfigboard.h2
-rw-r--r--ports/stm32/boards/PYBV11/stm32f4xx_hal_conf.h2
-rw-r--r--ports/stm32/boards/PYBV3/mpconfigboard.h2
-rw-r--r--ports/stm32/boards/PYBV3/stm32f4xx_hal_conf.h2
-rw-r--r--ports/stm32/boards/PYBV4/mpconfigboard.h2
-rw-r--r--ports/stm32/boards/PYBV4/stm32f4xx_hal_conf.h2
-rw-r--r--ports/stm32/boards/STM32F411DISC/mpconfigboard.h2
-rw-r--r--ports/stm32/boards/STM32F411DISC/stm32f4xx_hal_conf.h2
-rw-r--r--ports/stm32/boards/STM32F429DISC/mpconfigboard.h3
-rw-r--r--ports/stm32/boards/STM32F429DISC/stm32f4xx_hal_conf.h3
-rw-r--r--ports/stm32/boards/STM32F439/mpconfigboard.h6
-rw-r--r--ports/stm32/boards/STM32F439/stm32f4xx_hal_conf.h2
-rw-r--r--ports/stm32/boards/STM32F4DISC/mpconfigboard.h2
-rw-r--r--ports/stm32/boards/STM32F4DISC/stm32f4xx_hal_conf.h2
-rw-r--r--ports/stm32/boards/STM32F769DISC/mpconfigboard.h3
-rw-r--r--ports/stm32/boards/STM32F769DISC/stm32f7xx_hal_conf.h3
-rw-r--r--ports/stm32/boards/STM32F7DISC/mpconfigboard.h3
-rw-r--r--ports/stm32/boards/STM32F7DISC/stm32f7xx_hal_conf.h2
-rw-r--r--ports/stm32/boards/STM32L476DISC/mpconfigboard.h2
-rw-r--r--ports/stm32/boards/STM32L476DISC/stm32l4xx_hal_conf.h1
49 files changed, 58 insertions, 59 deletions
diff --git a/ports/stm32/boards/B_L475E_IOT01A/mpconfigboard.h b/ports/stm32/boards/B_L475E_IOT01A/mpconfigboard.h
index cc4f36526..3ab3d5fa1 100644
--- a/ports/stm32/boards/B_L475E_IOT01A/mpconfigboard.h
+++ b/ports/stm32/boards/B_L475E_IOT01A/mpconfigboard.h
@@ -4,6 +4,7 @@
#define MICROPY_HW_HAS_SWITCH (1)
#define MICROPY_HW_ENABLE_RNG (1)
#define MICROPY_HW_ENABLE_RTC (1)
+#define MICROPY_HW_ENABLE_USB (1)
// MSI is used and is 4MHz
#define MICROPY_HW_CLK_PLLM (1)
@@ -65,3 +66,6 @@
#define MICROPY_HW_LED2 (pin_B14) // green
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin))
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
+
+// USB config
+#define MICROPY_HW_USB_FS (1)
diff --git a/ports/stm32/boards/B_L475E_IOT01A/stm32l4xx_hal_conf.h b/ports/stm32/boards/B_L475E_IOT01A/stm32l4xx_hal_conf.h
index 9348e0679..6bfb28118 100644
--- a/ports/stm32/boards/B_L475E_IOT01A/stm32l4xx_hal_conf.h
+++ b/ports/stm32/boards/B_L475E_IOT01A/stm32l4xx_hal_conf.h
@@ -45,7 +45,6 @@
extern "C" {
#endif
-#define USE_USB_FS
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
diff --git a/ports/stm32/boards/CERB40/mpconfigboard.h b/ports/stm32/boards/CERB40/mpconfigboard.h
index 444185ca0..fdc7c0120 100644
--- a/ports/stm32/boards/CERB40/mpconfigboard.h
+++ b/ports/stm32/boards/CERB40/mpconfigboard.h
@@ -6,6 +6,7 @@
#define MICROPY_HW_ENABLE_RTC (1)
#define MICROPY_HW_ENABLE_DAC (1)
#define MICROPY_HW_ENABLE_CAN (1)
+#define MICROPY_HW_ENABLE_USB (1)
// HSE is 12MHz
#define MICROPY_HW_CLK_PLLM (12)
@@ -54,5 +55,6 @@
// The Cerb40 has No SDCard
// USB config
+#define MICROPY_HW_USB_FS (1)
//#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
//#define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)
diff --git a/ports/stm32/boards/CERB40/stm32f4xx_hal_conf.h b/ports/stm32/boards/CERB40/stm32f4xx_hal_conf.h
index d6aca705c..e71ba3369 100644
--- a/ports/stm32/boards/CERB40/stm32f4xx_hal_conf.h
+++ b/ports/stm32/boards/CERB40/stm32f4xx_hal_conf.h
@@ -46,8 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-#define USE_USB_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/ESPRUINO_PICO/mpconfigboard.h b/ports/stm32/boards/ESPRUINO_PICO/mpconfigboard.h
index d3ae825b8..53c7f3cd5 100644
--- a/ports/stm32/boards/ESPRUINO_PICO/mpconfigboard.h
+++ b/ports/stm32/boards/ESPRUINO_PICO/mpconfigboard.h
@@ -10,6 +10,7 @@
#define MICROPY_HW_HAS_SWITCH (1)
#define MICROPY_HW_HAS_FLASH (1)
#define MICROPY_HW_ENABLE_RTC (1)
+#define MICROPY_HW_ENABLE_USB (1)
#define MICROPY_HW_ENABLE_SERVO (1)
// Pico has an 8 MHz HSE and the F401 does 84 MHz max
@@ -62,3 +63,6 @@
#define MICROPY_HW_LED4 (pin_B12) // green
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin))
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
+
+// USB config
+#define MICROPY_HW_USB_FS (1)
diff --git a/ports/stm32/boards/ESPRUINO_PICO/stm32f4xx_hal_conf.h b/ports/stm32/boards/ESPRUINO_PICO/stm32f4xx_hal_conf.h
index 11a396b73..d27e2e9ef 100644
--- a/ports/stm32/boards/ESPRUINO_PICO/stm32f4xx_hal_conf.h
+++ b/ports/stm32/boards/ESPRUINO_PICO/stm32f4xx_hal_conf.h
@@ -46,8 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-#define USE_USB_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/HYDRABUS/mpconfigboard.h b/ports/stm32/boards/HYDRABUS/mpconfigboard.h
index 4d5b12866..2e73d3ec8 100644
--- a/ports/stm32/boards/HYDRABUS/mpconfigboard.h
+++ b/ports/stm32/boards/HYDRABUS/mpconfigboard.h
@@ -6,6 +6,7 @@
#define MICROPY_HW_HAS_SDCARD (1)
#define MICROPY_HW_ENABLE_RNG (1)
#define MICROPY_HW_ENABLE_DAC (1)
+#define MICROPY_HW_ENABLE_USB (1)
// HSE is 8MHz
#define MICROPY_HW_CLK_PLLM (8)
@@ -69,4 +70,5 @@
#define MICROPY_HW_SDCARD_DETECT_PRESENT (1)
// USB config
+#define MICROPY_HW_USB_FS (1)
#define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)
diff --git a/ports/stm32/boards/HYDRABUS/stm32f4xx_hal_conf.h b/ports/stm32/boards/HYDRABUS/stm32f4xx_hal_conf.h
index d3df51c10..daf9b63ce 100644
--- a/ports/stm32/boards/HYDRABUS/stm32f4xx_hal_conf.h
+++ b/ports/stm32/boards/HYDRABUS/stm32f4xx_hal_conf.h
@@ -46,8 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-#define USE_USB_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/LIMIFROG/mpconfigboard.h b/ports/stm32/boards/LIMIFROG/mpconfigboard.h
index dfa159fc7..d27c2e66e 100644
--- a/ports/stm32/boards/LIMIFROG/mpconfigboard.h
+++ b/ports/stm32/boards/LIMIFROG/mpconfigboard.h
@@ -5,6 +5,7 @@
#define MICROPY_HW_HAS_FLASH (1)
#define MICROPY_HW_ENABLE_RNG (1)
#define MICROPY_HW_ENABLE_RTC (1)
+#define MICROPY_HW_ENABLE_USB (1)
#define MICROPY_BOARD_EARLY_INIT LIMIFROG_board_early_init
void LIMIFROG_board_early_init(void);
@@ -50,4 +51,5 @@ void LIMIFROG_board_early_init(void);
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
// USB config
+#define MICROPY_HW_USB_FS (1)
// #define MICROPY_HW_USB_OTG_ID_PIN (pin_C12) // This is not the official ID Pin which should be PA10
diff --git a/ports/stm32/boards/LIMIFROG/stm32l4xx_hal_conf.h b/ports/stm32/boards/LIMIFROG/stm32l4xx_hal_conf.h
index 9348e0679..6bfb28118 100644
--- a/ports/stm32/boards/LIMIFROG/stm32l4xx_hal_conf.h
+++ b/ports/stm32/boards/LIMIFROG/stm32l4xx_hal_conf.h
@@ -45,7 +45,6 @@
extern "C" {
#endif
-#define USE_USB_FS
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
diff --git a/ports/stm32/boards/NETDUINO_PLUS_2/mpconfigboard.h b/ports/stm32/boards/NETDUINO_PLUS_2/mpconfigboard.h
index fc83d769e..312576756 100644
--- a/ports/stm32/boards/NETDUINO_PLUS_2/mpconfigboard.h
+++ b/ports/stm32/boards/NETDUINO_PLUS_2/mpconfigboard.h
@@ -9,6 +9,7 @@
// we can turn this on.
#define MICROPY_HW_HAS_SDCARD (0)
#define MICROPY_HW_ENABLE_RNG (1)
+#define MICROPY_HW_ENABLE_USB (1)
#define MICROPY_HW_ENABLE_SERVO (1)
void NETDUINO_PLUS_2_board_early_init(void);
@@ -62,5 +63,6 @@ void NETDUINO_PLUS_2_board_early_init(void);
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin))
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
-// USB VBUS detect pin
+// USB config
+#define MICROPY_HW_USB_FS (1)
#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
diff --git a/ports/stm32/boards/NETDUINO_PLUS_2/stm32f4xx_hal_conf.h b/ports/stm32/boards/NETDUINO_PLUS_2/stm32f4xx_hal_conf.h
index 42c2c4e9b..4cb5a83e4 100644
--- a/ports/stm32/boards/NETDUINO_PLUS_2/stm32f4xx_hal_conf.h
+++ b/ports/stm32/boards/NETDUINO_PLUS_2/stm32f4xx_hal_conf.h
@@ -46,8 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-#define USE_USB_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/NUCLEO_F401RE/stm32f4xx_hal_conf.h b/ports/stm32/boards/NUCLEO_F401RE/stm32f4xx_hal_conf.h
index f4db4cb63..daf9b63ce 100644
--- a/ports/stm32/boards/NUCLEO_F401RE/stm32f4xx_hal_conf.h
+++ b/ports/stm32/boards/NUCLEO_F401RE/stm32f4xx_hal_conf.h
@@ -46,10 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-// This board doesn't really have USB, but the stm32 codebase doesn't build
-// without some USB defined, so we leave this on for now.
-#define USE_USB_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/NUCLEO_F411RE/stm32f4xx_hal_conf.h b/ports/stm32/boards/NUCLEO_F411RE/stm32f4xx_hal_conf.h
index 0c424888f..8f0b66381 100644
--- a/ports/stm32/boards/NUCLEO_F411RE/stm32f4xx_hal_conf.h
+++ b/ports/stm32/boards/NUCLEO_F411RE/stm32f4xx_hal_conf.h
@@ -46,10 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-// This board doesn't really have USB, but the stm32 codebase doesn't build
-// without some USB defined, so we leave this on for now.
-#define USE_USB_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/NUCLEO_F429ZI/mpconfigboard.h b/ports/stm32/boards/NUCLEO_F429ZI/mpconfigboard.h
index 4df87f060..ae7f82225 100644
--- a/ports/stm32/boards/NUCLEO_F429ZI/mpconfigboard.h
+++ b/ports/stm32/boards/NUCLEO_F429ZI/mpconfigboard.h
@@ -6,6 +6,7 @@
#define MICROPY_HW_ENABLE_RNG (1)
#define MICROPY_HW_ENABLE_RTC (1)
#define MICROPY_HW_ENABLE_CAN (1)
+#define MICROPY_HW_ENABLE_USB (1)
// HSE is 8MHz
#define MICROPY_HW_CLK_PLLM (8)
@@ -72,5 +73,6 @@
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
// USB config (CN13 - USB OTG FS)
+#define MICROPY_HW_USB_FS (1)
#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
#define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)
diff --git a/ports/stm32/boards/NUCLEO_F429ZI/stm32f4xx_hal_conf.h b/ports/stm32/boards/NUCLEO_F429ZI/stm32f4xx_hal_conf.h
index d121b18c5..5b5a8a3e4 100644
--- a/ports/stm32/boards/NUCLEO_F429ZI/stm32f4xx_hal_conf.h
+++ b/ports/stm32/boards/NUCLEO_F429ZI/stm32f4xx_hal_conf.h
@@ -46,8 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-#define USE_USB_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/NUCLEO_F446RE/stm32f4xx_hal_conf.h b/ports/stm32/boards/NUCLEO_F446RE/stm32f4xx_hal_conf.h
index 487ca009f..245fb9a06 100644
--- a/ports/stm32/boards/NUCLEO_F446RE/stm32f4xx_hal_conf.h
+++ b/ports/stm32/boards/NUCLEO_F446RE/stm32f4xx_hal_conf.h
@@ -46,10 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-// This board doesn't really have USB, but the stm32 codebase doesn't build
-// without some USB defined, so we leave this on for now.
-#define USE_USB_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/NUCLEO_F746ZG/mpconfigboard.h b/ports/stm32/boards/NUCLEO_F746ZG/mpconfigboard.h
index 0fe6030bb..42beb4d9b 100644
--- a/ports/stm32/boards/NUCLEO_F746ZG/mpconfigboard.h
+++ b/ports/stm32/boards/NUCLEO_F746ZG/mpconfigboard.h
@@ -12,6 +12,7 @@
#define MICROPY_HW_ENABLE_RTC (1)
#define MICROPY_HW_ENABLE_DAC (1)
#define MICROPY_HW_ENABLE_CAN (1)
+#define MICROPY_HW_ENABLE_USB (1)
// HSE is 8MHz
// VCOClock = HSE * PLLN / PLLM = 8 MHz * 216 / 4 = 432 MHz
@@ -66,5 +67,6 @@
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
// USB config (CN13 - USB OTG FS)
+#define MICROPY_HW_USB_FS (1)
#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
#define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)
diff --git a/ports/stm32/boards/NUCLEO_F746ZG/stm32f7xx_hal_conf.h b/ports/stm32/boards/NUCLEO_F746ZG/stm32f7xx_hal_conf.h
index e1aa4578d..a019ee4ce 100644
--- a/ports/stm32/boards/NUCLEO_F746ZG/stm32f7xx_hal_conf.h
+++ b/ports/stm32/boards/NUCLEO_F746ZG/stm32f7xx_hal_conf.h
@@ -46,8 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-#define USE_USB_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/NUCLEO_F767ZI/mpconfigboard.h b/ports/stm32/boards/NUCLEO_F767ZI/mpconfigboard.h
index c3fd016c1..4f9d41f1b 100644
--- a/ports/stm32/boards/NUCLEO_F767ZI/mpconfigboard.h
+++ b/ports/stm32/boards/NUCLEO_F767ZI/mpconfigboard.h
@@ -12,6 +12,7 @@
#define MICROPY_HW_ENABLE_RTC (1)
#define MICROPY_HW_ENABLE_DAC (1)
#define MICROPY_HW_ENABLE_CAN (1)
+#define MICROPY_HW_ENABLE_USB (1)
// HSE is 25MHz
// VCOClock = HSE * PLLN / PLLM = 25 MHz * 432 / 25 = 432 MHz
@@ -66,5 +67,6 @@
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
// USB config (CN13 - USB OTG FS)
+#define MICROPY_HW_USB_FS (1)
#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
#define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)
diff --git a/ports/stm32/boards/NUCLEO_F767ZI/stm32f7xx_hal_conf.h b/ports/stm32/boards/NUCLEO_F767ZI/stm32f7xx_hal_conf.h
index e1aa4578d..a019ee4ce 100644
--- a/ports/stm32/boards/NUCLEO_F767ZI/stm32f7xx_hal_conf.h
+++ b/ports/stm32/boards/NUCLEO_F767ZI/stm32f7xx_hal_conf.h
@@ -46,8 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-#define USE_USB_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/NUCLEO_L476RG/mpconfigboard.h b/ports/stm32/boards/NUCLEO_L476RG/mpconfigboard.h
index 806f8207d..0d5dab394 100644
--- a/ports/stm32/boards/NUCLEO_L476RG/mpconfigboard.h
+++ b/ports/stm32/boards/NUCLEO_L476RG/mpconfigboard.h
@@ -4,6 +4,7 @@
#define MICROPY_HW_HAS_SWITCH (1)
#define MICROPY_HW_HAS_FLASH (1)
#define MICROPY_HW_ENABLE_RTC (1)
+#define MICROPY_HW_ENABLE_USB (1)
// MSI is used and is 4MHz
#define MICROPY_HW_CLK_PLLM (1)
@@ -49,3 +50,6 @@
#define MICROPY_HW_LED1 (pin_A5) // Green LD2 LED on Nucleo
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin))
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
+
+// USB config
+#define MICROPY_HW_USB_FS (1)
diff --git a/ports/stm32/boards/NUCLEO_L476RG/stm32l4xx_hal_conf.h b/ports/stm32/boards/NUCLEO_L476RG/stm32l4xx_hal_conf.h
index 9348e0679..6bfb28118 100755
--- a/ports/stm32/boards/NUCLEO_L476RG/stm32l4xx_hal_conf.h
+++ b/ports/stm32/boards/NUCLEO_L476RG/stm32l4xx_hal_conf.h
@@ -45,7 +45,6 @@
extern "C" {
#endif
-#define USE_USB_FS
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
diff --git a/ports/stm32/boards/OLIMEX_E407/mpconfigboard.h b/ports/stm32/boards/OLIMEX_E407/mpconfigboard.h
index c1e67e3d8..1bdb25a9e 100644
--- a/ports/stm32/boards/OLIMEX_E407/mpconfigboard.h
+++ b/ports/stm32/boards/OLIMEX_E407/mpconfigboard.h
@@ -8,6 +8,7 @@
#define MICROPY_HW_ENABLE_RTC (1)
#define MICROPY_HW_ENABLE_DAC (1)
#define MICROPY_HW_ENABLE_CAN (1)
+#define MICROPY_HW_ENABLE_USB (1)
// HSE is 12MHz
#define MICROPY_HW_CLK_PLLM (12)
@@ -69,5 +70,6 @@
#define MICROPY_HW_SDCARD_DETECT_PRESENT (GPIO_PIN_RESET)
// USB config
+#define MICROPY_HW_USB_FS (1)
#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
#define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)
diff --git a/ports/stm32/boards/OLIMEX_E407/stm32f4xx_hal_conf.h b/ports/stm32/boards/OLIMEX_E407/stm32f4xx_hal_conf.h
index b84b0a892..24cc9228b 100644
--- a/ports/stm32/boards/OLIMEX_E407/stm32f4xx_hal_conf.h
+++ b/ports/stm32/boards/OLIMEX_E407/stm32f4xx_hal_conf.h
@@ -46,8 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-#define USE_USB_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/PYBLITEV10/mpconfigboard.h b/ports/stm32/boards/PYBLITEV10/mpconfigboard.h
index 5037073f9..60a6980aa 100644
--- a/ports/stm32/boards/PYBLITEV10/mpconfigboard.h
+++ b/ports/stm32/boards/PYBLITEV10/mpconfigboard.h
@@ -7,6 +7,7 @@
#define MICROPY_HW_HAS_MMA7660 (1)
#define MICROPY_HW_HAS_LCD (1)
#define MICROPY_HW_ENABLE_RTC (1)
+#define MICROPY_HW_ENABLE_USB (1)
#define MICROPY_HW_ENABLE_SERVO (1)
// HSE is 12MHz
@@ -76,6 +77,7 @@
#define MICROPY_HW_SDCARD_DETECT_PRESENT (GPIO_PIN_RESET)
// USB config
+#define MICROPY_HW_USB_FS (1)
#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
// MMA accelerometer config
diff --git a/ports/stm32/boards/PYBLITEV10/stm32f4xx_hal_conf.h b/ports/stm32/boards/PYBLITEV10/stm32f4xx_hal_conf.h
index 4ee8e7276..4e96f785a 100644
--- a/ports/stm32/boards/PYBLITEV10/stm32f4xx_hal_conf.h
+++ b/ports/stm32/boards/PYBLITEV10/stm32f4xx_hal_conf.h
@@ -46,8 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-#define USE_USB_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/PYBV10/mpconfigboard.h b/ports/stm32/boards/PYBV10/mpconfigboard.h
index bb1d620f6..5d158e6b1 100644
--- a/ports/stm32/boards/PYBV10/mpconfigboard.h
+++ b/ports/stm32/boards/PYBV10/mpconfigboard.h
@@ -11,6 +11,7 @@
#define MICROPY_HW_ENABLE_SERVO (1)
#define MICROPY_HW_ENABLE_DAC (1)
#define MICROPY_HW_ENABLE_CAN (1)
+#define MICROPY_HW_ENABLE_USB (1)
// HSE is 8MHz
#define MICROPY_HW_CLK_PLLM (8)
@@ -90,6 +91,7 @@
#define MICROPY_HW_SDCARD_DETECT_PRESENT (GPIO_PIN_RESET)
// USB config
+#define MICROPY_HW_USB_FS (1)
#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
#define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)
diff --git a/ports/stm32/boards/PYBV10/stm32f4xx_hal_conf.h b/ports/stm32/boards/PYBV10/stm32f4xx_hal_conf.h
index 3d9252264..4f18ac81e 100644
--- a/ports/stm32/boards/PYBV10/stm32f4xx_hal_conf.h
+++ b/ports/stm32/boards/PYBV10/stm32f4xx_hal_conf.h
@@ -46,8 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-#define USE_USB_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/PYBV11/mpconfigboard.h b/ports/stm32/boards/PYBV11/mpconfigboard.h
index 32377513a..71ff52848 100644
--- a/ports/stm32/boards/PYBV11/mpconfigboard.h
+++ b/ports/stm32/boards/PYBV11/mpconfigboard.h
@@ -11,6 +11,7 @@
#define MICROPY_HW_ENABLE_SERVO (1)
#define MICROPY_HW_ENABLE_DAC (1)
#define MICROPY_HW_ENABLE_CAN (1)
+#define MICROPY_HW_ENABLE_USB (1)
// HSE is 12MHz
#define MICROPY_HW_CLK_PLLM (12)
@@ -90,6 +91,7 @@
#define MICROPY_HW_SDCARD_DETECT_PRESENT (GPIO_PIN_RESET)
// USB config
+#define MICROPY_HW_USB_FS (1)
#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
#define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)
diff --git a/ports/stm32/boards/PYBV11/stm32f4xx_hal_conf.h b/ports/stm32/boards/PYBV11/stm32f4xx_hal_conf.h
index b84b0a892..24cc9228b 100644
--- a/ports/stm32/boards/PYBV11/stm32f4xx_hal_conf.h
+++ b/ports/stm32/boards/PYBV11/stm32f4xx_hal_conf.h
@@ -46,8 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-#define USE_USB_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/PYBV3/mpconfigboard.h b/ports/stm32/boards/PYBV3/mpconfigboard.h
index fccba7e72..d2e7dbe20 100644
--- a/ports/stm32/boards/PYBV3/mpconfigboard.h
+++ b/ports/stm32/boards/PYBV3/mpconfigboard.h
@@ -10,6 +10,7 @@
#define MICROPY_HW_ENABLE_SERVO (1)
#define MICROPY_HW_ENABLE_DAC (1)
#define MICROPY_HW_ENABLE_CAN (1)
+#define MICROPY_HW_ENABLE_USB (1)
// HSE is 8MHz
#define MICROPY_HW_CLK_PLLM (8)
@@ -79,6 +80,7 @@
#define MICROPY_HW_SDCARD_DETECT_PRESENT (GPIO_PIN_SET)
// USB VBUS detect pin
+#define MICROPY_HW_USB_FS (1)
#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
// MMA accelerometer config
diff --git a/ports/stm32/boards/PYBV3/stm32f4xx_hal_conf.h b/ports/stm32/boards/PYBV3/stm32f4xx_hal_conf.h
index d3df51c10..daf9b63ce 100644
--- a/ports/stm32/boards/PYBV3/stm32f4xx_hal_conf.h
+++ b/ports/stm32/boards/PYBV3/stm32f4xx_hal_conf.h
@@ -46,8 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-#define USE_USB_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/PYBV4/mpconfigboard.h b/ports/stm32/boards/PYBV4/mpconfigboard.h
index b1678512b..c6d9ad9ac 100644
--- a/ports/stm32/boards/PYBV4/mpconfigboard.h
+++ b/ports/stm32/boards/PYBV4/mpconfigboard.h
@@ -11,6 +11,7 @@
#define MICROPY_HW_ENABLE_SERVO (1)
#define MICROPY_HW_ENABLE_DAC (1)
#define MICROPY_HW_ENABLE_CAN (1)
+#define MICROPY_HW_ENABLE_USB (1)
// HSE is 8MHz
#define MICROPY_HW_CLK_PLLM (8)
@@ -87,6 +88,7 @@
#define MICROPY_HW_SDCARD_DETECT_PRESENT (GPIO_PIN_RESET)
// USB config
+#define MICROPY_HW_USB_FS (1)
#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
#define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)
diff --git a/ports/stm32/boards/PYBV4/stm32f4xx_hal_conf.h b/ports/stm32/boards/PYBV4/stm32f4xx_hal_conf.h
index d3df51c10..daf9b63ce 100644
--- a/ports/stm32/boards/PYBV4/stm32f4xx_hal_conf.h
+++ b/ports/stm32/boards/PYBV4/stm32f4xx_hal_conf.h
@@ -46,8 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-#define USE_USB_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/STM32F411DISC/mpconfigboard.h b/ports/stm32/boards/STM32F411DISC/mpconfigboard.h
index 3b3b0db53..13172333b 100644
--- a/ports/stm32/boards/STM32F411DISC/mpconfigboard.h
+++ b/ports/stm32/boards/STM32F411DISC/mpconfigboard.h
@@ -4,6 +4,7 @@
#define MICROPY_HW_HAS_SWITCH (1)
#define MICROPY_HW_HAS_FLASH (1)
#define MICROPY_HW_ENABLE_RTC (1)
+#define MICROPY_HW_ENABLE_USB (1)
#define MICROPY_HW_ENABLE_SERVO (1)
// HSE is 8MHz
@@ -58,5 +59,6 @@
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
// USB config
+#define MICROPY_HW_USB_FS (1)
#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
#define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)
diff --git a/ports/stm32/boards/STM32F411DISC/stm32f4xx_hal_conf.h b/ports/stm32/boards/STM32F411DISC/stm32f4xx_hal_conf.h
index 921cbe5fe..8f0b66381 100644
--- a/ports/stm32/boards/STM32F411DISC/stm32f4xx_hal_conf.h
+++ b/ports/stm32/boards/STM32F411DISC/stm32f4xx_hal_conf.h
@@ -46,8 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-#define USE_USB_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/STM32F429DISC/mpconfigboard.h b/ports/stm32/boards/STM32F429DISC/mpconfigboard.h
index a4c46325a..01713f7f8 100644
--- a/ports/stm32/boards/STM32F429DISC/mpconfigboard.h
+++ b/ports/stm32/boards/STM32F429DISC/mpconfigboard.h
@@ -6,6 +6,7 @@
#define MICROPY_HW_ENABLE_RNG (1)
#define MICROPY_HW_ENABLE_RTC (1)
#define MICROPY_HW_ENABLE_CAN (1)
+#define MICROPY_HW_ENABLE_USB (1)
// HSE is 8MHz
#define MICROPY_HW_CLK_PLLM (8)
@@ -62,5 +63,7 @@
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
// USB config
+#define MICROPY_HW_USB_HS (1)
+#define MICROPY_HW_USB_HS_IN_FS (1)
#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_B13)
#define MICROPY_HW_USB_OTG_ID_PIN (pin_B12)
diff --git a/ports/stm32/boards/STM32F429DISC/stm32f4xx_hal_conf.h b/ports/stm32/boards/STM32F429DISC/stm32f4xx_hal_conf.h
index 4f5962dcb..5b5a8a3e4 100644
--- a/ports/stm32/boards/STM32F429DISC/stm32f4xx_hal_conf.h
+++ b/ports/stm32/boards/STM32F429DISC/stm32f4xx_hal_conf.h
@@ -46,9 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-#define USE_USB_HS
-#define USE_USB_HS_IN_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/STM32F439/mpconfigboard.h b/ports/stm32/boards/STM32F439/mpconfigboard.h
index 7ead50a21..66bfcf2ec 100644
--- a/ports/stm32/boards/STM32F439/mpconfigboard.h
+++ b/ports/stm32/boards/STM32F439/mpconfigboard.h
@@ -7,6 +7,7 @@
#define MICROPY_HW_ENABLE_RTC (1)
#define MICROPY_HW_ENABLE_DAC (1)
#define MICROPY_HW_ENABLE_CAN (1)
+#define MICROPY_HW_ENABLE_USB (1)
// SD card detect switch
#if MICROPY_HW_HAS_SDCARD
@@ -21,6 +22,9 @@
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV2) //divide PLL clock by this to get core clock
#define MICROPY_HW_CLK_PLLQ (8) //divide core clock by this to get 48MHz
+// USB config
+#define MICROPY_HW_USB_FS (1)
+
// UART config
#define MICROPY_HW_UART1_TX (pin_A9)
#define MICROPY_HW_UART1_RX (pin_A10)
@@ -46,7 +50,7 @@
#define MICROPY_HW_SPI1_SCK (pin_A5)
#define MICROPY_HW_SPI1_MISO (pin_A6)
#define MICROPY_HW_SPI1_MOSI (pin_A7)
-#if defined(USE_USB_HS_IN_FS)
+#if MICROPY_HW_USB_HS_IN_FS
// The HS USB uses B14 & B15 for D- and D+
#else
#define MICROPY_HW_SPI2_NSS (pin_B12)
diff --git a/ports/stm32/boards/STM32F439/stm32f4xx_hal_conf.h b/ports/stm32/boards/STM32F439/stm32f4xx_hal_conf.h
index d121b18c5..5b5a8a3e4 100644
--- a/ports/stm32/boards/STM32F439/stm32f4xx_hal_conf.h
+++ b/ports/stm32/boards/STM32F439/stm32f4xx_hal_conf.h
@@ -46,8 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-#define USE_USB_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/STM32F4DISC/mpconfigboard.h b/ports/stm32/boards/STM32F4DISC/mpconfigboard.h
index df4222c28..66ef830bf 100644
--- a/ports/stm32/boards/STM32F4DISC/mpconfigboard.h
+++ b/ports/stm32/boards/STM32F4DISC/mpconfigboard.h
@@ -7,6 +7,7 @@
#define MICROPY_HW_ENABLE_RTC (1)
#define MICROPY_HW_ENABLE_DAC (1)
#define MICROPY_HW_ENABLE_CAN (1)
+#define MICROPY_HW_ENABLE_USB (1)
// HSE is 8MHz
#define MICROPY_HW_CLK_PLLM (8)
@@ -74,5 +75,6 @@
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
// USB config
+#define MICROPY_HW_USB_FS (1)
#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
#define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)
diff --git a/ports/stm32/boards/STM32F4DISC/stm32f4xx_hal_conf.h b/ports/stm32/boards/STM32F4DISC/stm32f4xx_hal_conf.h
index d3df51c10..daf9b63ce 100644
--- a/ports/stm32/boards/STM32F4DISC/stm32f4xx_hal_conf.h
+++ b/ports/stm32/boards/STM32F4DISC/stm32f4xx_hal_conf.h
@@ -46,8 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-#define USE_USB_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/STM32F769DISC/mpconfigboard.h b/ports/stm32/boards/STM32F769DISC/mpconfigboard.h
index 4da9dcd90..95201501b 100644
--- a/ports/stm32/boards/STM32F769DISC/mpconfigboard.h
+++ b/ports/stm32/boards/STM32F769DISC/mpconfigboard.h
@@ -11,6 +11,7 @@
#define MICROPY_HW_ENABLE_RNG (1)
#define MICROPY_HW_ENABLE_RTC (1)
#define MICROPY_HW_ENABLE_CAN (1)
+#define MICROPY_HW_ENABLE_USB (1)
// HSE is 25MHz
// VCOClock = HSE * PLLN / PLLM = 25 MHz * 432 / 25 = 432 MHz
@@ -68,5 +69,7 @@
#define MICROPY_HW_SDCARD_DETECT_PRESENT (GPIO_PIN_RESET)
// USB config (CN13 - USB OTG FS)
+#define MICROPY_HW_USB_HS (1)
+#define MICROPY_HW_USB_HS_IN_FS (1)
/*#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_J12)*/
#define MICROPY_HW_USB_OTG_ID_PIN (pin_J12)
diff --git a/ports/stm32/boards/STM32F769DISC/stm32f7xx_hal_conf.h b/ports/stm32/boards/STM32F769DISC/stm32f7xx_hal_conf.h
index ce8254902..ff968bca9 100644
--- a/ports/stm32/boards/STM32F769DISC/stm32f7xx_hal_conf.h
+++ b/ports/stm32/boards/STM32F769DISC/stm32f7xx_hal_conf.h
@@ -46,9 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-#define USE_USB_HS
-#define USE_USB_HS_IN_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/STM32F7DISC/mpconfigboard.h b/ports/stm32/boards/STM32F7DISC/mpconfigboard.h
index 1ee8e6277..9fce1deeb 100644
--- a/ports/stm32/boards/STM32F7DISC/mpconfigboard.h
+++ b/ports/stm32/boards/STM32F7DISC/mpconfigboard.h
@@ -7,6 +7,7 @@
#define MICROPY_HW_ENABLE_RNG (1)
#define MICROPY_HW_ENABLE_RTC (1)
#define MICROPY_HW_ENABLE_CAN (1)
+#define MICROPY_HW_ENABLE_USB (1)
#define MICROPY_BOARD_EARLY_INIT STM32F7DISC_board_early_init
void STM32F7DISC_board_early_init(void);
@@ -69,6 +70,6 @@ void STM32F7DISC_board_early_init(void);
// The Hardware VBUS detect only works on pin PA9. The STM32F7 Discovery uses
// PA9 for VCP_TX functionality and connects the VBUS to pin J12 (so software
// only detect). So we don't define the VBUS detect pin since that requires PA9.
-
+#define MICROPY_HW_USB_FS (1)
/*#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_J12)*/
#define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)
diff --git a/ports/stm32/boards/STM32F7DISC/stm32f7xx_hal_conf.h b/ports/stm32/boards/STM32F7DISC/stm32f7xx_hal_conf.h
index 3fbfb4310..ff968bca9 100644
--- a/ports/stm32/boards/STM32F7DISC/stm32f7xx_hal_conf.h
+++ b/ports/stm32/boards/STM32F7DISC/stm32f7xx_hal_conf.h
@@ -46,8 +46,6 @@
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
-#define USE_USB_FS
-
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
diff --git a/ports/stm32/boards/STM32L476DISC/mpconfigboard.h b/ports/stm32/boards/STM32L476DISC/mpconfigboard.h
index 87ab3d6a6..463ec9ccf 100644
--- a/ports/stm32/boards/STM32L476DISC/mpconfigboard.h
+++ b/ports/stm32/boards/STM32L476DISC/mpconfigboard.h
@@ -8,6 +8,7 @@ void STM32L476DISC_board_early_init(void);
#define MICROPY_HW_HAS_FLASH (1)
#define MICROPY_HW_ENABLE_RNG (1)
#define MICROPY_HW_ENABLE_RTC (1)
+#define MICROPY_HW_ENABLE_USB (1)
// use external SPI flash for storage
#define MICROPY_HW_SPIFLASH_SIZE_BITS (128 * 1024 * 1024)
@@ -57,4 +58,5 @@ void STM32L476DISC_board_early_init(void);
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
// USB config
+#define MICROPY_HW_USB_FS (1)
// #define MICROPY_HW_USB_OTG_ID_PIN (pin_C12) // This is not the official ID Pin which should be PA10
diff --git a/ports/stm32/boards/STM32L476DISC/stm32l4xx_hal_conf.h b/ports/stm32/boards/STM32L476DISC/stm32l4xx_hal_conf.h
index 9348e0679..6bfb28118 100644
--- a/ports/stm32/boards/STM32L476DISC/stm32l4xx_hal_conf.h
+++ b/ports/stm32/boards/STM32L476DISC/stm32l4xx_hal_conf.h
@@ -45,7 +45,6 @@
extern "C" {
#endif
-#define USE_USB_FS
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/