From a9614bb9643fac83275a7085f3fa5fca28bb4239 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 15 Jun 2020 15:17:27 -0500 Subject: [PATCH 01/10] cxd56: Sort the configuration settings --- ports/cxd56/mpconfigport.mk | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index 8aeae1de56..4594df731a 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -8,15 +8,15 @@ USB_CDC_EP_NUM_DATA_IN = 1 USB_MSC_EP_NUM_OUT = 5 USB_MSC_EP_NUM_IN = 4 -CIRCUITPY_AUDIOIO = 0 CIRCUITPY_AUDIOBUSIO = 0 -CIRCUITPY_I2CSLAVE = 0 -CIRCUITPY_ROTARYIO = 0 -CIRCUITPY_TOUCHIO = 0 -CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_NEOPIXEL_WRITE = 0 -CIRCUITPY_NVM = 0 +CIRCUITPY_AUDIOIO = 0 +CIRCUITPY_COUNTIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_COUNTIO = 0 +CIRCUITPY_GAMEPAD = 0 +CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_NEOPIXEL_WRITE = 0 +CIRCUITPY_NVM = 0 +CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_TOUCHIO = 0 INTERNAL_LIBM = 1 From 9d5ccccf7d572697284a12fa9804878fc67c32f9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 15 Jun 2020 15:18:11 -0500 Subject: [PATCH 02/10] cxd56: Disable HID and MIDI These are already disabled via the USB_DEVICES setting, but the code is included anyway. --- ports/cxd56/mpconfigport.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index 4594df731a..5894b9b73b 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -19,4 +19,6 @@ CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_TOUCHIO = 0 +CIRCUITPY_USB_HID = 0 +CIRCUITPY_USB_MIDI = 0 INTERNAL_LIBM = 1 From 8bbd539031fbcc9366c51f1d06c77a72d240d812 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 15 Jun 2020 14:52:35 -0500 Subject: [PATCH 03/10] supervisor.mk: Compute what USB_DEVICES should be, and check it against what it is --- supervisor/supervisor.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 195e4a9b23..7eb7e26305 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -119,10 +119,25 @@ ifndef USB_DEVICES USB_DEVICES = "CDC,MSC,AUDIO,HID" endif +USB_DEVICES_COMPUTED := CDC,MSC +ifeq ($(CIRCUITPY_USB_MIDI),1) +USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),AUDIO +endif +ifeq ($(CIRCUITPY_USB_HID),1) +USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),HID +endif +USB_DEVICES_COMPUTED := "$(USB_DEVICES_COMPUTED)" + ifndef USB_HID_DEVICES USB_HID_DEVICES = "KEYBOARD,MOUSE,CONSUMER,GAMEPAD" endif +# During a transitional period, check that the COMPUTED values match. +# Once they do all match, we can remove all the hard-coded ones. +ifneq ($(USB_DEVICES),$(USB_DEVICES_COMPUTED)) +$(error Computed USB devices '$(USB_DEVICES_COMPUTED)' different than hard-coded USB devices '$(USB_DEVICES)') +endif + ifndef USB_MSC_MAX_PACKET_SIZE USB_MSC_MAX_PACKET_SIZE = 64 endif From 38659b566c5cd4c9be1a8340bdd801f394ce7084 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 23 Jun 2020 10:56:27 -0500 Subject: [PATCH 04/10] atmel-samd: Finish disabling USB MIDI and/or HID on certain boards --- ports/atmel-samd/boards/8086_commander/mpconfigboard.mk | 1 + ports/atmel-samd/boards/pewpew10/mpconfigboard.mk | 2 ++ ports/atmel-samd/boards/ugame10/mpconfigboard.mk | 2 ++ .../boards/winterbloom_big_honking_button/mpconfigboard.mk | 1 + ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk | 2 ++ 5 files changed, 8 insertions(+) diff --git a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk index dcc62fc9bc..8f8f508ea4 100644 --- a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk +++ b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk @@ -14,6 +14,7 @@ EXTERNAL_FLASH_DEVICES = "W25Q128JV_SQ" LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 +CIRCUITPY_USB_MIDI = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk index 7305abf73a..1ad2553a31 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk @@ -24,3 +24,5 @@ SUPEROPT_GC = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-standalone-10.x CFLAGS_BOARD = --param max-inline-insns-auto=15 + +USB_DEVICES="CDC,MSC,HID" diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk index 1c43369076..2ccaa9bdbd 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk @@ -39,3 +39,5 @@ CFLAGS_INLINE_LIMIT = 45 else CFLAGS_INLINE_LIMIT = 70 endif + +USB_DEVICES="CDC,MSC" diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk index 466e345911..d2477e9fdc 100644 --- a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk @@ -31,4 +31,5 @@ CIRCUITPY_TOUCHIO = 0 CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_USB_HID = 0 +CIRCUITPY_USB_MIDI = 0 CIRCUITPY_RTC = 0 diff --git a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk index 9309fdce0d..372b1f4912 100644 --- a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk +++ b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk @@ -28,3 +28,5 @@ CIRCUITPY_COUNTIO=0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD + +USB_DEVICES="CDC,MSC,HID" From 458eef052e732a5c8385d30c966b4c59cde2b15a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 23 Jun 2020 10:57:25 -0500 Subject: [PATCH 05/10] esp32s2: Disable USB MIDI .. it was not in the USB descriptors anyway (lack of enough endpoints?) --- ports/esp32s2/mpconfigport.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index c9df81db03..040022052c 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -30,8 +30,8 @@ CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_TOUCHIO = 0 -# Enable USB support +# Enable USB HID support CIRCUITPY_USB_HID = 1 -CIRCUITPY_USB_MIDI = 1 +CIRCUITPY_USB_MIDI = 0 CIRCUITPY_MODULE ?= none From 3f112d28e3ef4ba15e8e0829abbbba6e411977f9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 23 Jun 2020 10:57:32 -0500 Subject: [PATCH 06/10] mimxrt10xx: Disable USB MIDI .. it was not in the USB descriptors anyway (lack of enough endpoints?) --- ports/mimxrt10xx/mpconfigport.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index e9e554142c..8162d43279 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -27,4 +27,5 @@ CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_COUNTIO = 0 +CIRCUITPY_USB_MIDI = 0 LONGINT_IMPL = MPZ From 0110463811869e187556e5ed8033c280a7199aa5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 23 Jun 2020 11:01:08 -0500 Subject: [PATCH 07/10] stm: Disable USB MIDI and most USB HID .. it was not in the USB descriptors anyway (lack of enough endpoints?) --- ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk | 2 ++ ports/stm/mpconfigport.mk | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk index 04d2a9b0d0..a2a322dfab 100644 --- a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk @@ -17,3 +17,5 @@ MCU_PACKAGE = LQFP144 LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F412_fs.ld + +CIRCUITPY_USB_HID = 1 diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 0c5247d952..09db525bd8 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -21,6 +21,8 @@ ifeq ($(MCU_SERIES),F4) ifndef CIRCUITPY_NVM CIRCUITPY_NVM = 0 endif + CIRCUITPY_USB_MIDI ?= 0 + CIRCUITPY_USB_HID ?= 0 endif ifeq ($(MCU_SERIES),H7) @@ -36,6 +38,8 @@ ifeq ($(MCU_SERIES),H7) CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 + CIRCUITPY_USB_MIDI ?= 0 + CIRCUITPY_USB_HID ?= 0 endif ifeq ($(MCU_SERIES),F7) @@ -50,4 +54,6 @@ ifeq ($(MCU_SERIES),F7) CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 + CIRCUITPY_USB_MIDI ?= 0 + CIRCUITPY_USB_HID ?= 0 endif From 93d3629da279ae080cdfa616d54451150b373697 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 23 Jun 2020 11:02:38 -0500 Subject: [PATCH 08/10] stm: Sort configuration options and make them all conditional This makes them all overridable on the board level, tersely --- ports/stm/mpconfigport.mk | 77 +++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 09db525bd8..7b720d1564 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -1,59 +1,56 @@ -MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz -LONGINT_IMPL = MPZ -INTERNAL_LIBM = 1 -USB_SERIAL_NUMBER_LENGTH = 24 +MPY_TOOL_LONGINT_IMPL ?= -mlongint-impl=mpz +LONGINT_IMPL ?= MPZ +INTERNAL_LIBM ?= 1 +USB_SERIAL_NUMBER_LENGTH ?= 24 ifeq ($(MCU_VARIANT),STM32F405xx) - CIRCUITPY_FRAMEBUFFERIO = 1 - CIRCUITPY_RGBMATRIX = 1 + CIRCUITPY_FRAMEBUFFERIO ?= 1 + CIRCUITPY_RGBMATRIX ?= 1 endif ifeq ($(MCU_SERIES),F4) # Not yet implemented common-hal modules: - CIRCUITPY_AUDIOBUSIO = 0 - CIRCUITPY_AUDIOIO = 0 - CIRCUITPY_ROTARYIO = 0 - CIRCUITPY_COUNTIO = 0 - CIRCUITPY_RTC = 0 - CIRCUITPY_FREQUENCYIO = 0 - CIRCUITPY_I2CSLAVE = 0 - # Can be overridden on board level - ifndef CIRCUITPY_NVM - CIRCUITPY_NVM = 0 - endif + CIRCUITPY_AUDIOBUSIO ?= 0 + CIRCUITPY_AUDIOIO ?= 0 + CIRCUITPY_COUNTIO ?= 0 + CIRCUITPY_FREQUENCYIO ?= 0 + CIRCUITPY_I2CSLAVE ?= 0 + CIRCUITPY_NVM ?= 0 + CIRCUITPY_ROTARYIO ?= 0 + CIRCUITPY_RTC ?= 0 CIRCUITPY_USB_MIDI ?= 0 CIRCUITPY_USB_HID ?= 0 endif ifeq ($(MCU_SERIES),H7) # Not yet implemented common-hal modules: - CIRCUITPY_ANALOGIO = 0 - CIRCUITPY_NEOPIXEL_WRITE = 0 - CIRCUITPY_PULSEIO = 0 - CIRCUITPY_NVM = 0 - CIRCUITPY_AUDIOBUSIO = 0 - CIRCUITPY_AUDIOIO = 0 - CIRCUITPY_COUNTIO = 0 - CIRCUITPY_ROTARYIO = 0 - CIRCUITPY_RTC = 0 - CIRCUITPY_FREQUENCYIO = 0 - CIRCUITPY_I2CSLAVE = 0 - CIRCUITPY_USB_MIDI ?= 0 + CIRCUITPY_ANALOGIO ?= 0 + CIRCUITPY_AUDIOBUSIO ?= 0 + CIRCUITPY_AUDIOIO ?= 0 + CIRCUITPY_COUNTIO ?= 0 + CIRCUITPY_FREQUENCYIO ?= 0 + CIRCUITPY_I2CSLAVE ?= 0 + CIRCUITPY_NEOPIXEL_WRITE ?= 0 + CIRCUITPY_NVM ?= 0 + CIRCUITPY_PULSEIO ?= 0 + CIRCUITPY_ROTARYIO ?= 0 + CIRCUITPY_RTC ?= 0 CIRCUITPY_USB_HID ?= 0 + CIRCUITPY_USB_MIDI ?= 0 endif ifeq ($(MCU_SERIES),F7) # Not yet implemented common-hal modules: - CIRCUITPY_ANALOGIO = 0 - CIRCUITPY_NEOPIXEL_WRITE = 0 - CIRCUITPY_NVM = 0 - CIRCUITPY_AUDIOBUSIO = 0 - CIRCUITPY_AUDIOIO = 0 - CIRCUITPY_ROTARYIO = 0 - CIRCUITPY_COUNTIO = 0 - CIRCUITPY_RTC = 0 - CIRCUITPY_FREQUENCYIO = 0 - CIRCUITPY_I2CSLAVE = 0 - CIRCUITPY_USB_MIDI ?= 0 + CIRCUITPY_ANALOGIO ?= 0 + CIRCUITPY_AUDIOBUSIO ?= 0 + CIRCUITPY_AUDIOIO ?= 0 + CIRCUITPY_COUNTIO ?= 0 + CIRCUITPY_FREQUENCYIO ?= 0 + CIRCUITPY_I2CSLAVE ?= 0 + CIRCUITPY_NEOPIXEL_WRITE ?= 0 + CIRCUITPY_NVM ?= 0 + CIRCUITPY_ROTARYIO ?= 0 + CIRCUITPY_RTC ?= 0 CIRCUITPY_USB_HID ?= 0 + CIRCUITPY_USB_MIDI ?= 0 endif From f232aef7865c4e094f060f9766418f60fb9f86ea Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 15 Jun 2020 19:12:04 -0500 Subject: [PATCH 09/10] supervisor.mk: Compute USB_DEVICES; remove from boards and ports Since Actions passed on the previous commit, where this computed value was checked against the specified value (if any), this is no net change, except that we no longer need to specify it for particular boards or ports. --- .../boards/8086_commander/mpconfigboard.mk | 2 -- ports/atmel-samd/boards/pewpew10/mpconfigboard.mk | 2 -- ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk | 2 -- ports/atmel-samd/boards/ugame10/mpconfigboard.mk | 2 -- .../winterbloom_big_honking_button/mpconfigboard.mk | 1 - .../boards/winterbloom_sol/mpconfigboard.mk | 1 - .../atmel-samd/boards/xinabox_cs11/mpconfigboard.mk | 2 -- ports/cxd56/mpconfigport.mk | 1 - .../boards/espressif_saola_1_wroom/mpconfigboard.mk | 1 - .../boards/espressif_saola_1_wrover/mpconfigboard.mk | 1 - ports/litex/boards/fomu/mpconfigboard.mk | 1 - ports/mimxrt10xx/mpconfigport.mk | 1 - ports/stm/boards/espruino_pico/mpconfigboard.mk | 1 - ports/stm/boards/espruino_wifi/mpconfigboard.mk | 1 - .../feather_stm32f405_express/mpconfigboard.mk | 1 - ports/stm/boards/meowbit_v121/mpconfigboard.mk | 1 - ports/stm/boards/nucleo_f746zg/mpconfigboard.mk | 1 - ports/stm/boards/nucleo_f767zi/mpconfigboard.mk | 1 - ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk | 1 - ports/stm/boards/openmv_h7/mpconfigboard.mk | 1 - ports/stm/boards/pyb_nano_v2/mpconfigboard.mk | 1 - ports/stm/boards/pyboard_v11/mpconfigboard.mk | 1 - .../boards/stm32f411ce_blackpill/mpconfigboard.mk | 1 - .../boards/stm32f411ve_discovery/mpconfigboard.mk | 1 - .../boards/stm32f412zg_discovery/mpconfigboard.mk | 1 - ports/stm/boards/stm32f4_discovery/mpconfigboard.mk | 1 - .../stm/boards/stm32f746g_discovery/mpconfigboard.mk | 1 - ports/stm/boards/thunderpack/mpconfigboard.mk | 1 - supervisor/supervisor.mk | 12 +----------- 29 files changed, 1 insertion(+), 44 deletions(-) diff --git a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk index 8f8f508ea4..4b0377be25 100644 --- a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk +++ b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk @@ -3,8 +3,6 @@ USB_PID = 0x0101 USB_PRODUCT = "Commander" USB_MANUFACTURER = "8086 Consultancy" -USB_DEVICES= "CDC,MSC,HID" - CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk index 1ad2553a31..7305abf73a 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk @@ -24,5 +24,3 @@ SUPEROPT_GC = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-standalone-10.x CFLAGS_BOARD = --param max-inline-insns-auto=15 - -USB_DEVICES="CDC,MSC,HID" diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index 87f92ae9ec..864d31909d 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -46,8 +46,6 @@ CIRCUITPY_MATH = 1 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pewpew_m4 CIRCUITPY_DISPLAY_FONT = $(TOP)/ports/atmel-samd/boards/ugame10/brutalist-6.bdf -USB_DEVICES = "CDC,MSC" - # Tweak inlining depending on language. ifeq ($(TRANSLATION), zh_Latn_pinyin) CFLAGS_INLINE_LIMIT = 45 diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk index 2ccaa9bdbd..1c43369076 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk @@ -39,5 +39,3 @@ CFLAGS_INLINE_LIMIT = 45 else CFLAGS_INLINE_LIMIT = 70 endif - -USB_DEVICES="CDC,MSC" diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk index d2477e9fdc..de9b617649 100644 --- a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk @@ -4,7 +4,6 @@ USB_VID = 0x239A USB_PID = 0x6005 USB_PRODUCT = "Big Honking Button" USB_MANUFACTURER = "Winterbloom" -USB_DEVICES = "CDC,MSC" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 diff --git a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk index 6a78a4ff99..e96497b3e5 100644 --- a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk @@ -6,7 +6,6 @@ USB_PID = 0x8062 USB_PRODUCT = "Sol" USB_MANUFACTURER = "Winterbloom" USB_INTERFACE_NAME = "Sol" -USB_DEVICES = "CDC,MSC,AUDIO" CHIP_VARIANT = SAMD51J20A CHIP_FAMILY = samd51 diff --git a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk index 372b1f4912..9309fdce0d 100644 --- a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk +++ b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk @@ -28,5 +28,3 @@ CIRCUITPY_COUNTIO=0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD - -USB_DEVICES="CDC,MSC,HID" diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index 5894b9b73b..d91458aca3 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -1,5 +1,4 @@ USB_SERIAL_NUMBER_LENGTH = 10 -USB_DEVICES = "CDC,MSC" USB_MSC_MAX_PACKET_SIZE = 512 USB_RENUMBER_ENDPOINTS = 0 USB_CDC_EP_NUM_NOTIFICATION = 3 diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk index cd27356153..d9ad568863 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x80A8 USB_PRODUCT = "Saola 1 w/WROOM" USB_MANUFACTURER = "Espressif" -USB_DEVICES = "CDC,MSC,HID" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk index 0b847de943..558b1144a9 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x80A6 USB_PRODUCT = "Saola 1 w/WROVER" USB_MANUFACTURER = "Espressif" -USB_DEVICES = "CDC,MSC,HID" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/litex/boards/fomu/mpconfigboard.mk b/ports/litex/boards/fomu/mpconfigboard.mk index 4787803ccd..c8de94e9c0 100644 --- a/ports/litex/boards/fomu/mpconfigboard.mk +++ b/ports/litex/boards/fomu/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x1209 USB_PID = 0x5BF0 USB_PRODUCT = "Fomu" USB_MANUFACTURER = "Foosn" -USB_DEVICES = "CDC,MSC,AUDIO,HID" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index 8162d43279..49d9985083 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -14,7 +14,6 @@ endif INTERNAL_LIBM = 1 -USB_DEVICES = "CDC,MSC,HID" USB_SERIAL_NUMBER_LENGTH = 32 USB_MSC_MAX_PACKET_SIZE = 512 diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.mk b/ports/stm/boards/espruino_pico/mpconfigboard.mk index 054937c33e..201237c9d6 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.mk +++ b/ports/stm/boards/espruino_pico/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x808E USB_PRODUCT = "Espruino Pico" USB_MANUFACTURER = "Espruino" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/espruino_wifi/mpconfigboard.mk b/ports/stm/boards/espruino_wifi/mpconfigboard.mk index ee82095ffd..9500a5f185 100644 --- a/ports/stm/boards/espruino_wifi/mpconfigboard.mk +++ b/ports/stm/boards/espruino_wifi/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x8090 USB_PRODUCT = "Espruino Wifi" USB_MANUFACTURER = "Espruino" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk index d98bd29ec7..2b2c0d6db5 100644 --- a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x805A USB_PRODUCT = "Feather STM32F405 Express" USB_MANUFACTURER = "Adafruit Industries LLC" -USB_DEVICES = "CDC,MSC" SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.mk b/ports/stm/boards/meowbit_v121/mpconfigboard.mk index cf60c89c26..127cdb60e2 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.mk +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x805A USB_PRODUCT = "Meowbit" USB_MANUFACTURER = "Kittenbot" -USB_DEVICES = "CDC,MSC" SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk index 651f3c2292..1c8edecc35 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x809E USB_PRODUCT = "Nucleo F746zg - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk index c5d956b994..0c712a0f48 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x809A USB_PRODUCT = "Nucleo F767ZI - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk index ea99a1e10b..35f47e1931 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x8098 USB_PRODUCT = "Nucleo H743ZI - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.mk b/ports/stm/boards/openmv_h7/mpconfigboard.mk index 4ff0f18d54..a837dc9ec7 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.mk +++ b/ports/stm/boards/openmv_h7/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x80A4 USB_PRODUCT = "OpenMV-H7 R1" USB_MANUFACTURER = "OpenMV, LLC" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk b/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk index 08a2668167..237dba921e 100644 --- a/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk +++ b/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x8068 USB_PRODUCT = "PYB LR Nano V2" USB_MANUFACTURER = "MicroPython Chinese Community" -USB_DEVICES = "CDC,MSC" SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 diff --git a/ports/stm/boards/pyboard_v11/mpconfigboard.mk b/ports/stm/boards/pyboard_v11/mpconfigboard.mk index c0c0f5f6cd..78b96e55fc 100644 --- a/ports/stm/boards/pyboard_v11/mpconfigboard.mk +++ b/ports/stm/boards/pyboard_v11/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x805C USB_PRODUCT = "Pyboard Version 1.1" USB_MANUFACTURER = "George Robotic" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk index 0054232e1d..9b45a0fac7 100644 --- a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk +++ b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x806A USB_PRODUCT = "stm32f411ce blackpill" USB_MANUFACTURER = "Unknown" -USB_DEVICES = "CDC,MSC" # SPI_FLASH_FILESYSTEM = 1 # EXTERNAL_FLASH_DEVICE_COUNT = 1 diff --git a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk index ca2f10ba37..3cb7162a4a 100644 --- a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x805E USB_PRODUCT = "STM32F411VE Discovery Board - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk index a2a322dfab..c99eb1a008 100644 --- a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x8056 USB_PRODUCT = "STM32F412ZG Discovery Board - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC,HID" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk index 09652d9ad9..7eece58968 100644 --- a/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x808A USB_PRODUCT = "STM32F407VG Discovery Board - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk index 94a50853cb..c1c754ab5b 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x809C USB_PRODUCT = "ST STM32F746G Discovery - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/thunderpack/mpconfigboard.mk b/ports/stm/boards/thunderpack/mpconfigboard.mk index 007b00cdd1..afd0ffd751 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x806A USB_PRODUCT = "Thunderpack STM32F411" USB_MANUFACTURER = "Jeremy Gillick" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 7eb7e26305..0717785e7f 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -115,10 +115,6 @@ ifndef USB_INTERFACE_NAME USB_INTERFACE_NAME = "CircuitPython" endif -ifndef USB_DEVICES -USB_DEVICES = "CDC,MSC,AUDIO,HID" -endif - USB_DEVICES_COMPUTED := CDC,MSC ifeq ($(CIRCUITPY_USB_MIDI),1) USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),AUDIO @@ -126,18 +122,12 @@ endif ifeq ($(CIRCUITPY_USB_HID),1) USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),HID endif -USB_DEVICES_COMPUTED := "$(USB_DEVICES_COMPUTED)" +USB_DEVICES := "$(USB_DEVICES_COMPUTED)" ifndef USB_HID_DEVICES USB_HID_DEVICES = "KEYBOARD,MOUSE,CONSUMER,GAMEPAD" endif -# During a transitional period, check that the COMPUTED values match. -# Once they do all match, we can remove all the hard-coded ones. -ifneq ($(USB_DEVICES),$(USB_DEVICES_COMPUTED)) -$(error Computed USB devices '$(USB_DEVICES_COMPUTED)' different than hard-coded USB devices '$(USB_DEVICES)') -endif - ifndef USB_MSC_MAX_PACKET_SIZE USB_MSC_MAX_PACKET_SIZE = 64 endif From bf460ddf25ead020c6aeeb9ac4393ddf17daf7bb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 24 Jun 2020 09:44:45 -0500 Subject: [PATCH 10/10] supervisor.mk: Conditionally assign USB_DEVICES This restores the ability to remove CDC and/or MSC, at the price of giving up the new automatic check that USB_DEVICES is correct. Since devices have to have CDC and MSC to be "CircuitPython", this is not a facility that is going to be used by any in-tree drivers. --- supervisor/supervisor.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 0717785e7f..21803ae0a3 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -122,7 +122,7 @@ endif ifeq ($(CIRCUITPY_USB_HID),1) USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),HID endif -USB_DEVICES := "$(USB_DEVICES_COMPUTED)" +USB_DEVICES ?= "$(USB_DEVICES_COMPUTED)" ifndef USB_HID_DEVICES USB_HID_DEVICES = "KEYBOARD,MOUSE,CONSUMER,GAMEPAD"