Prechádzať zdrojové kódy

Merge pull request #729 from hathach/cleanup-make

Cleanup make
Ha Thach 5 rokov pred
rodič
commit
e182bb2a5b
60 zmenil súbory, kde vykonal 214 pridanie a 340 odobranie
  1. 10 9
      .github/ISSUE_TEMPLATE/bug_report.md
  2. 1 1
      .github/ISSUE_TEMPLATE/feature_request.md
  3. 2 4
      examples/device/cdc_dual_ports/src/main.c
  4. 2 0
      examples/device/cdc_dual_ports/src/tusb_config.h
  5. 13 15
      examples/device/cdc_msc/src/main.c
  6. 3 0
      examples/device/cdc_msc/src/tusb_config.h
  7. 2 0
      examples/device/cdc_msc_freertos/Makefile
  8. 11 11
      examples/device/cdc_msc_freertos/src/main.c
  9. 3 0
      examples/device/cdc_msc_freertos/src/tusb_config.h
  10. 2 0
      examples/device/hid_composite_freertos/Makefile
  11. 2 0
      examples/device/net_lwip_webserver/Makefile
  12. 0 1
      examples/device/net_lwip_webserver/src/usb_descriptors.c
  13. 1 1
      examples/make.mk
  14. 12 69
      examples/rules.mk
  15. 3 6
      hw/bsp/d5035_01/board.mk
  16. 3 6
      hw/bsp/da14695_dk_usb/board.mk
  17. 3 6
      hw/bsp/da1469x_dk_pro/board.mk
  18. 2 5
      hw/bsp/ea4088qs/board.mk
  19. 2 5
      hw/bsp/ea4357/board.mk
  20. 36 0
      hw/bsp/esp32s2/family.mk
  21. 2 4
      hw/bsp/fomu/family.mk
  22. 2 5
      hw/bsp/frdm_kl25z/board.mk
  23. 2 5
      hw/bsp/imxrt/family.mk
  24. 2 5
      hw/bsp/lpc18/family.mk
  25. 2 5
      hw/bsp/lpc55/family.mk
  26. 2 5
      hw/bsp/lpcxpresso11u37/board.mk
  27. 2 5
      hw/bsp/lpcxpresso11u68/board.mk
  28. 2 5
      hw/bsp/lpcxpresso1347/board.mk
  29. 2 5
      hw/bsp/lpcxpresso1549/board.mk
  30. 2 5
      hw/bsp/lpcxpresso1769/board.mk
  31. 2 5
      hw/bsp/lpcxpresso51u68/board.mk
  32. 2 5
      hw/bsp/lpcxpresso54114/board.mk
  33. 2 5
      hw/bsp/mbed1768/board.mk
  34. 3 9
      hw/bsp/msp430/family.mk
  35. 2 5
      hw/bsp/ngx4330/board.mk
  36. 2 5
      hw/bsp/nrf/family.mk
  37. 2 5
      hw/bsp/nutiny_nuc121s/board.mk
  38. 3 6
      hw/bsp/nutiny_nuc125s/board.mk
  39. 2 5
      hw/bsp/nutiny_nuc126v/board.mk
  40. 2 5
      hw/bsp/nutiny_sdk_nuc120/board.mk
  41. 2 5
      hw/bsp/nutiny_sdk_nuc505/board.mk
  42. 18 1
      hw/bsp/rp2040/family.mk
  43. 2 5
      hw/bsp/samd11/family.mk
  44. 2 5
      hw/bsp/samd21/family.mk
  45. 2 5
      hw/bsp/samd51/family.mk
  46. 3 9
      hw/bsp/same54xplainedpro/board.mk
  47. 2 1
      hw/bsp/same70_xplained/board.mk
  48. 2 5
      hw/bsp/samg55xplained/board.mk
  49. 4 6
      hw/bsp/spresense/board.mk
  50. 2 5
      hw/bsp/stm32f070rbnucleo/board.mk
  51. 2 5
      hw/bsp/stm32f072disco/board.mk
  52. 2 5
      hw/bsp/stm32f103bluepill/board.mk
  53. 2 5
      hw/bsp/stm32f207nucleo/board.mk
  54. 2 5
      hw/bsp/stm32f303disco/board.mk
  55. 2 5
      hw/bsp/stm32f4/family.mk
  56. 2 5
      hw/bsp/stm32f7/family.mk
  57. 2 5
      hw/bsp/stm32h7/family.mk
  58. 2 5
      hw/bsp/stm32l0538disco/board.mk
  59. 2 5
      hw/bsp/stm32l476disco/board.mk
  60. 2 5
      hw/bsp/stm32l4r5nucleo/board.mk

+ 10 - 9
.github/ISSUE_TEMPLATE/bug_report.md

@@ -1,5 +1,5 @@
 ---
-name: Bug report
+name: Bug Report
 about: Create a report to help us improve
 title: ''
 labels: Bug 🐞
@@ -7,16 +7,17 @@ assignees: ''
 
 ---
 
-**Set up**
-[Mandatory] Provide details of your setup help us to reproduce the issue as quick as possible  
- - **PC OS**   : Ubuntu 18.04 / Windows 10/ macOS 10.15 
- - **Board**   : Feather nRF52840 Express
- - **Firmware**: examples/device/cdc_msc
+Please provide details for all required fields, otherwise issue could be CLOSED and/or LOCKED.
 
-**Describe the bug**
+**Set Up (required)**
+- **PC OS** e.g Ubuntu 20.04 / Windows 10/ macOS 10.15
+- **Board** e.g Feather nRF52840 Express (if custom specify your MCUs)
+- **Firmware** e.g examples/device/cdc_msc
+
+**Describe The Bug (required)**
 A clear and concise description of what the bug is.
 
-**To reproduce**
+**To Reproduce (required)**
 Steps to reproduce the behavior:
 1. Go to '...'
 2. Click on '....'
@@ -26,4 +27,4 @@ Steps to reproduce the behavior:
 If applicable, add screenshots, bus capture to help explain your problem. 
 
 **Log**
-Please provide the stack's log (uart/rtt/swo) where the issue occurred, best with comments to explain the actual events. To enable logging, add `LOG=2` to to the make command if building with stock examples or set `CFG_TUSB_DEBUG=2` in your tusb_config.h. More information can be found at [example's readme](/docs/getting_started.md)
+If applicable, provide the stack's log (uart/rtt/swo) where the issue occurred, best with comments to explain the actual events. To enable logging, add `LOG=2` to to the make command if building with stock examples or set `CFG_TUSB_DEBUG=2` in your tusb_config.h. More information can be found at [example's readme](/docs/getting_started.md)

+ 1 - 1
.github/ISSUE_TEMPLATE/feature_request.md

@@ -1,5 +1,5 @@
 ---
-name: Feature request
+name: Feature Request
 about: Suggest an idea for this project
 title: ''
 labels: Feature 💡

+ 2 - 4
examples/device/cdc_dual_ports/src/main.c

@@ -63,13 +63,11 @@ static void echo_serial_port(uint8_t itf, uint8_t buf[], uint32_t count)
     }
     else
     {
-      // echo back additional ports as upper case
+      // echo back 2nd port as upper case
       if (islower(buf[i])) buf[i] -= 'a' - 'A';
     }
 
     tud_cdc_n_write_char(itf, buf[i]);
-
-    if ( buf[i] == '\r' ) tud_cdc_n_write_char(itf, '\n');
   }
   tud_cdc_n_write_flush(itf);
 }
