summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2022-08-21 13:16:49 +0800
committersakumisu <[email protected]>2022-08-21 13:16:49 +0800
commit09e0f0239dd8342c326b17b466b2dbc0052104b0 (patch)
tree09829641b599af1e1e7362af2f74ee80ca987322
parent7391b7a5b914d26e24e652dbe94944cfc6a03d6b (diff)
update usb config
-rw-r--r--cherryusb_config_template.h (renamed from usb_config.h)33
-rw-r--r--demo/es32/usb_device/ES32F369x/Inc/usb_config.h58
-rw-r--r--demo/es32/usb_host/ES32F369x/Inc/usb_config.h68
-rw-r--r--demo/hpm/usb_device/src/usb_config.h56
-rw-r--r--demo/hpm/usb_host/src/usb_config.h48
-rw-r--r--demo/stm32/usb_device/stm32f103c8t6/Core/Inc/usb_config.h58
-rw-r--r--demo/stm32/usb_device/stm32f429igt6/Core/Inc/usb_config.h58
-rw-r--r--demo/stm32/usb_device/stm32h743vbt6/Core/Inc/usb_config.h58
8 files changed, 257 insertions, 180 deletions
diff --git a/usb_config.h b/cherryusb_config_template.h
index 074ba319..e01b709d 100644
--- a/usb_config.h
+++ b/cherryusb_config_template.h
@@ -6,7 +6,8 @@
#ifndef CHERRYUSB_CONFIG_H
#define CHERRYUSB_CONFIG_H
-/* USB common Configuration */
+/* ================ USB common Configuration ================ */
+
#ifndef CONFIG_USB_DBG_LEVEL
#define CONFIG_USB_DBG_LEVEL USB_DBG_INFO
#endif
@@ -15,23 +16,34 @@
#define CONFIG_USB_PRINTF printf
#endif
-//#define USB_NOCACHE_RAM_SECTION __attribute__((section(".noncacheable")))
+/* attribute data into no cache ram */
+// #define USB_NOCACHE_RAM_SECTION __attribute__((section(".noncacheable")))
+/* Enable print with color */
#define CONFIG_USB_PRINTF_COLOR_ENABLE
-/* USB DEVICE Configuration */
+/* ================ USB DEVICE Configuration ================*/
+
/* core */
-#ifndef CONFIG_USBDEV_REQUEST_BUFFER_LEN
-#define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256
-#endif
+/* Ep0 max transfer buffer, specially for receiving data from ep0 out */
+#define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256
+/* Setup packet log for debug */
// #define CONFIG_USBDEV_SETUP_LOG_PRINT
+/* Check if the input descriptor is correct */
// #define CONFIG_USBDEV_DESC_CHECK
+/* Enable test mode */
// #define CONFIG_USBDEV_TEST_MODE
/* cdc class */
+
// #define CONFIG_USBDEV_CDC_ACM_UART
/* msc class */
+
+#ifndef CONFIG_USBDEV_MSC_BLOCK_SIZE
+#define CONFIG_USBDEV_MSC_BLOCK_SIZE 512
+#endif
+
#ifndef CONFIG_USBDEV_MSC_MANUFACTURER_STRING
#define CONFIG_USBDEV_MSC_MANUFACTURER_STRING ""
#endif
@@ -57,15 +69,17 @@
#endif
/* audio class */
+
#ifndef CONFIG_USBDEV_AUDIO_VERSION
#define CONFIG_USBDEV_AUDIO_VERSION 0x0100
#endif
#ifndef CONFIG_USBDEV_AUDIO_MAX_CHANNEL
-#define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 2
+#define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 8
#endif
-/* USB HOST Configuration */
+/* ================ USB HOST Configuration ================ */
+
#ifndef CONFIG_USBHOST_RHPORTS
#define CONFIG_USBHOST_RHPORTS 1
#endif
@@ -108,7 +122,8 @@
#define CONFIG_USBHOST_ASYNCH
//#define CONFIG_USBHOST_GET_STRING_DESC
-/* EHCI Configuration */
+/* ================ EHCI Configuration ================ */
+
#define CONFIG_USB_EHCI_HCCR_BASE (0x20072000)
#define CONFIG_USB_EHCI_HCOR_BASE (0x20072000 + 0x10)
#define CONFIG_USB_EHCI_QH_NUM (10)
diff --git a/demo/es32/usb_device/ES32F369x/Inc/usb_config.h b/demo/es32/usb_device/ES32F369x/Inc/usb_config.h
index 8c57c91b..e01b709d 100644
--- a/demo/es32/usb_device/ES32F369x/Inc/usb_config.h
+++ b/demo/es32/usb_device/ES32F369x/Inc/usb_config.h
@@ -1,7 +1,13 @@
-#ifndef _USB_CONFIG_H
-#define _USB_CONFIG_H
+/*
+ * Copyright (c) 2022, sakumisu
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+#ifndef CHERRYUSB_CONFIG_H
+#define CHERRYUSB_CONFIG_H
+
+/* ================ USB common Configuration ================ */
-/* USB common Configuration */
#ifndef CONFIG_USB_DBG_LEVEL
#define CONFIG_USB_DBG_LEVEL USB_DBG_INFO
#endif
@@ -10,22 +16,34 @@
#define CONFIG_USB_PRINTF printf
#endif
+/* attribute data into no cache ram */
+// #define USB_NOCACHE_RAM_SECTION __attribute__((section(".noncacheable")))
+/* Enable print with color */
#define CONFIG_USB_PRINTF_COLOR_ENABLE
-/* USB DEVICE Configuration */
+/* ================ USB DEVICE Configuration ================*/
+
/* core */
-#ifndef CONFIG_USBDEV_REQUEST_BUFFER_LEN
-#define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256
-#endif
+/* Ep0 max transfer buffer, specially for receiving data from ep0 out */
+#define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256
+/* Setup packet log for debug */
// #define CONFIG_USBDEV_SETUP_LOG_PRINT
+/* Check if the input descriptor is correct */
// #define CONFIG_USBDEV_DESC_CHECK
+/* Enable test mode */
// #define CONFIG_USBDEV_TEST_MODE
/* cdc class */
+
// #define CONFIG_USBDEV_CDC_ACM_UART
/* msc class */
+
+#ifndef CONFIG_USBDEV_MSC_BLOCK_SIZE
+#define CONFIG_USBDEV_MSC_BLOCK_SIZE 512
+#endif
+
#ifndef CONFIG_USBDEV_MSC_MANUFACTURER_STRING
#define CONFIG_USBDEV_MSC_MANUFACTURER_STRING ""
#endif
@@ -51,15 +69,17 @@
#endif
/* audio class */
+
#ifndef CONFIG_USBDEV_AUDIO_VERSION
#define CONFIG_USBDEV_AUDIO_VERSION 0x0100
#endif
#ifndef CONFIG_USBDEV_AUDIO_MAX_CHANNEL
-#define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 2
+#define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 8
#endif
-/* USB HOST Configuration */
+/* ================ USB HOST Configuration ================ */
+
#ifndef CONFIG_USBHOST_RHPORTS
#define CONFIG_USBHOST_RHPORTS 1
#endif
@@ -88,20 +108,6 @@
#define CONFIG_USBHOST_MSC_TIMEOUT 5000
#endif
-#ifndef CONFIG_USBHOST_HPWORKQ_PRIO
-#define CONFIG_USBHOST_HPWORKQ_PRIO 5
-#endif
-#ifndef CONFIG_USBHOST_HPWORKQ_STACKSIZE
-#define CONFIG_USBHOST_HPWORKQ_STACKSIZE 2048
-#endif
-
-#ifndef CONFIG_USBHOST_LPWORKQ_PRIO
-#define CONFIG_USBHOST_LPWORKQ_PRIO 1
-#endif
-#ifndef CONFIG_USBHOST_LPWORKQ_STACKSIZE
-#define CONFIG_USBHOST_LPWORKQ_STACKSIZE 2048
-#endif
-
#ifndef CONFIG_USBHOST_PSC_PRIO
#define CONFIG_USBHOST_PSC_PRIO 4
#endif
@@ -116,13 +122,15 @@
#define CONFIG_USBHOST_ASYNCH
//#define CONFIG_USBHOST_GET_STRING_DESC
-/* EHCI Configuration */
+/* ================ EHCI Configuration ================ */
+
#define CONFIG_USB_EHCI_HCCR_BASE (0x20072000)
#define CONFIG_USB_EHCI_HCOR_BASE (0x20072000 + 0x10)
#define CONFIG_USB_EHCI_QH_NUM (10)
#define CONFIG_USB_EHCI_QTD_NUM (10)
// #define CONFIG_USB_EHCI_INFO_ENABLE
-#define CONFIG_USB_ECHI_HCOR_RESERVED_DISABLE
+// #define CONFIG_USB_ECHI_HCOR_RESERVED_DISABLE
// #define CONFIG_USB_EHCI_CONFIGFLAG
+// #define CONFIG_USB_EHCI_PORT_POWER
#endif
diff --git a/demo/es32/usb_host/ES32F369x/Inc/usb_config.h b/demo/es32/usb_host/ES32F369x/Inc/usb_config.h
index 39c77df6..e01b709d 100644
--- a/demo/es32/usb_host/ES32F369x/Inc/usb_config.h
+++ b/demo/es32/usb_host/ES32F369x/Inc/usb_config.h
@@ -1,7 +1,13 @@
-#ifndef _USB_CONFIG_H
-#define _USB_CONFIG_H
+/*
+ * Copyright (c) 2022, sakumisu
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+#ifndef CHERRYUSB_CONFIG_H
+#define CHERRYUSB_CONFIG_H
+
+/* ================ USB common Configuration ================ */
-/* USB common Configuration */
#ifndef CONFIG_USB_DBG_LEVEL
#define CONFIG_USB_DBG_LEVEL USB_DBG_INFO
#endif
@@ -10,26 +16,34 @@
#define CONFIG_USB_PRINTF printf
#endif
+/* attribute data into no cache ram */
+// #define USB_NOCACHE_RAM_SECTION __attribute__((section(".noncacheable")))
+/* Enable print with color */
#define CONFIG_USB_PRINTF_COLOR_ENABLE
-/* USB DEVICE Configuration */
-/* core */
-#ifndef CONFIG_USBDEV_REQUEST_BUFFER_LEN
-#define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256
-#endif
+/* ================ USB DEVICE Configuration ================*/
-#ifndef CONFIG_USBDEV_DESC_CHECK
-#define CONFIG_USBDEV_DESC_CHECK 0
-#endif
+/* core */
-#ifndef CONFIG_USBDEV_TEST_MODE
-#define CONFIG_USBDEV_TEST_MODE 0
-#endif
+/* Ep0 max transfer buffer, specially for receiving data from ep0 out */
+#define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256
+/* Setup packet log for debug */
+// #define CONFIG_USBDEV_SETUP_LOG_PRINT
+/* Check if the input descriptor is correct */
+// #define CONFIG_USBDEV_DESC_CHECK
+/* Enable test mode */
+// #define CONFIG_USBDEV_TEST_MODE
/* cdc class */
+
// #define CONFIG_USBDEV_CDC_ACM_UART
/* msc class */
+
+#ifndef CONFIG_USBDEV_MSC_BLOCK_SIZE
+#define CONFIG_USBDEV_MSC_BLOCK_SIZE 512
+#endif
+
#ifndef CONFIG_USBDEV_MSC_MANUFACTURER_STRING
#define CONFIG_USBDEV_MSC_MANUFACTURER_STRING ""
#endif
@@ -55,15 +69,17 @@
#endif
/* audio class */
+
#ifndef CONFIG_USBDEV_AUDIO_VERSION
#define CONFIG_USBDEV_AUDIO_VERSION 0x0100
#endif
#ifndef CONFIG_USBDEV_AUDIO_MAX_CHANNEL
-#define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 2
+#define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 8
#endif
-/* USB HOST Configuration */
+/* ================ USB HOST Configuration ================ */
+
#ifndef CONFIG_USBHOST_RHPORTS
#define CONFIG_USBHOST_RHPORTS 1
#endif
@@ -92,20 +108,6 @@
#define CONFIG_USBHOST_MSC_TIMEOUT 5000
#endif
-#ifndef CONFIG_USBHOST_HPWORKQ_PRIO
-#define CONFIG_USBHOST_HPWORKQ_PRIO 5
-#endif
-#ifndef CONFIG_USBHOST_HPWORKQ_STACKSIZE
-#define CONFIG_USBHOST_HPWORKQ_STACKSIZE 2048
-#endif
-
-#ifndef CONFIG_USBHOST_LPWORKQ_PRIO
-#define CONFIG_USBHOST_LPWORKQ_PRIO 1
-#endif
-#ifndef CONFIG_USBHOST_LPWORKQ_STACKSIZE
-#define CONFIG_USBHOST_LPWORKQ_STACKSIZE 2048
-#endif
-
#ifndef CONFIG_USBHOST_PSC_PRIO
#define CONFIG_USBHOST_PSC_PRIO 4
#endif
@@ -120,13 +122,15 @@
#define CONFIG_USBHOST_ASYNCH
//#define CONFIG_USBHOST_GET_STRING_DESC
-/* EHCI Configuration */
+/* ================ EHCI Configuration ================ */
+
#define CONFIG_USB_EHCI_HCCR_BASE (0x20072000)
#define CONFIG_USB_EHCI_HCOR_BASE (0x20072000 + 0x10)
#define CONFIG_USB_EHCI_QH_NUM (10)
#define CONFIG_USB_EHCI_QTD_NUM (10)
// #define CONFIG_USB_EHCI_INFO_ENABLE
-#define CONFIG_USB_ECHI_HCOR_RESERVED_DISABLE
+// #define CONFIG_USB_ECHI_HCOR_RESERVED_DISABLE
// #define CONFIG_USB_EHCI_CONFIGFLAG
+// #define CONFIG_USB_EHCI_PORT_POWER
#endif
diff --git a/demo/hpm/usb_device/src/usb_config.h b/demo/hpm/usb_device/src/usb_config.h
index 796e5b0c..09c64014 100644
--- a/demo/hpm/usb_device/src/usb_config.h
+++ b/demo/hpm/usb_device/src/usb_config.h
@@ -1,7 +1,13 @@
-#ifndef _USB_CONFIG_H
-#define _USB_CONFIG_H
+/*
+ * Copyright (c) 2022, sakumisu
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+#ifndef CHERRYUSB_CONFIG_H
+#define CHERRYUSB_CONFIG_H
+
+/* ================ USB common Configuration ================ */
-/* USB common Configuration */
#ifndef CONFIG_USB_DBG_LEVEL
#define CONFIG_USB_DBG_LEVEL USB_DBG_INFO
#endif
@@ -10,23 +16,34 @@
#define CONFIG_USB_PRINTF printf
#endif
+/* attribute data into no cache ram */
+#define USB_NOCACHE_RAM_SECTION __attribute__((section(".noncacheable")))
+/* Enable print with color */
#define CONFIG_USB_PRINTF_COLOR_ENABLE
-#define USB_NOCACHE_RAM_SECTION __attribute__((section(".noncacheable")))
-/* USB DEVICE Configuration */
+/* ================ USB DEVICE Configuration ================*/
+
/* core */
-#ifndef CONFIG_USBDEV_REQUEST_BUFFER_LEN
-#define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256
-#endif
+/* Ep0 max transfer buffer, specially for receiving data from ep0 out */
+#define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256
+/* Setup packet log for debug */
// #define CONFIG_USBDEV_SETUP_LOG_PRINT
+/* Check if the input descriptor is correct */
// #define CONFIG_USBDEV_DESC_CHECK
+/* Enable test mode */
// #define CONFIG_USBDEV_TEST_MODE
/* cdc class */
+
// #define CONFIG_USBDEV_CDC_ACM_UART
/* msc class */
+
+#ifndef CONFIG_USBDEV_MSC_BLOCK_SIZE
+#define CONFIG_USBDEV_MSC_BLOCK_SIZE 512
+#endif
+
#ifndef CONFIG_USBDEV_MSC_MANUFACTURER_STRING
#define CONFIG_USBDEV_MSC_MANUFACTURER_STRING ""
#endif
@@ -52,15 +69,17 @@
#endif
/* audio class */
+
#ifndef CONFIG_USBDEV_AUDIO_VERSION
#define CONFIG_USBDEV_AUDIO_VERSION 0x0100
#endif
#ifndef CONFIG_USBDEV_AUDIO_MAX_CHANNEL
-#define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 2
+#define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 8
#endif
-/* USB HOST Configuration */
+/* ================ USB HOST Configuration ================ */
+
#ifndef CONFIG_USBHOST_RHPORTS
#define CONFIG_USBHOST_RHPORTS 1
#endif
@@ -89,20 +108,6 @@
#define CONFIG_USBHOST_MSC_TIMEOUT 5000
#endif
-#ifndef CONFIG_USBHOST_HPWORKQ_PRIO
-#define CONFIG_USBHOST_HPWORKQ_PRIO 5
-#endif
-#ifndef CONFIG_USBHOST_HPWORKQ_STACKSIZE
-#define CONFIG_USBHOST_HPWORKQ_STACKSIZE 2048
-#endif
-
-#ifndef CONFIG_USBHOST_LPWORKQ_PRIO
-#define CONFIG_USBHOST_LPWORKQ_PRIO 1
-#endif
-#ifndef CONFIG_USBHOST_LPWORKQ_STACKSIZE
-#define CONFIG_USBHOST_LPWORKQ_STACKSIZE 2048
-#endif
-
#ifndef CONFIG_USBHOST_PSC_PRIO
#define CONFIG_USBHOST_PSC_PRIO 4
#endif
@@ -117,7 +122,8 @@
#define CONFIG_USBHOST_ASYNCH
//#define CONFIG_USBHOST_GET_STRING_DESC
-/* EHCI Configuration */
+/* ================ EHCI Configuration ================ */
+
#define CONFIG_USB_EHCI_HCCR_BASE (0x20072000)
#define CONFIG_USB_EHCI_HCOR_BASE (0x20072000 + 0x10)
#define CONFIG_USB_EHCI_QH_NUM (10)
diff --git a/demo/hpm/usb_host/src/usb_config.h b/demo/hpm/usb_host/src/usb_config.h
index e84c395b..e01b709d 100644
--- a/demo/hpm/usb_host/src/usb_config.h
+++ b/demo/hpm/usb_host/src/usb_config.h
@@ -1,7 +1,13 @@
-#ifndef _USB_CONFIG_H
-#define _USB_CONFIG_H
+/*
+ * Copyright (c) 2022, sakumisu
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+#ifndef CHERRYUSB_CONFIG_H
+#define CHERRYUSB_CONFIG_H
+
+/* ================ USB common Configuration ================ */
-/* USB common Configuration */
#ifndef CONFIG_USB_DBG_LEVEL
#define CONFIG_USB_DBG_LEVEL USB_DBG_INFO
#endif
@@ -10,23 +16,34 @@
#define CONFIG_USB_PRINTF printf
#endif
-//#define USB_NOCACHE_RAM_SECTION __attribute__((section(".noncacheable")))
+/* attribute data into no cache ram */
+// #define USB_NOCACHE_RAM_SECTION __attribute__((section(".noncacheable")))
+/* Enable print with color */
#define CONFIG_USB_PRINTF_COLOR_ENABLE
-/* USB DEVICE Configuration */
+/* ================ USB DEVICE Configuration ================*/
+
/* core */
-#ifndef CONFIG_USBDEV_REQUEST_BUFFER_LEN
-#define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256
-#endif
+/* Ep0 max transfer buffer, specially for receiving data from ep0 out */
+#define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256
+/* Setup packet log for debug */
// #define CONFIG_USBDEV_SETUP_LOG_PRINT
+/* Check if the input descriptor is correct */
// #define CONFIG_USBDEV_DESC_CHECK
+/* Enable test mode */
// #define CONFIG_USBDEV_TEST_MODE
/* cdc class */
+
// #define CONFIG_USBDEV_CDC_ACM_UART
/* msc class */
+
+#ifndef CONFIG_USBDEV_MSC_BLOCK_SIZE
+#define CONFIG_USBDEV_MSC_BLOCK_SIZE 512
+#endif
+
#ifndef CONFIG_USBDEV_MSC_MANUFACTURER_STRING
#define CONFIG_USBDEV_MSC_MANUFACTURER_STRING ""
#endif
@@ -52,15 +69,17 @@
#endif
/* audio class */
+
#ifndef CONFIG_USBDEV_AUDIO_VERSION
#define CONFIG_USBDEV_AUDIO_VERSION 0x0100
#endif
#ifndef CONFIG_USBDEV_AUDIO_MAX_CHANNEL
-#define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 2
+#define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 8
#endif
-/* USB HOST Configuration */
+/* ================ USB HOST Configuration ================ */
+
#ifndef CONFIG_USBHOST_RHPORTS
#define CONFIG_USBHOST_RHPORTS 1
#endif
@@ -103,14 +122,15 @@
#define CONFIG_USBHOST_ASYNCH
//#define CONFIG_USBHOST_GET_STRING_DESC
-/* EHCI Configuration */
-#define CONFIG_USB_EHCI_HCCR_BASE (0xF2020000UL)
-#define CONFIG_USB_EHCI_HCOR_BASE (0xF2020000UL + 0x140)
+/* ================ EHCI Configuration ================ */
+
+#define CONFIG_USB_EHCI_HCCR_BASE (0x20072000)
+#define CONFIG_USB_EHCI_HCOR_BASE (0x20072000 + 0x10)
#define CONFIG_USB_EHCI_QH_NUM (10)
#define CONFIG_USB_EHCI_QTD_NUM (10)
// #define CONFIG_USB_EHCI_INFO_ENABLE
// #define CONFIG_USB_ECHI_HCOR_RESERVED_DISABLE
// #define CONFIG_USB_EHCI_CONFIGFLAG
-#define CONFIG_USB_EHCI_PORT_POWER
+// #define CONFIG_USB_EHCI_PORT_POWER
#endif
diff --git a/demo/stm32/usb_device/stm32f103c8t6/Core/Inc/usb_config.h b/demo/stm32/usb_device/stm32f103c8t6/Core/Inc/usb_config.h
index 8c57c91b..e01b709d 100644
--- a/demo/stm32/usb_device/stm32f103c8t6/Core/Inc/usb_config.h
+++ b/demo/stm32/usb_device/stm32f103c8t6/Core/Inc/usb_config.h
@@ -1,7 +1,13 @@
-#ifndef _USB_CONFIG_H
-#define _USB_CONFIG_H
+/*
+ * Copyright (c) 2022, sakumisu
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+#ifndef CHERRYUSB_CONFIG_H
+#define CHERRYUSB_CONFIG_H
+
+/* ================ USB common Configuration ================ */
-/* USB common Configuration */
#ifndef CONFIG_USB_DBG_LEVEL
#define CONFIG_USB_DBG_LEVEL USB_DBG_INFO
#endif
@@ -10,22 +16,34 @@
#define CONFIG_USB_PRINTF printf
#endif
+/* attribute data into no cache ram */
+// #define USB_NOCACHE_RAM_SECTION __attribute__((section(".noncacheable")))
+/* Enable print with color */
#define CONFIG_USB_PRINTF_COLOR_ENABLE
-/* USB DEVICE Configuration */
+/* ================ USB DEVICE Configuration ================*/
+
/* core */
-#ifndef CONFIG_USBDEV_REQUEST_BUFFER_LEN
-#define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256
-#endif
+/* Ep0 max transfer buffer, specially for receiving data from ep0 out */
+#define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256
+/* Setup packet log for debug */
// #define CONFIG_USBDEV_SETUP_LOG_PRINT
+/* Check if the input descriptor is correct */
// #define CONFIG_USBDEV_DESC_CHECK
+/* Enable test mode */
// #define CONFIG_USBDEV_TEST_MODE
/* cdc class */
+
// #define CONFIG_USBDEV_CDC_ACM_UART
/* msc class */
+
+#ifndef CONFIG_USBDEV_MSC_BLOCK_SIZE
+#define CONFIG_USBDEV_MSC_BLOCK_SIZE 512
+#endif
+
#ifndef CONFIG_USBDEV_MSC_MANUFACTURER_STRING
#define CONFIG_USBDEV_MSC_MANUFACTURER_STRING ""
#endif
@@ -51,15 +69,17 @@
#endif
/* audio class */
+
#ifndef CONFIG_USBDEV_AUDIO_VERSION
#define CONFIG_USBDEV_AUDIO_VERSION 0x0100
#endif
#ifndef CONFIG_USBDEV_AUDIO_MAX_CHANNEL
-#define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 2
+#define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 8
#endif
-/* USB HOST Configuration */
+/* ================ USB HOST Configuration ================ */
+
#ifndef CONFIG_USBHOST_RHPORTS
#define CONFIG_USBHOST_RHPORTS 1
#endif
@@ -88,20 +108,6 @@
#define CONFIG_USBHOST_MSC_TIMEOUT 5000
#endif
-#ifndef CONFIG_USBHOST_HPWORKQ_PRIO
-#define CONFIG_USBHOST_HPWORKQ_PRIO 5
-#endif
-#ifndef CONFIG_USBHOST_HPWORKQ_STACKSIZE
-#define CONFIG_USBHOST_HPWORKQ_STACKSIZE 2048
-#endif
-
-#ifndef CONFIG_USBHOST_LPWORKQ_PRIO
-#define CONFIG_USBHOST_LPWORKQ_PRIO 1
-#endif
-#ifndef CONFIG_USBHOST_LPWORKQ_STACKSIZE
-#define CONFIG_USBHOST_LPWORKQ_STACKSIZE 2048
-#endif
-
#ifndef CONFIG_USBHOST_PSC_PRIO
#define CONFIG_USBHOST_PSC_PRIO 4
#endif
@@ -116,13 +122,15 @@
#define CONFIG_USBHOST_ASYNCH
//#define CONFIG_USBHOST_GET_STRING_DESC
-/* EHCI Configuration */
+/* ================ EHCI Configuration ================ */
+
#define CONFIG_USB_EHCI_HCCR_BASE (0x20072000)
#define CONFIG_USB_EHCI_HCOR_BASE (0x20072000 + 0x10)
#define CONFIG_USB_EHCI_QH_NUM (10)
#define CONFIG_USB_EHCI_QTD_NUM (10)
// #define CONFIG_USB_EHCI_INFO_ENABLE
-#define CONFIG_USB_ECHI_HCOR_RESERVED_DISABLE
+// #define CONFIG_USB_ECHI_HCOR_RESERVED_DISABLE
// #define CONFIG_USB_EHCI_CONFIGFLAG
+// #define CONFIG_USB_EHCI_PORT_POWER
#endif
diff --git a/demo/stm32/usb_device/stm32f429igt6/Core/Inc/usb_config.h b/demo/stm32/usb_device/stm32f429igt6/Core/Inc/usb_config.h
index 8c57c91b..e01b709d 100644
--- a/demo/stm32/usb_device/stm32f429igt6/Core/Inc/usb_config.h
+++ b/demo/stm32/usb_device/stm32f429igt6/Core/Inc/usb_config.h
@@ -1,7 +1,13 @@
-#ifndef _USB_CONFIG_H
-#define _USB_CONFIG_H
+/*
+ * Copyright (c) 2022, sakumisu
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+#ifndef CHERRYUSB_CONFIG_H
+#define CHERRYUSB_CONFIG_H
+
+/* ================ USB common Configuration ================ */
-/* USB common Configuration */
#ifndef CONFIG_USB_DBG_LEVEL
#define CONFIG_USB_DBG_LEVEL USB_DBG_INFO
#endif
@@ -10,22 +16,34 @@
#define CONFIG_USB_PRINTF printf
#endif
+/* attribute data into no cache ram */
+// #define USB_NOCACHE_RAM_SECTION __attribute__((section(".noncacheable")))
+/* Enable print with color */
#define CONFIG_USB_PRINTF_COLOR_ENABLE
-/* USB DEVICE Configuration */
+/* ================ USB DEVICE Configuration ================*/
+
/* core */
-#ifndef CONFIG_USBDEV_REQUEST_BUFFER_LEN
-#define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256
-#endif
+/* Ep0 max transfer buffer, specially for receiving data from ep0 out */
+#define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256
+/* Setup packet log for debug */
// #define CONFIG_USBDEV_SETUP_LOG_PRINT
+/* Check if the input descriptor is correct */
// #define CONFIG_USBDEV_DESC_CHECK
+/* Enable test mode */
// #define CONFIG_USBDEV_TEST_MODE
/* cdc class */
+
// #define CONFIG_USBDEV_CDC_ACM_UART
/* msc class */
+
+#ifndef CONFIG_USBDEV_MSC_BLOCK_SIZE
+#define CONFIG_USBDEV_MSC_BLOCK_SIZE 512
+#endif
+
#ifndef CONFIG_USBDEV_MSC_MANUFACTURER_STRING
#define CONFIG_USBDEV_MSC_MANUFACTURER_STRING ""
#endif
@@ -51,15 +69,17 @@
#endif
/* audio class */
+
#ifndef CONFIG_USBDEV_AUDIO_VERSION
#define CONFIG_USBDEV_AUDIO_VERSION 0x0100
#endif
#ifndef CONFIG_USBDEV_AUDIO_MAX_CHANNEL
-#define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 2
+#define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 8
#endif
-/* USB HOST Configuration */
+/* ================ USB HOST Configuration ================ */
+
#ifndef CONFIG_USBHOST_RHPORTS
#define CONFIG_USBHOST_RHPORTS 1
#endif
@@ -88,20 +108,6 @@
#define CONFIG_USBHOST_MSC_TIMEOUT 5000
#endif
-#ifndef CONFIG_USBHOST_HPWORKQ_PRIO
-#define CONFIG_USBHOST_HPWORKQ_PRIO 5
-#endif
-#ifndef CONFIG_USBHOST_HPWORKQ_STACKSIZE
-#define CONFIG_USBHOST_HPWORKQ_STACKSIZE 2048
-#endif
-
-#ifndef CONFIG_USBHOST_LPWORKQ_PRIO
-#define CONFIG_USBHOST_LPWORKQ_PRIO 1
-#endif
-#ifndef CONFIG_USBHOST_LPWORKQ_STACKSIZE
-#define CONFIG_USBHOST_LPWORKQ_STACKSIZE 2048
-#endif
-
#ifndef CONFIG_USBHOST_PSC_PRIO
#define CONFIG_USBHOST_PSC_PRIO 4
#endif
@@ -116,13 +122,15 @@
#define CONFIG_USBHOST_ASYNCH
//#define CONFIG_USBHOST_GET_STRING_DESC
-/* EHCI Configuration */
+/* ================ EHCI Configuration ================ */
+
#define CONFIG_USB_EHCI_HCCR_BASE (0x20072000)
#define CONFIG_USB_EHCI_HCOR_BASE (0x20072000 + 0x10)
#define CONFIG_USB_EHCI_QH_NUM (10)
#define CONFIG_USB_EHCI_QTD_NUM (10)
// #define CONFIG_USB_EHCI_INFO_ENABLE
-#define CONFIG_USB_ECHI_HCOR_RESERVED_DISABLE
+// #define CONFIG_USB_ECHI_HCOR_RESERVED_DISABLE
// #define CONFIG_USB_EHCI_CONFIGFLAG
+// #define CONFIG_USB_EHCI_PORT_POWER
#endif
diff --git a/demo/stm32/usb_device/stm32h743vbt6/Core/Inc/usb_config.h b/demo/stm32/usb_device/stm32h743vbt6/Core/Inc/usb_config.h
index 8c57c91b..e01b709d 100644
--- a/demo/stm32/usb_device/stm32h743vbt6/Core/Inc/usb_config.h
+++ b/demo/stm32/usb_device/stm32h743vbt6/Core/Inc/usb_config.h
@@ -1,7 +1,13 @@
-#ifndef _USB_CONFIG_H
-#define _USB_CONFIG_H
+/*
+ * Copyright (c) 2022, sakumisu
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+#ifndef CHERRYUSB_CONFIG_H
+#define CHERRYUSB_CONFIG_H
+
+/* ================ USB common Configuration ================ */
-/* USB common Configuration */
#ifndef CONFIG_USB_DBG_LEVEL
#define CONFIG_USB_DBG_LEVEL USB_DBG_INFO
#endif
@@ -10,22 +16,34 @@
#define CONFIG_USB_PRINTF printf
#endif
+/* attribute data into no cache ram */
+// #define USB_NOCACHE_RAM_SECTION __attribute__((section(".noncacheable")))
+/* Enable print with color */
#define CONFIG_USB_PRINTF_COLOR_ENABLE
-/* USB DEVICE Configuration */
+/* ================ USB DEVICE Configuration ================*/
+
/* core */
-#ifndef CONFIG_USBDEV_REQUEST_BUFFER_LEN
-#define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256
-#endif
+/* Ep0 max transfer buffer, specially for receiving data from ep0 out */
+#define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256
+/* Setup packet log for debug */
// #define CONFIG_USBDEV_SETUP_LOG_PRINT
+/* Check if the input descriptor is correct */
// #define CONFIG_USBDEV_DESC_CHECK
+/* Enable test mode */
// #define CONFIG_USBDEV_TEST_MODE
/* cdc class */
+
// #define CONFIG_USBDEV_CDC_ACM_UART
/* msc class */
+
+#ifndef CONFIG_USBDEV_MSC_BLOCK_SIZE
+#define CONFIG_USBDEV_MSC_BLOCK_SIZE 512
+#endif
+
#ifndef CONFIG_USBDEV_MSC_MANUFACTURER_STRING
#define CONFIG_USBDEV_MSC_MANUFACTURER_STRING ""
#endif
@@ -51,15 +69,17 @@
#endif
/* audio class */
+
#ifndef CONFIG_USBDEV_AUDIO_VERSION
#define CONFIG_USBDEV_AUDIO_VERSION 0x0100
#endif
#ifndef CONFIG_USBDEV_AUDIO_MAX_CHANNEL
-#define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 2
+#define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 8
#endif
-/* USB HOST Configuration */
+/* ================ USB HOST Configuration ================ */
+
#ifndef CONFIG_USBHOST_RHPORTS
#define CONFIG_USBHOST_RHPORTS 1
#endif
@@ -88,20 +108,6 @@
#define CONFIG_USBHOST_MSC_TIMEOUT 5000
#endif
-#ifndef CONFIG_USBHOST_HPWORKQ_PRIO
-#define CONFIG_USBHOST_HPWORKQ_PRIO 5
-#endif
-#ifndef CONFIG_USBHOST_HPWORKQ_STACKSIZE
-#define CONFIG_USBHOST_HPWORKQ_STACKSIZE 2048
-#endif
-
-#ifndef CONFIG_USBHOST_LPWORKQ_PRIO
-#define CONFIG_USBHOST_LPWORKQ_PRIO 1
-#endif
-#ifndef CONFIG_USBHOST_LPWORKQ_STACKSIZE
-#define CONFIG_USBHOST_LPWORKQ_STACKSIZE 2048
-#endif
-
#ifndef CONFIG_USBHOST_PSC_PRIO
#define CONFIG_USBHOST_PSC_PRIO 4
#endif
@@ -116,13 +122,15 @@
#define CONFIG_USBHOST_ASYNCH
//#define CONFIG_USBHOST_GET_STRING_DESC
-/* EHCI Configuration */
+/* ================ EHCI Configuration ================ */
+
#define CONFIG_USB_EHCI_HCCR_BASE (0x20072000)
#define CONFIG_USB_EHCI_HCOR_BASE (0x20072000 + 0x10)
#define CONFIG_USB_EHCI_QH_NUM (10)
#define CONFIG_USB_EHCI_QTD_NUM (10)
// #define CONFIG_USB_EHCI_INFO_ENABLE
-#define CONFIG_USB_ECHI_HCOR_RESERVED_DISABLE
+// #define CONFIG_USB_ECHI_HCOR_RESERVED_DISABLE
// #define CONFIG_USB_EHCI_CONFIGFLAG
+// #define CONFIG_USB_EHCI_PORT_POWER
#endif