@@ -85,7 +83,7 @@ static void cdc_task(void)
   {
     // connected() check for DTR bit
     // Most but not all terminal client set this when making connection
-    if ( tud_cdc_n_connected(itf) )
+    // if ( tud_cdc_n_connected(itf) )
     {
       if ( tud_cdc_n_available(itf) )
       {

+ 2 - 0
examples/device/cdc_dual_ports/src/tusb_config.h

@@ -104,6 +104,8 @@
 #define CFG_TUD_CDC_RX_BUFSIZE   (TUD_OPT_HIGH_SPEED ? 512 : 64)
 #define CFG_TUD_CDC_TX_BUFSIZE   (TUD_OPT_HIGH_SPEED ? 512 : 64)
 
+// CDC Endpoint transfer buffer size, more is faster
+#define CFG_TUD_CDC_EP_BUFSIZE   (TUD_OPT_HIGH_SPEED ? 512 : 64)
 
 #ifdef __cplusplus
  }

+ 13 - 15
examples/device/cdc_msc/src/main.c

@@ -48,7 +48,6 @@ enum  {
 static uint32_t blink_interval_ms = BLINK_NOT_MOUNTED;
 
 void led_blinking_task(void);
-
 void cdc_task(void);
 
 /*------------- MAIN -------------*/
@@ -112,18 +111,16 @@ void cdc_task(void)
     // connected and there are data available
     if ( tud_cdc_available() )
     {
-      uint8_t buf[64];
-
-      // read and echo back
+      // read datas
+      char buf[64];
       uint32_t count = tud_cdc_read(buf, sizeof(buf));
+      (void) count;
 
-      for(uint32_t i=0; i<count; i++)
-      {
-        tud_cdc_write_char(buf[i]);
-
-        if ( buf[i] == '\r' ) tud_cdc_write_char('\n');
-      }
-
+      // Echo back
+      // Note: Skip echo by commenting out write() and write_flush()
+      // for throughput test e.g
+      //    $ dd if=/dev/zero of=/dev/ttyACM0 count=10000
+      tud_cdc_write(buf, count);
       tud_cdc_write_flush();
     }
   }
@@ -135,12 +132,13 @@ void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts)
   (void) itf;
   (void) rts;
 
-  // connected
+  // TODO set some indicator
   if ( dtr )
   {
-    // print initial message when connected
-    tud_cdc_write_str("\r\nTinyUSB CDC MSC device example\r\n");
-    tud_cdc_write_flush();
+    // Terminal connected
+  }else
+  {
+    // Terminal disconnected
   }
 }
 

+ 3 - 0
examples/device/cdc_msc/src/tusb_config.h

@@ -106,6 +106,9 @@
 #define CFG_TUD_CDC_RX_BUFSIZE   (TUD_OPT_HIGH_SPEED ? 512 : 64)
 #define CFG_TUD_CDC_TX_BUFSIZE   (TUD_OPT_HIGH_SPEED ? 512 : 64)
 
+// CDC Endpoint transfer buffer size, more is faster
+#define CFG_TUD_CDC_EP_BUFSIZE   (TUD_OPT_HIGH_SPEED ? 512 : 64)
+
 // MSC Buffer size of Device Mass storage
 #define CFG_TUD_MSC_EP_BUFSIZE   512
 

+ 2 - 0
examples/device/cdc_msc_freertos/Makefile

@@ -1,3 +1,5 @@
+DEPS_SUBMODULES += lib/FreeRTOS-Kernel
+
 include ../../../tools/top.mk
 include ../../make.mk
 

+ 11 - 11
examples/device/cdc_msc_freertos/src/main.c

@@ -179,14 +179,13 @@ void cdc_task(void* params)
 
         // read and echo back
         uint32_t count = tud_cdc_read(buf, sizeof(buf));
+        (void) count;
 
-        for(uint32_t i=0; i<count; i++)
-        {
-          tud_cdc_write_char(buf[i]);
-
-          if ( buf[i] == '\r' ) tud_cdc_write_char('\n');
-        }
-
+        // Echo back
+        // Note: Skip echo by commenting out write() and write_flush()
+        // for throughput test e.g
+        //    $ dd if=/dev/zero of=/dev/ttyACM0 count=10000
+        tud_cdc_write(buf, count);
         tud_cdc_write_flush();
       }
     }
@@ -202,12 +201,13 @@ void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts)
   (void) itf;
   (void) rts;
 
-  // connected
+  // TODO set some indicator
   if ( dtr )
   {
-    // print initial message when connected
-    tud_cdc_write_str("\r\nTinyUSB CDC MSC device with FreeRTOS example\r\n");
-    tud_cdc_write_flush();
+    // Terminal connected
+  }else
+  {
+    // Terminal disconnected
   }
 }
 

+ 3 - 0
examples/device/cdc_msc_freertos/src/tusb_config.h

@@ -106,6 +106,9 @@
 #define CFG_TUD_CDC_RX_BUFSIZE   (TUD_OPT_HIGH_SPEED ? 512 : 64)
 #define CFG_TUD_CDC_TX_BUFSIZE   (TUD_OPT_HIGH_SPEED ? 512 : 64)
 
+// CDC Endpoint transfer buffer size, more is faster
+#define CFG_TUD_CDC_EP_BUFSIZE   (TUD_OPT_HIGH_SPEED ? 512 : 64)
+
 // MSC Buffer size of Device Mass storage
 #define CFG_TUD_MSC_EP_BUFSIZE   512
 

+ 2 - 0
examples/device/hid_composite_freertos/Makefile

@@ -1,3 +1,5 @@
+DEPS_SUBMODULES += lib/FreeRTOS-Kernel
+
 include ../../../tools/top.mk
 include ../../make.mk
 

+ 2 - 0
examples/device/net_lwip_webserver/Makefile

@@ -1,3 +1,5 @@
+DEPS_SUBMODULES += lib/lwip
+
 include ../../../tools/top.mk
 include ../../make.mk
 

+ 0 - 1
examples/device/net_lwip_webserver/src/usb_descriptors.c

@@ -142,7 +142,6 @@ static uint8_t const ecm_configuration[] =
 // - Windows only works with RNDIS
 // - MacOS only works with CDC-ECM
 // - Linux will work on both
-// Note index is Num-1x
 static uint8_t const * const configuration_arr[2] =
 {
   [CONFIG_ID_RNDIS] = rndis_configuration,

+ 1 - 1
examples/make.mk

@@ -40,7 +40,7 @@ ifeq ($(FAMILY),)
   include $(TOP)/hw/bsp/$(BOARD)/board.mk
 else
   # Include Family and Board specific defs
-  -include $(TOP)/$(FAMILY_PATH)/family.mk
+  include $(TOP)/$(FAMILY_PATH)/family.mk
 
   SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(FAMILY_PATH)/*.c))
 endif

+ 12 - 69
examples/rules.mk

@@ -5,69 +5,9 @@
 # Set all as default goal
 .DEFAULT_GOAL := all
 
-ifeq ($(FAMILY),esp32s2)
-# ---------------------------------------
-# Espressif IDF use CMake build system, this add wrapper target to call idf.py
-# ---------------------------------------
-
-.PHONY: all clean flash
-
-all:
-	idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) build
-
-build: all
-
-clean:
-	idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) clean
-
-fullclean:
-	idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) fullclean
-
-flash:
-	idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) flash
-
-bootloader-flash:
-	idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) bootloader-flash
-
-app-flash:
-	idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) app-flash
-
-erase:
-	idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) erase_flash
-
-monitor:
-	idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) monitor
-
-uf2: $(BUILD)/$(PROJECT).uf2
-
-UF2_FAMILY_ID = 0xbfdd4eee
-$(BUILD)/$(PROJECT).uf2: $(BUILD)/$(PROJECT).bin
-	@echo CREATE $@
-	$(PYTHON) $(TOP)/tools/uf2/utils/uf2conv.py -f $(UF2_FAMILY_ID) -b 0x0 -c -o $@ $^
-
-else ifeq ($(FAMILY),rp2040)
-# ---------------------------------------
-# RP2040 CMake
-# ---------------------------------------
-
-ifeq ($(DEBUG), 1)
-CMAKE_DEFSYM += -DCMAKE_BUILD_TYPE=Debug
-endif
-
-$(BUILD):
-	cmake -S . -B $(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) -DPICO_BUILD_DOCS=0 $(CMAKE_DEFSYM)
-
-all: $(BUILD)
-	$(MAKE) -C $(BUILD)
-
-clean:
-	$(RM) -rf $(BUILD)
-
-#flash: flash-pyocd
-flash:
-	@$(CP) $(BUILD)/$(PROJECT).uf2 /media/$(USER)/RPI-RP2
-
-else
+# ESP32-S2 and RP2040 has its own CMake build system
+ifneq ($(FAMILY),esp32s2)
+ifneq ($(FAMILY),rp2040)
 # ---------------------------------------
 # GNU Make build system
 # ---------------------------------------
@@ -93,8 +33,7 @@ SRC_C += \
 	src/class/msc/msc_device.c \
 	src/class/net/net_device.c \
 	src/class/usbtmc/usbtmc_device.c \
-	src/class/vendor/vendor_device.c \
-	src/portable/$(VENDOR)/$(CHIP_FAMILY)/dcd_$(CHIP_FAMILY).c
+	src/class/vendor/vendor_device.c
 
 # TinyUSB stack include
 INC += $(TOP)/src
@@ -195,12 +134,12 @@ else
 	$(RM) -rf $(BUILD)
 endif
 
+endif
 endif # GNU Make
 
-# Print out the value of a make variable.
-# https://stackoverflow.com/questions/16467718/how-to-print-out-a-variable-in-makefile
-print-%:
-	@echo $* = $($*)
+# ---------------------------------------
+# Flash Targets
+# ---------------------------------------
 
 # Flash binary using Jlink
 ifeq ($(OS),Windows_NT)
@@ -245,3 +184,7 @@ copy-artifact: $(BIN)
 	#@$(CP) $(BUILD)/$(PROJECT).hex $(BIN)
 	#@$(CP) $(BUILD)/$(PROJECT).elf $(BIN)
 
+# Print out the value of a make variable.
+# https://stackoverflow.com/questions/16467718/how-to-print-out-a-variable-in-makefile
+print-%:
+	@echo $* = $($*)

+ 3 - 6
hw/bsp/d5035_01/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/microchip
+DEPS_SUBMODULES += hw/mcu/microchip
 HWREV ?= 1
 
 CFLAGS += \
@@ -22,8 +22,9 @@ CFLAGS += \
 LD_FILE = hw/bsp/$(BOARD)/same51j19a_flash.ld
 
 SRC_C += \
+  src/portable/microchip/samd/dcd_samd.c \
   hw/mcu/microchip/same51/gcc/gcc/startup_same51.c \
-  hw/mcu/microchip/same51/gcc/system_same51.c \
+  hw/mcu/microchip/same51/gcc/system_same51.c
 
 ifdef SYSCALLS
 ifneq ($(SYSCALLS),0)
@@ -47,10 +48,6 @@ INC += \
 	$(TOP)/hw/mcu/microchip/same51/hri \
 	$(TOP)/hw/mcu/microchip/same51/CMSIS/Include
 
-# For TinyUSB port source
-VENDOR = microchip
-CHIP_FAMILY = samd
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM4F
 

+ 3 - 6
hw/bsp/da14695_dk_usb/board.mk

@@ -16,7 +16,9 @@ MCU_FAMILY_DIR = hw/mcu/dialog/da1469x
 # All source paths should be relative to the top level.
 LD_FILE = hw/bsp/$(BOARD)/da1469x.ld
 
+# While this is for da1469x chip, there is chance that da1468x chip family will also work
 SRC_C += \
+	src/portable/dialog/da146xx/dcd_da146xx.c \
 	$(MCU_FAMILY_DIR)/src/system_da1469x.c \
 	$(MCU_FAMILY_DIR)/src/da1469x_clock.c \
 	$(MCU_FAMILY_DIR)/src/hal_gpio.c \
@@ -26,12 +28,7 @@ SRC_S += hw/bsp/$(BOARD)/gcc_startup_da1469x.S
 INC += \
 	$(TOP)/hw/bsp/$(BOARD) \
 	$(TOP)/$(MCU_FAMILY_DIR)/include \
-	$(TOP)/$(MCU_FAMILY_DIR)/SDK_10.0.8.105/sdk/bsp/include \
-
-# For TinyUSB port source
-VENDOR = dialog
-# While this is for da1469x chip, there is chance that da1468x chip family will also work
-CHIP_FAMILY = da146xx
+	$(TOP)/$(MCU_FAMILY_DIR)/SDK_10.0.8.105/sdk/bsp/include
 
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM33_NTZ/non_secure

+ 3 - 6
hw/bsp/da1469x_dk_pro/board.mk

@@ -16,7 +16,9 @@ MCU_FAMILY_DIR = hw/mcu/dialog/da1469x
 # All source paths should be relative to the top level.
 LD_FILE = hw/bsp/$(BOARD)/da1469x.ld
 
+# While this is for da1469x chip, there is chance that da1468x chip family will also work
 SRC_C += \
+	src/portable/dialog/da146xx/dcd_da146xx.c \
 	$(MCU_FAMILY_DIR)/src/system_da1469x.c \
 	$(MCU_FAMILY_DIR)/src/da1469x_clock.c \
 	$(MCU_FAMILY_DIR)/src/hal_gpio.c \
@@ -26,12 +28,7 @@ SRC_S += hw/bsp/$(BOARD)/gcc_startup_da1469x.S
 INC += \
 	$(TOP)/hw/bsp/$(BOARD) \
 	$(TOP)/$(MCU_FAMILY_DIR)/include \
-	$(TOP)/$(MCU_FAMILY_DIR)/SDK_10.0.8.105/sdk/bsp/include \
-
-# For TinyUSB port source
-VENDOR = dialog
-# While this is for da1469x chip, there is chance that da1468x chip family will also work
-CHIP_FAMILY = da146xx
+	$(TOP)/$(MCU_FAMILY_DIR)/SDK_10.0.8.105/sdk/bsp/include
 
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM33_NTZ/non_secure

+ 2 - 5
hw/bsp/ea4088qs/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/nxp
+DEPS_SUBMODULES += hw/mcu/nxp
 
 CFLAGS += \
   -flto \
@@ -22,6 +22,7 @@ MCU_DIR = hw/mcu/nxp/lpcopen/lpc40xx/lpc_chip_40xx
 LD_FILE = hw/bsp/$(BOARD)/lpc4088.ld
 
 SRC_C += \
+	src/portable/nxp/lpc17_40/dcd_lpc17_40.c \
 	$(MCU_DIR)/../gcc/cr_startup_lpc40xx.c \
 	$(MCU_DIR)/src/chip_17xx_40xx.c \
 	$(MCU_DIR)/src/clock_17xx_40xx.c \
@@ -35,10 +36,6 @@ SRC_C += \
 INC += \
 	$(TOP)/$(MCU_DIR)/inc
 
-# For TinyUSB port source
-VENDOR = nxp
-CHIP_FAMILY = lpc17_40
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM4F
 

+ 2 - 5
hw/bsp/ea4357/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/nxp
+DEPS_SUBMODULES += hw/mcu/nxp
 
 CFLAGS += \
   -flto \
@@ -21,6 +21,7 @@ MCU_DIR = hw/mcu/nxp/lpcopen/lpc43xx/lpc_chip_43xx
 LD_FILE = hw/bsp/$(BOARD)/lpc4357.ld
 
 SRC_C += \
+	src/portable/nxp/transdimension/dcd_transdimension.c \
 	$(MCU_DIR)/../gcc/cr_startup_lpc43xx.c \
 	$(MCU_DIR)/src/chip_18xx_43xx.c \
 	$(MCU_DIR)/src/clock_18xx_43xx.c \
@@ -35,10 +36,6 @@ INC += \
 	$(TOP)/$(MCU_DIR)/inc \
 	$(TOP)/$(MCU_DIR)/inc/config_43xx
 
-# For TinyUSB port source
-VENDOR = nxp
-CHIP_FAMILY = transdimension
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM4F
 

+ 36 - 0
hw/bsp/esp32s2/family.mk

@@ -0,0 +1,36 @@
+#DEPS_SUBMODULES +=
+
+.PHONY: all clean flash
+
+all:
+	idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) build
+
+build: all
+
+clean:
+	idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) clean
+
+fullclean:
+	idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) fullclean
+
+flash:
+	idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) flash
+
+bootloader-flash:
+	idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) bootloader-flash
+
+app-flash:
+	idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) app-flash
+
+erase:
+	idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) erase_flash
+
+monitor:
+	idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) $(CMAKE_DEFSYM) monitor
+
+uf2: $(BUILD)/$(PROJECT).uf2
+
+UF2_FAMILY_ID = 0xbfdd4eee
+$(BUILD)/$(PROJECT).uf2: $(BUILD)/$(PROJECT).bin
+	@echo CREATE $@
+	$(PYTHON) $(TOP)/tools/uf2/utils/uf2conv.py -f $(UF2_FAMILY_ID) -b 0x0 -c -o $@ $^

+ 2 - 4
hw/bsp/fomu/family.mk

@@ -11,15 +11,13 @@ CROSS_COMPILE = riscv-none-embed-
 # All source paths should be relative to the top level.
 LD_FILE = $(FAMILY_PATH)/fomu.ld
 
+SRC_C += src/portable/valentyusb/eptri/dcd_eptri.c
+
 SRC_S += $(FAMILY_PATH)/crt0-vexriscv.S
 
 INC += \
 	$(TOP)/$(FAMILY_PATH)/include
 
-# For TinyUSB port source
-VENDOR = valentyusb
-CHIP_FAMILY = eptri
-
 # For freeRTOS port source
 FREERTOS_PORT = RISC-V
 

+ 2 - 5
hw/bsp/frdm_kl25z/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/nxp
+DEPS_SUBMODULES += hw/mcu/nxp
 
 CFLAGS += \
   -mthumb \
@@ -16,6 +16,7 @@ MCU_DIR = hw/mcu/nxp/sdk/devices/MKL25Z4
 LD_FILE = $(MCU_DIR)/gcc/MKL25Z128xxx4_flash.ld
 
 SRC_C += \
+	src/portable/nxp/khci/dcd_khci.c \
 	$(MCU_DIR)/system_MKL25Z4.c \
 	$(MCU_DIR)/project_template/clock_config.c \
 	$(MCU_DIR)/drivers/fsl_clock.c \
@@ -31,10 +32,6 @@ INC += \
 
 SRC_S += $(MCU_DIR)/gcc/startup_MKL25Z4.S
 
-# For TinyUSB port source
-VENDOR = nxp
-CHIP_FAMILY = khci
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM0
 

+ 2 - 5
hw/bsp/imxrt/family.mk

@@ -1,5 +1,5 @@
 UF2_FAMILY_ID = 0x4fb2d5bd
-DEPS_SUBMODULES = hw/mcu/nxp
+DEPS_SUBMODULES += hw/mcu/nxp
 
 include $(TOP)/$(BOARD_PATH)/board.mk
 
@@ -27,6 +27,7 @@ LDFLAGS += \
 	-Wl,--defsym,__stack_size__=0x800 \
 
 SRC_C += \
+	src/portable/nxp/transdimension/dcd_transdimension.c \
 	$(MCU_DIR)/system_$(MCU_VARIANT).c \
 	$(MCU_DIR)/xip/fsl_flexspi_nor_boot.c \
 	$(MCU_DIR)/project_template/clock_config.c \
@@ -44,10 +45,6 @@ INC += \
 
 SRC_S += $(MCU_DIR)/gcc/startup_$(MCU_VARIANT).S
 
-# For TinyUSB port source
-VENDOR = nxp
-CHIP_FAMILY = transdimension
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM7/r0p1
 

+ 2 - 5
hw/bsp/lpc18/family.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/nxp
+DEPS_SUBMODULES += hw/mcu/nxp
 
 include $(TOP)/$(BOARD_PATH)/board.mk
 
@@ -18,6 +18,7 @@ CFLAGS += -Wno-error=unused-parameter -Wno-error=strict-prototypes
 MCU_DIR = hw/mcu/nxp/lpcopen/lpc18xx/lpc_chip_18xx
 
 SRC_C += \
+	src/portable/nxp/transdimension/dcd_transdimension.c \
 	$(MCU_DIR)/../gcc/cr_startup_lpc18xx.c \
 	$(MCU_DIR)/src/chip_18xx_43xx.c \
 	$(MCU_DIR)/src/clock_18xx_43xx.c \
@@ -30,9 +31,5 @@ INC += \
 	$(TOP)/$(MCU_DIR)/inc \
 	$(TOP)/$(MCU_DIR)/inc/config_18xx
 
-# For TinyUSB port source
-VENDOR = nxp
-CHIP_FAMILY = transdimension
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM3

+ 2 - 5
hw/bsp/lpc55/family.mk

@@ -1,5 +1,5 @@
 UF2_FAMILY_ID = 0x2abc77ec
-DEPS_SUBMODULES = lib/sct_neopixel hw/mcu/nxp
+DEPS_SUBMODULES += lib/sct_neopixel hw/mcu/nxp
 
 include $(TOP)/$(BOARD_PATH)/board.mk
 
@@ -34,6 +34,7 @@ MCU_DIR = hw/mcu/nxp/sdk/devices/$(MCU_VARIANT)
 LD_FILE ?= $(MCU_DIR)/gcc/$(MCU_CORE)_flash.ld
 
 SRC_C += \
+	src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
 	$(MCU_DIR)/system_$(MCU_CORE).c \
 	$(MCU_DIR)/drivers/fsl_clock.c \
 	$(MCU_DIR)/drivers/fsl_gpio.c \
@@ -54,9 +55,5 @@ SRC_S += $(MCU_DIR)/gcc/startup_$(MCU_CORE).S
 
 LIBS += $(TOP)/$(MCU_DIR)/gcc/libpower_hardabi.a
 
-# For TinyUSB port source
-VENDOR = nxp
-CHIP_FAMILY = lpc_ip3511
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM33_NTZ/non_secure

+ 2 - 5
hw/bsp/lpcxpresso11u37/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/nxp
+DEPS_SUBMODULES += hw/mcu/nxp
 
 CFLAGS += \
   -flto \
@@ -22,6 +22,7 @@ MCU_DIR = hw/mcu/nxp/lpcopen/lpc11uxx/lpc_chip_11uxx
 LD_FILE = hw/bsp/$(BOARD)/lpc11u37.ld
 
 SRC_C += \
+	src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
 	$(MCU_DIR)/../gcc/cr_startup_lpc11xx.c \
 	$(MCU_DIR)/src/chip_11xx.c \
 	$(MCU_DIR)/src/clock_11xx.c \
@@ -33,10 +34,6 @@ SRC_C += \
 INC += \
 	$(TOP)/$(MCU_DIR)/inc
 
-# For TinyUSB port source
-VENDOR = nxp
-CHIP_FAMILY = lpc_ip3511
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM0
 

+ 2 - 5
hw/bsp/lpcxpresso11u68/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/nxp
+DEPS_SUBMODULES += hw/mcu/nxp
 
 CFLAGS += \
   -flto \
@@ -19,6 +19,7 @@ MCU_DIR = hw/mcu/nxp/lpcopen/lpc11u6x/lpc_chip_11u6x
 LD_FILE = hw/bsp/$(BOARD)/lpc11u68.ld
 
 SRC_C += \
+	src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
 	$(MCU_DIR)/../gcc/cr_startup_lpc11u6x.c \
 	$(MCU_DIR)/src/chip_11u6x.c \
 	$(MCU_DIR)/src/clock_11u6x.c \
@@ -30,10 +31,6 @@ SRC_C += \
 INC += \
 	$(TOP)/$(MCU_DIR)/inc
 
-# For TinyUSB port source
-VENDOR = nxp
-CHIP_FAMILY = lpc_ip3511
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM0
 

+ 2 - 5
hw/bsp/lpcxpresso1347/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/nxp
+DEPS_SUBMODULES += hw/mcu/nxp
 
 CFLAGS += \
   -flto \
@@ -22,6 +22,7 @@ MCU_DIR = hw/mcu/nxp/lpcopen/lpc13xx/lpc_chip_13xx
 LD_FILE = hw/bsp/$(BOARD)/lpc1347.ld
 
 SRC_C += \
+	src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
 	$(MCU_DIR)/../gcc/cr_startup_lpc13xx.c \
 	$(MCU_DIR)/src/chip_13xx.c \
 	$(MCU_DIR)/src/clock_13xx.c \
@@ -33,10 +34,6 @@ SRC_C += \
 INC += \
 	$(TOP)/$(MCU_DIR)/inc
 
-# For TinyUSB port source
-VENDOR = nxp
-CHIP_FAMILY = lpc_ip3511
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM3
 

+ 2 - 5
hw/bsp/lpcxpresso1549/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/nxp
+DEPS_SUBMODULES += hw/mcu/nxp
 
 CFLAGS += \
   -flto \
@@ -21,6 +21,7 @@ MCU_DIR = hw/mcu/nxp/lpcopen/lpc15xx/lpc_chip_15xx
 LD_FILE = hw/bsp/$(BOARD)/lpc1549.ld
 
 SRC_C += \
+	src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
 	$(MCU_DIR)/../gcc/cr_startup_lpc15xx.c \
 	$(MCU_DIR)/src/chip_15xx.c \
 	$(MCU_DIR)/src/clock_15xx.c \
@@ -33,10 +34,6 @@ SRC_C += \
 INC += \
 	$(TOP)/$(MCU_DIR)/inc
 
-# For TinyUSB port source
-VENDOR = nxp
-CHIP_FAMILY = lpc_ip3511
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM3
 

+ 2 - 5
hw/bsp/lpcxpresso1769/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/nxp
+DEPS_SUBMODULES += hw/mcu/nxp
 
 CFLAGS += \
   -flto \
@@ -20,6 +20,7 @@ MCU_DIR = hw/mcu/nxp/lpcopen/lpc175x_6x/lpc_chip_175x_6x
 LD_FILE = hw/bsp/$(BOARD)/lpc1769.ld
 
 SRC_C += \
+	src/portable/nxp/lpc17_40/dcd_lpc17_40.c \
 	$(MCU_DIR)/../gcc/cr_startup_lpc175x_6x.c \
 	$(MCU_DIR)/src/chip_17xx_40xx.c \
 	$(MCU_DIR)/src/clock_17xx_40xx.c \
@@ -32,10 +33,6 @@ SRC_C += \
 INC += \
 	$(TOP)/$(MCU_DIR)/inc
 
-# For TinyUSB port source
-VENDOR = nxp
-CHIP_FAMILY = lpc17_40
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM3
 

+ 2 - 5
hw/bsp/lpcxpresso51u68/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/nxp
+DEPS_SUBMODULES += hw/mcu/nxp
 
 CFLAGS += \
   -flto \
@@ -19,6 +19,7 @@ MCU_DIR = hw/mcu/nxp/sdk/devices/LPC51U68
 LD_FILE = $(MCU_DIR)/gcc/LPC51U68_flash.ld
 
 SRC_C += \
+	src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
 	$(MCU_DIR)/system_LPC51U68.c \
 	$(MCU_DIR)/drivers/fsl_clock.c \
 	$(MCU_DIR)/drivers/fsl_gpio.c \
@@ -34,10 +35,6 @@ SRC_S += $(MCU_DIR)/gcc/startup_LPC51U68.S
 
 LIBS += $(TOP)/$(MCU_DIR)/gcc/libpower.a
 
-# For TinyUSB port source
-VENDOR = nxp
-CHIP_FAMILY = lpc_ip3511
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM0
 

+ 2 - 5
hw/bsp/lpcxpresso54114/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/nxp
+DEPS_SUBMODULES += hw/mcu/nxp
 
 CFLAGS += \
   -flto \
@@ -21,6 +21,7 @@ MCU_DIR = hw/mcu/nxp/sdk/devices/LPC54114
 LD_FILE = $(MCU_DIR)/gcc/LPC54114J256_cm4_flash.ld
 
 SRC_C += \
+	src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
 	$(MCU_DIR)/system_LPC54114_cm4.c \
 	$(MCU_DIR)/drivers/fsl_clock.c \
 	$(MCU_DIR)/drivers/fsl_gpio.c \
@@ -36,10 +37,6 @@ SRC_S += $(MCU_DIR)/gcc/startup_LPC54114_cm4.S
 
 LIBS += $(TOP)/$(MCU_DIR)/gcc/libpower_cm4_hardabi.a
 
-# For TinyUSB port source
-VENDOR = nxp
-CHIP_FAMILY = lpc_ip3511
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM4F
 

+ 2 - 5
hw/bsp/mbed1768/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/nxp
+DEPS_SUBMODULES += hw/mcu/nxp
 
 CFLAGS += \
   -flto \
@@ -20,6 +20,7 @@ MCU_DIR = hw/mcu/nxp/lpcopen/lpc175x_6x/lpc_chip_175x_6x
 LD_FILE = hw/bsp/$(BOARD)/lpc1768.ld
 
 SRC_C += \
+	src/portable/nxp/lpc17_40/dcd_lpc17_40.c \
 	$(MCU_DIR)/../gcc/cr_startup_lpc175x_6x.c \
 	$(MCU_DIR)/src/chip_17xx_40xx.c \
 	$(MCU_DIR)/src/clock_17xx_40xx.c \
@@ -32,10 +33,6 @@ SRC_C += \
 INC += \
 	$(TOP)/$(MCU_DIR)/inc
 
-# For TinyUSB port source
-VENDOR = nxp
-CHIP_FAMILY = lpc17_40
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM3
 

+ 3 - 9
hw/bsp/msp430/family.mk

@@ -1,5 +1,5 @@
 CROSS_COMPILE = msp430-elf-
-DEPS_SUBMODULES = hw/mcu/ti
+DEPS_SUBMODULES += hw/mcu/ti
 SKIP_NANOLIB = 1
 
 CFLAGS += \
@@ -8,23 +8,17 @@ CFLAGS += \
 	-DCFG_EXAMPLE_MSC_READONLY \
 	-DCFG_TUD_ENDPOINT0_SIZE=8
 
-#-mmcu=msp430f5529
-
-
-
 # All source paths should be relative to the top level.
 LD_FILE = hw/mcu/ti/msp430/msp430-gcc-support-files/include/msp430f5529.ld
 LDINC += $(TOP)/hw/mcu/ti/msp430/msp430-gcc-support-files/include
 LDFLAGS += $(addprefix -L,$(LDINC))
 
+SRC_C += src/portable/ti/msp430x5xx/dcd_msp430x5xx.c
+
 INC += \
 	$(TOP)/hw/mcu/ti/msp430/msp430-gcc-support-files/include \
 	$(TOP)/$(BOARD_PATH)
 
-# For TinyUSB port source
-VENDOR = ti
-CHIP_FAMILY = msp430x5xx
-
 # export for libmsp430.so to same installation
 ifneq ($(OS),Windows_NT)
 export LD_LIBRARY_PATH=$(dir $(shell which MSP430Flasher))

+ 2 - 5
hw/bsp/ngx4330/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/nxp
+DEPS_SUBMODULES += hw/mcu/nxp
 
 CFLAGS += \
   -flto \
@@ -21,6 +21,7 @@ MCU_DIR = hw/mcu/nxp/lpcopen/lpc43xx/lpc_chip_43xx
 LD_FILE = hw/bsp/$(BOARD)/ngx4330.ld
 
 SRC_C += \
+	src/portable/nxp/transdimension/dcd_transdimension.c \
 	$(MCU_DIR)/../gcc/cr_startup_lpc43xx.c \
 	$(MCU_DIR)/src/chip_18xx_43xx.c \
 	$(MCU_DIR)/src/clock_18xx_43xx.c \
@@ -33,10 +34,6 @@ INC += \
 	$(TOP)/$(MCU_DIR)/inc \
 	$(TOP)/$(MCU_DIR)/inc/config_43xx
 
-# For TinyUSB port source
-VENDOR = nxp
-CHIP_FAMILY = transdimension
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM4F
 

+ 2 - 5
hw/bsp/nrf/family.mk

@@ -1,5 +1,5 @@
 UF2_FAMILY_ID = 0xADA52840
-DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/nordic/nrfx
+DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/nordic/nrfx
 
 include $(TOP)/$(BOARD_PATH)/board.mk
 
@@ -34,6 +34,7 @@ LD_FILE ?= hw/bsp/nrf/boards/$(BOARD)/nrf52840_s140_v6.ld
 LDFLAGS += -L$(TOP)/hw/mcu/nordic/nrfx/mdk
 
 SRC_C += \
+  src/portable/nordic/nrf5x/dcd_nrf5x.c \
   hw/mcu/nordic/nrfx/drivers/src/nrfx_power.c \
   hw/mcu/nordic/nrfx/drivers/src/nrfx_uarte.c \
   hw/mcu/nordic/nrfx/mdk/system_$(MCU_VARIANT).c
@@ -52,10 +53,6 @@ SRC_S += hw/mcu/nordic/nrfx/mdk/gcc_startup_$(MCU_VARIANT).S
 
 ASFLAGS += -D__HEAP_SIZE=0
 
-# For TinyUSB port source
-VENDOR = nordic
-CHIP_FAMILY = nrf5x
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM4F
 

+ 2 - 5
hw/bsp/nutiny_nuc121s/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/nuvoton
+DEPS_SUBMODULES += hw/mcu/nuvoton
 
 CFLAGS += \
   -flto \
@@ -14,6 +14,7 @@ CFLAGS += \
 LD_FILE = hw/bsp/$(BOARD)/nuc121_flash.ld
 
 SRC_C += \
+  src/portable/nuvoton/nuc121/dcd_nuc121.c \
   hw/mcu/nuvoton/nuc121_125/Device/Nuvoton/NUC121/Source/system_NUC121.c \
   hw/mcu/nuvoton/nuc121_125/StdDriver/src/adc.c \
   hw/mcu/nuvoton/nuc121_125/StdDriver/src/bpwm.c \
@@ -42,10 +43,6 @@ INC += \
   $(TOP)/hw/mcu/nuvoton/nuc121_125/StdDriver/inc \
   $(TOP)/hw/mcu/nuvoton/nuc121_125/CMSIS/Include
 
-# For TinyUSB port source
-VENDOR = nuvoton
-CHIP_FAMILY = nuc121
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM0
 

+ 3 - 6
hw/bsp/nutiny_nuc125s/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/nuvoton
+DEPS_SUBMODULES += hw/mcu/nuvoton
 
 CFLAGS += \
   -flto \
@@ -14,9 +14,10 @@ CFLAGS += \
 LD_FILE = hw/bsp/$(BOARD)/nuc125_flash.ld
 
 SRC_C += \
+  src/portable/nuvoton/nuc121/dcd_nuc121.c \
   hw/mcu/nuvoton/nuc121_125/Device/Nuvoton/NUC121/Source/system_NUC121.c \
   hw/mcu/nuvoton/nuc121_125/StdDriver/src/clk.c \
-    hw/mcu/nuvoton/nuc121_125/StdDriver/src/gpio.c
+  hw/mcu/nuvoton/nuc121_125/StdDriver/src/gpio.c
 
 SRC_S += \
   hw/mcu/nuvoton/nuc121_125/Device/Nuvoton/NUC121/Source/GCC/startup_NUC121.S
@@ -26,10 +27,6 @@ INC += \
   $(TOP)/hw/mcu/nuvoton/nuc121_125/StdDriver/inc \
   $(TOP)/hw/mcu/nuvoton/nuc121_125/CMSIS/Include
 
-# For TinyUSB port source
-VENDOR = nuvoton
-CHIP_FAMILY = nuc121
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM0
 

+ 2 - 5
hw/bsp/nutiny_nuc126v/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/nuvoton
+DEPS_SUBMODULES += hw/mcu/nuvoton
 
 CFLAGS += \
   -flto \
@@ -14,6 +14,7 @@ CFLAGS += \
 LD_FILE = hw/bsp/$(BOARD)/nuc126_flash.ld
 
 SRC_C += \
+  src/portable/nuvoton/nuc121/dcd_nuc121.c \
   hw/mcu/nuvoton/nuc126/Device/Nuvoton/NUC126/Source/system_NUC126.c \
   hw/mcu/nuvoton/nuc126/StdDriver/src/acmp.c \
   hw/mcu/nuvoton/nuc126/StdDriver/src/adc.c \
@@ -46,10 +47,6 @@ INC += \
   $(TOP)/hw/mcu/nuvoton/nuc126/StdDriver/inc \
   $(TOP)/hw/mcu/nuvoton/nuc126/CMSIS/Include
 
-# For TinyUSB port source
-VENDOR = nuvoton
-CHIP_FAMILY = nuc121
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM0
 

+ 2 - 5
hw/bsp/nutiny_sdk_nuc120/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/nuvoton
+DEPS_SUBMODULES += hw/mcu/nuvoton
 
 CFLAGS += \
   -flto \
@@ -12,6 +12,7 @@ CFLAGS += \
 LD_FILE = hw/bsp/nutiny_sdk_nuc120/nuc120_flash.ld
 
 SRC_C += \
+  src/portable/nuvoton/nuc120/dcd_nuc120.c \
   hw/mcu/nuvoton/nuc100_120/Device/Nuvoton/NUC100Series/Source/system_NUC100Series.c \
   hw/mcu/nuvoton/nuc100_120/StdDriver/src/acmp.c \
   hw/mcu/nuvoton/nuc100_120/StdDriver/src/adc.c \
@@ -42,10 +43,6 @@ INC += \
   $(TOP)/hw/mcu/nuvoton/nuc100_120/StdDriver/inc \
   $(TOP)/hw/mcu/nuvoton/nuc100_120/CMSIS/Include
 
-# For TinyUSB port source
-VENDOR = nuvoton
-CHIP_FAMILY = nuc120
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM0
 

+ 2 - 5
hw/bsp/nutiny_sdk_nuc505/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/nuvoton
+DEPS_SUBMODULES += hw/mcu/nuvoton
 
 CFLAGS += \
   -flto \
@@ -13,6 +13,7 @@ CFLAGS += \
 LD_FILE = hw/bsp/$(BOARD)/nuc505_flashtoram.ld
 
 SRC_C += \
+  src/portable/nuvoton/nuc505/dcd_nuc505.c \
   hw/mcu/nuvoton/nuc505/Device/Nuvoton/NUC505Series/Source/system_NUC505Series.c \
   hw/mcu/nuvoton/nuc505/StdDriver/src/adc.c \
   hw/mcu/nuvoton/nuc505/StdDriver/src/clk.c \
@@ -37,10 +38,6 @@ INC += \
   $(TOP)/hw/mcu/nuvoton/nuc505/StdDriver/inc \
   $(TOP)/hw/mcu/nuvoton/nuc505/CMSIS/Include
 
-# For TinyUSB port source
-VENDOR = nuvoton
-CHIP_FAMILY = nuc505
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM4F
 

+ 18 - 1
hw/bsp/rp2040/family.mk

@@ -1,4 +1,21 @@
-DEPS_SUBMODULES = hw/mcu/raspberrypi/pico-sdk
+DEPS_SUBMODULES += hw/mcu/raspberrypi/pico-sdk
+
+ifeq ($(DEBUG), 1)
+CMAKE_DEFSYM += -DCMAKE_BUILD_TYPE=Debug
+endif
+
+$(BUILD):
+	cmake -S . -B $(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) -DPICO_BUILD_DOCS=0 $(CMAKE_DEFSYM)
+
+all: $(BUILD)
+	$(MAKE) -C $(BUILD)
+
+clean:
+	$(RM) -rf $(BUILD)
+
+#flash: flash-pyocd
+flash:
+	@$(CP) $(BUILD)/$(PROJECT).uf2 /media/$(USER)/RPI-RP2
 
 JLINK_DEVICE = rp2040_m0_0
 PYOCD_TARGET = rp2040

+ 2 - 5
hw/bsp/samd11/family.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/microchip
+DEPS_SUBMODULES += hw/mcu/microchip
 
 include $(TOP)/$(BOARD_PATH)/board.mk
 
@@ -12,6 +12,7 @@ CFLAGS += \
   -DCFG_TUSB_MCU=OPT_MCU_SAMD11
 
 SRC_C += \
+	src/portable/microchip/samd/dcd_samd.c \
 	hw/mcu/microchip/samd11/gcc/gcc/startup_samd11.c \
 	hw/mcu/microchip/samd11/gcc/system_samd11.c \
 	hw/mcu/microchip/samd11/hpl/gclk/hpl_gclk.c \
@@ -32,9 +33,5 @@ INC += \
 	$(TOP)/hw/mcu/microchip/samd11/CMSIS/Include \
 	$(TOP)/hw/mcu/microchip/samd11/CMSIS/Core/Include
 
-# For TinyUSB port source
-VENDOR = microchip
-CHIP_FAMILY = samd
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM0

+ 2 - 5
hw/bsp/samd21/family.mk

@@ -1,5 +1,5 @@
 UF2_FAMILY_ID = 0x68ed2b88
-DEPS_SUBMODULES = hw/mcu/microchip
+DEPS_SUBMODULES += hw/mcu/microchip
 
 include $(TOP)/$(BOARD_PATH)/board.mk
 
@@ -13,6 +13,7 @@ CFLAGS += \
   -DCFG_TUSB_MCU=OPT_MCU_SAMD21
 
 SRC_C += \
+	src/portable/microchip/samd/dcd_samd.c \
 	hw/mcu/microchip/samd21/gcc/gcc/startup_samd21.c \
 	hw/mcu/microchip/samd21/gcc/system_samd21.c \
 	hw/mcu/microchip/samd21/hpl/gclk/hpl_gclk.c \
@@ -32,10 +33,6 @@ INC += \
 	$(TOP)/hw/mcu/microchip/samd21/hri \
 	$(TOP)/hw/mcu/microchip/samd21/CMSIS/Include
 
-# For TinyUSB port source 
-VENDOR = microchip
-CHIP_FAMILY = samd
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM0
 

+ 2 - 5
hw/bsp/samd51/family.mk

@@ -1,5 +1,5 @@
 UF2_FAMILY_ID = 0x55114460
-DEPS_SUBMODULES = hw/mcu/microchip
+DEPS_SUBMODULES += hw/mcu/microchip
 
 include $(TOP)/$(BOARD_PATH)/board.mk
 
@@ -16,6 +16,7 @@ CFLAGS += \
 CFLAGS += -Wno-error=undef
 
 SRC_C += \
+	src/portable/microchip/samd/dcd_samd.c \
 	hw/mcu/microchip/samd51/gcc/gcc/startup_samd51.c \
 	hw/mcu/microchip/samd51/gcc/system_samd51.c \
 	hw/mcu/microchip/samd51/hpl/gclk/hpl_gclk.c \
@@ -35,10 +36,6 @@ INC += \
 	$(TOP)/hw/mcu/microchip/samd51/hri \
 	$(TOP)/hw/mcu/microchip/samd51/CMSIS/Include
 
-# For TinyUSB port source
-VENDOR = microchip
-CHIP_FAMILY = samd
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM4F
 

+ 3 - 9
hw/bsp/same54xplainedpro/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/microchip
+DEPS_SUBMODULES += hw/mcu/microchip
 
 CONF_CPU_FREQUENCY ?= 120000000
 
@@ -12,9 +12,7 @@ CFLAGS += \
   -nostdlib -nostartfiles \
   -D__SAME54P20A__ \
   -DCONF_CPU_FREQUENCY=$(CONF_CPU_FREQUENCY) \
-  -DCFG_TUSB_MCU=OPT_MCU_SAME5X \
-
-
+  -DCFG_TUSB_MCU=OPT_MCU_SAME5X
 
 #  -DSVC_Handler=SVCall_Handler
 
@@ -22,6 +20,7 @@ CFLAGS += \
 LD_FILE = hw/bsp/$(BOARD)/same54p20a_flash.ld
 
 SRC_C += \
+  src/portable/microchip/samd/dcd_samd.c \
   hw/mcu/microchip/same54/gcc/gcc/startup_same54.c \
   hw/mcu/microchip/same54/gcc/system_same54.c \
   hw/mcu/microchip/same54/hal/utils/src/utils_syscalls.c
@@ -36,14 +35,9 @@ INC += \
 	$(TOP)/hw/mcu/microchip/same54/hri \
 	$(TOP)/hw/mcu/microchip/same54/CMSIS/Include
 
-# For TinyUSB port source
-VENDOR = microchip
-CHIP_FAMILY = samd
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM4F
 
-
 # For flash-jlink target
 JLINK_DEVICE = ATSAME54P20
 

+ 2 - 1
hw/bsp/same70_xplained/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/microchip
+DEPS_SUBMODULES += hw/mcu/microchip
 
 CFLAGS += \
   -mthumb \
@@ -19,6 +19,7 @@ ASF_DIR = hw/mcu/microchip/same70
 LD_FILE = $(ASF_DIR)/same70b/gcc/gcc/same70q21b_flash.ld
 
 SRC_C += \
+	src/portable/template/dcd_template.c \
 	$(ASF_DIR)/same70b/gcc/gcc/startup_same70q21b.c \
 	$(ASF_DIR)/same70b/gcc/system_same70q21b.c \
 	$(ASF_DIR)/hpl/core/hpl_init.c \

+ 2 - 5
hw/bsp/samg55xplained/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/microchip
+DEPS_SUBMODULES += hw/mcu/microchip
 
 CFLAGS += \
   -flto \
@@ -20,6 +20,7 @@ ASF_DIR = hw/mcu/microchip/samg55
 LD_FILE = hw/bsp/$(BOARD)/samg55j19_flash.ld
 
 SRC_C += \
+	src/portable/microchip/samg/dcd_samg.c \
 	$(ASF_DIR)/samg55/gcc/gcc/startup_samg55.c \
 	$(ASF_DIR)/samg55/gcc/system_samg55.c \
 	$(ASF_DIR)/hpl/core/hpl_init.c \
@@ -40,10 +41,6 @@ INC += \
 	$(TOP)/$(ASF_DIR)/hri \
 	$(TOP)/$(ASF_DIR)/CMSIS/Core/Include
 
-# For TinyUSB port source
-VENDOR = microchip
-CHIP_FAMILY = samg
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM4F
 

+ 4 - 6
hw/bsp/spresense/board.mk

@@ -1,4 +1,4 @@
-DEPS_SUBMODULES = hw/mcu/sony/cxd56/spresense-exported-sdk
+DEPS_SUBMODULES += hw/mcu/sony/cxd56/spresense-exported-sdk
 
 # Platforms are: Linux, Darwin, MSYS, CYGWIN
 PLATFORM := $(firstword $(subst _, ,$(shell uname -s 2>/dev/null)))
@@ -39,6 +39,8 @@ CFLAGS += -Wno-error=shadow
 
 SPRESENSE_SDK = $(TOP)/hw/mcu/sony/cxd56/spresense-exported-sdk
 
+SRC_C += src/portable/sony/cxd56/dcd_cxd56.c
+
 INC += \
 	$(SPRESENSE_SDK)/nuttx/include \
 	$(SPRESENSE_SDK)/nuttx/arch \
@@ -57,11 +59,7 @@ LDFLAGS += \
 	-nostartfiles \
 	-nodefaultlibs \
 	-Wl,--gc-sections \
-	-u spresense_main \
-
-# For TinyUSB port source
-VENDOR = sony
-CHIP_FAMILY = cxd56
+	-u spresense_main
 
 $(MKSPK): $(BUILD)/$(PROJECT).elf
 	$(MAKE) -C $(TOP)/hw/mcu/sony/cxd56/mkspk

+ 2 - 5
hw/bsp/stm32f070rbnucleo/board.mk

@@ -1,5 +1,5 @@
 ST_FAMILY = f0
-DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
+DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
 
 ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
 ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
@@ -23,6 +23,7 @@ CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align
 LD_FILE = hw/bsp/$(BOARD)/stm32F070rbtx_flash.ld
 
 SRC_C += \
+  src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c \
   $(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
   $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
   $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
@@ -40,10 +41,6 @@ INC += \
   $(TOP)/$(ST_HAL_DRIVER)/Inc \
   $(TOP)/hw/bsp/$(BOARD)
 
-# For TinyUSB port source
-VENDOR = st
-CHIP_FAMILY = stm32_fsdev
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM0
 

+ 2 - 5
hw/bsp/stm32f072disco/board.mk

@@ -1,5 +1,5 @@
 ST_FAMILY = f0
-DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
+DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
 
 ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
 ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
@@ -22,6 +22,7 @@ CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align
 LD_FILE = hw/bsp/$(BOARD)/STM32F072RBTx_FLASH.ld
 
 SRC_C += \
+  src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c \
   $(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
   $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
   $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
@@ -39,10 +40,6 @@ INC += \
   $(TOP)/$(ST_HAL_DRIVER)/Inc \
   $(TOP)/hw/bsp/$(BOARD)
 
-# For TinyUSB port source
-VENDOR = st
-CHIP_FAMILY = stm32_fsdev
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM0
 

+ 2 - 5
hw/bsp/stm32f103bluepill/board.mk

@@ -1,5 +1,5 @@
 ST_FAMILY = f1
-DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
+DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
 
 ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
 ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
@@ -21,6 +21,7 @@ CFLAGS += \
 LD_FILE = hw/bsp/$(BOARD)/STM32F103XB_FLASH.ld
 
 SRC_C += \
+  src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c \
   $(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
   $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
   $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
@@ -37,10 +38,6 @@ INC += \
   $(TOP)/$(ST_HAL_DRIVER)/Inc \
   $(TOP)/hw/bsp/$(BOARD)
 
-# For TinyUSB port source
-VENDOR = st
-CHIP_FAMILY = stm32_fsdev
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM3
 

+ 2 - 5
hw/bsp/stm32f207nucleo/board.mk

@@ -1,5 +1,5 @@
 ST_FAMILY = f2
-DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
+DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
 
 ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
 ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
@@ -21,6 +21,7 @@ CFLAGS += -Wno-error=sign-compare
 LD_FILE = hw/bsp/$(BOARD)/STM32F207ZGTx_FLASH.ld
 
 SRC_C += \
+  src/portable/st/synopsys/dcd_synopsys.c \
   $(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
   $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
   $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
@@ -37,10 +38,6 @@ INC += \
   $(TOP)/$(ST_HAL_DRIVER)/Inc \
   $(TOP)/hw/bsp/$(BOARD)
 
-# For TinyUSB port source
-VENDOR = st
-CHIP_FAMILY = synopsys
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM3
 

+ 2 - 5
hw/bsp/stm32f303disco/board.mk

@@ -1,5 +1,5 @@
 ST_FAMILY = f3
-DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
+DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
 
 ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
 ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
@@ -22,6 +22,7 @@ CFLAGS += -Wno-error=unused-parameter
 LD_FILE = hw/bsp/$(BOARD)/STM32F303VCTx_FLASH.ld
 
 SRC_C += \
+  src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c \
   $(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
   $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
   $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
@@ -38,10 +39,6 @@ INC += \
   $(TOP)/$(ST_HAL_DRIVER)/Inc \
   $(TOP)/hw/bsp/$(BOARD)
 
-# For TinyUSB port source
-VENDOR = st
-CHIP_FAMILY = stm32_fsdev
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM4F
 

+ 2 - 5
hw/bsp/stm32f4/family.mk

@@ -1,6 +1,6 @@
 UF2_FAMILY_ID = 0x57755a57
 ST_FAMILY = f4
-DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
+DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
 
 ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
 ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
@@ -21,6 +21,7 @@ CFLAGS += \
 CFLAGS += -Wno-error=cast-align
 
 SRC_C += \
+	src/portable/st/synopsys/dcd_synopsys.c \
 	$(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
 	$(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
 	$(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
@@ -35,10 +36,6 @@ INC += \
 	$(TOP)/$(ST_CMSIS)/Include \
 	$(TOP)/$(ST_HAL_DRIVER)/Inc
 
-# For TinyUSB port source
-VENDOR = st
-CHIP_FAMILY = synopsys
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM4F
 

+ 2 - 5
hw/bsp/stm32f7/family.mk

@@ -1,6 +1,6 @@
 UF2_FAMILY_ID = 0x53b80f00
 ST_FAMILY = f7
-DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
+DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
 
 ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
 ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
@@ -34,6 +34,7 @@ endif
 CFLAGS += -Wno-error=shadow -Wno-error=cast-align
 
 SRC_C += \
+	src/portable/st/synopsys/dcd_synopsys.c \
 	$(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
 	$(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
 	$(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
@@ -49,9 +50,5 @@ INC += \
 	$(TOP)/$(ST_CMSIS)/Include \
 	$(TOP)/$(ST_HAL_DRIVER)/Inc
 
-# For TinyUSB port source
-VENDOR = st
-CHIP_FAMILY = synopsys
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM7/r0p1

+ 2 - 5
hw/bsp/stm32h7/family.mk

@@ -1,6 +1,6 @@
 UF2_FAMILY_ID = 0x6db66082
 ST_FAMILY = h7
-DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
+DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
 
 ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
 ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
@@ -30,6 +30,7 @@ CFLAGS += -Wno-error=maybe-uninitialized -Wno-error=cast-align
 
 # All source paths should be relative to the top level.
 SRC_C += \
+	src/portable/st/synopsys/dcd_synopsys.c \
 	$(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
 	$(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
 	$(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
@@ -45,10 +46,6 @@ INC += \
 	$(TOP)/$(ST_CMSIS)/Include \
 	$(TOP)/$(ST_HAL_DRIVER)/Inc
 
-# For TinyUSB port source
-VENDOR = st
-CHIP_FAMILY = synopsys
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM7/r0p1
 

+ 2 - 5
hw/bsp/stm32l0538disco/board.mk

@@ -1,5 +1,5 @@
 ST_FAMILY = l0
-DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
+DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
 
 ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
 ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
@@ -22,6 +22,7 @@ CFLAGS += -Wno-error=unused-parameter -Wno-error=maybe-uninitialized
 LD_FILE = hw/bsp/$(BOARD)/STM32L053C8Tx_FLASH.ld
 
 SRC_C += \
+  src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c \
   $(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
   $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
   $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
@@ -38,10 +39,6 @@ INC += \
   $(TOP)/$(ST_HAL_DRIVER)/Inc \
   $(TOP)/hw/bsp/$(BOARD)
 
-# For TinyUSB port source
-VENDOR = st
-CHIP_FAMILY = stm32_fsdev
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM0
 

+ 2 - 5
hw/bsp/stm32l476disco/board.mk

@@ -1,5 +1,5 @@
 ST_FAMILY = l4
-DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
+DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
 
 ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
 ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
@@ -22,6 +22,7 @@ CFLAGS += -Wno-error=maybe-uninitialized -Wno-error=cast-align
 LD_FILE = hw/bsp/$(BOARD)/STM32L476VGTx_FLASH.ld
 
 SRC_C += \
+	src/portable/st/synopsys/dcd_synopsys.c \
 	$(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
 	$(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
 	$(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
@@ -41,10 +42,6 @@ INC += \
 	$(TOP)/$(ST_HAL_DRIVER)/Inc \
 	$(TOP)/hw/bsp/$(BOARD)
 
-# For TinyUSB port source
-VENDOR = st
-CHIP_FAMILY = synopsys
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM4F
 

+ 2 - 5
hw/bsp/stm32l4r5nucleo/board.mk

@@ -1,5 +1,5 @@
 ST_FAMILY = l4
-DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
+DEPS_SUBMODULES += lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
 
 ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY)
 ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver
@@ -23,6 +23,7 @@ CFLAGS += -Wno-error=maybe-uninitialized -Wno-error=cast-align
 LD_FILE = hw/bsp/$(BOARD)/STM32L4RXxI_FLASH.ld
 
 SRC_C += \
+	src/portable/st/synopsys/dcd_synopsys.c \
 	$(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \
 	$(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \
 	$(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \
@@ -42,10 +43,6 @@ INC += \
 	$(TOP)/$(ST_HAL_DRIVER)/Inc \
 	$(TOP)/hw/bsp/$(BOARD)
 
-# For TinyUSB port source
-VENDOR = st
-CHIP_FAMILY = synopsys
-
 # For freeRTOS port source
 FREERTOS_PORT = ARM_CM4F