diff --git a/cherryusb_config_template.h b/cherryusb_config_template.h index eab055ba..9573485f 100644 --- a/cherryusb_config_template.h +++ b/cherryusb_config_template.h @@ -27,27 +27,20 @@ /* attribute data into no cache ram */ #define USB_NOCACHE_RAM_SECTION __attribute__((section(".noncacheable"))) -/* ================ USB DEVICE Configuration ================*/ - -/* core */ +/* ================= USB Device Stack Configuration ================ */ /* Ep0 max transfer buffer, specially for receiving data from ep0 out */ -#ifndef CONFIG_USBDEV_REQUEST_BUFFER_LEN #define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256 -#endif + /* 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 @@ -76,8 +69,6 @@ #endif #endif -/* audio class */ - #ifndef CONFIG_USBDEV_AUDIO_VERSION #define CONFIG_USBDEV_AUDIO_VERSION 0x0100 #endif @@ -86,28 +77,26 @@ #define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 8 #endif -/* ================ USB HOST Configuration ================ */ -/* core */ -/* Ep0 max transfer buffer */ -#ifndef CONFIG_USBHOST_REQUEST_BUFFER_LEN -#define CONFIG_USBHOST_REQUEST_BUFFER_LEN 512 -#endif +/* ================ USB HOST Stack Configuration ================== */ -#ifndef CONFIG_USBHOST_RHPORTS -#define CONFIG_USBHOST_RHPORTS 1 -#endif - -#ifndef CONFIG_USBHOST_EHPORTS -#define CONFIG_USBHOST_EHPORTS 4 -#endif - -#ifndef CONFIG_USBHOST_INTF_NUM +#define CONFIG_USBHOST_RHPORTS 1 +#define CONFIG_USBHOST_EHPORTS 4 #define CONFIG_USBHOST_INTF_NUM 6 +#define CONFIG_USBHOST_EP_NUM 4 + +#define CONFIG_USBHOST_DEV_NAMELEN 16 + +#ifndef CONFIG_USBHOST_PSC_PRIO +#define CONFIG_USBHOST_PSC_PRIO 4 +#endif +#ifndef CONFIG_USBHOST_PSC_STACKSIZE +#define CONFIG_USBHOST_PSC_STACKSIZE 2048 #endif -#ifndef CONFIG_USBHOST_EP_NUM -#define CONFIG_USBHOST_EP_NUM 4 -#endif +//#define CONFIG_USBHOST_GET_STRING_DESC + +/* Ep0 max transfer buffer */ +#define CONFIG_USBHOST_REQUEST_BUFFER_LEN 512 #ifndef CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT #define CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT 500 @@ -117,22 +106,15 @@ #define CONFIG_USBHOST_MSC_TIMEOUT 5000 #endif -#ifndef CONFIG_USBHOST_PSC_PRIO -#define CONFIG_USBHOST_PSC_PRIO 4 -#endif -#ifndef CONFIG_USBHOST_PSC_STACKSIZE -#define CONFIG_USBHOST_PSC_STACKSIZE 2048 -#endif +/* ================ USB Device Port Configuration ================*/ -#ifndef CONFIG_USBHOST_DEV_NAMELEN -#define CONFIG_USBHOST_DEV_NAMELEN 16 -#endif +//#define USBD_IRQHandler USBD_IRQHandler +//#define USB_BASE (0x40080000UL) +//#define USB_NUM_BIDIR_ENDPOINTS 4 -//#define CONFIG_USBHOST_GET_STRING_DESC +/* ================ USB Host Port Configuration ==================*/ -#ifndef CONFIG_USBHOST_PIPE_NUM #define CONFIG_USBHOST_PIPE_NUM 10 -#endif /* ================ EHCI Configuration ================ */ diff --git a/demo/es32/usb_device/ES32F369x/Inc/usb_config.h b/demo/es32/usb_device/ES32F369x/Inc/usb_config.h index e01b709d..9573485f 100644 --- a/demo/es32/usb_device/ES32F369x/Inc/usb_config.h +++ b/demo/es32/usb_device/ES32F369x/Inc/usb_config.h @@ -16,30 +16,31 @@ #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 ================*/ +/* data align size when use dma */ +#ifndef CONFIG_USB_ALIGN_SIZE +#define CONFIG_USB_ALIGN_SIZE 4 +#endif -/* core */ +/* attribute data into no cache ram */ +#define USB_NOCACHE_RAM_SECTION __attribute__((section(".noncacheable"))) + +/* ================= USB Device Stack Configuration ================ */ /* 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 @@ -68,8 +69,6 @@ #endif #endif -/* audio class */ - #ifndef CONFIG_USBDEV_AUDIO_VERSION #define CONFIG_USBDEV_AUDIO_VERSION 0x0100 #endif @@ -78,56 +77,50 @@ #define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 8 #endif -/* ================ USB HOST Configuration ================ */ +/* ================ USB HOST Stack Configuration ================== */ -#ifndef CONFIG_USBHOST_RHPORTS -#define CONFIG_USBHOST_RHPORTS 1 -#endif - -#ifndef CONFIG_USBHOST_EHPORTS -#define CONFIG_USBHOST_EHPORTS 4 -#endif - -#ifndef CONFIG_USBHOST_PIPE_NUM -#define CONFIG_USBHOST_PIPE_NUM 10 -#endif - -#ifndef CONFIG_USBHOST_INTF_NUM +#define CONFIG_USBHOST_RHPORTS 1 +#define CONFIG_USBHOST_EHPORTS 4 #define CONFIG_USBHOST_INTF_NUM 6 +#define CONFIG_USBHOST_EP_NUM 4 + +#define CONFIG_USBHOST_DEV_NAMELEN 16 + +#ifndef CONFIG_USBHOST_PSC_PRIO +#define CONFIG_USBHOST_PSC_PRIO 4 +#endif +#ifndef CONFIG_USBHOST_PSC_STACKSIZE +#define CONFIG_USBHOST_PSC_STACKSIZE 2048 #endif -#ifndef CONFIG_USBHOST_EP_NUM -#define CONFIG_USBHOST_EP_NUM 4 -#endif +//#define CONFIG_USBHOST_GET_STRING_DESC + +/* Ep0 max transfer buffer */ +#define CONFIG_USBHOST_REQUEST_BUFFER_LEN 512 #ifndef CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT -#define CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT 5000 +#define CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT 500 #endif #ifndef CONFIG_USBHOST_MSC_TIMEOUT #define CONFIG_USBHOST_MSC_TIMEOUT 5000 #endif -#ifndef CONFIG_USBHOST_PSC_PRIO -#define CONFIG_USBHOST_PSC_PRIO 4 -#endif -#ifndef CONFIG_USBHOST_PSC_STACKSIZE -#define CONFIG_USBHOST_PSC_STACKSIZE 4096 -#endif +/* ================ USB Device Port Configuration ================*/ -#ifndef CONFIG_USBHOST_DEV_NAMELEN -#define CONFIG_USBHOST_DEV_NAMELEN 16 -#endif +//#define USBD_IRQHandler USBD_IRQHandler +//#define USB_BASE (0x40080000UL) +//#define USB_NUM_BIDIR_ENDPOINTS 4 -#define CONFIG_USBHOST_ASYNCH -//#define CONFIG_USBHOST_GET_STRING_DESC +/* ================ USB Host Port Configuration ==================*/ + +#define CONFIG_USBHOST_PIPE_NUM 10 /* ================ 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_HCCR_BASE (0x20072000) +#define CONFIG_USB_EHCI_HCOR_BASE (0x20072000 + 0x10) +#define CONFIG_EHCI_FRAME_LIST_SIZE 1024 // #define CONFIG_USB_EHCI_INFO_ENABLE // #define CONFIG_USB_ECHI_HCOR_RESERVED_DISABLE // #define CONFIG_USB_EHCI_CONFIGFLAG diff --git a/demo/es32/usb_host/ES32F369x/Inc/usb_config.h b/demo/es32/usb_host/ES32F369x/Inc/usb_config.h index 2adf79a5..0f55d390 100644 --- a/demo/es32/usb_host/ES32F369x/Inc/usb_config.h +++ b/demo/es32/usb_host/ES32F369x/Inc/usb_config.h @@ -27,27 +27,20 @@ /* attribute data into no cache ram */ #define USB_NOCACHE_RAM_SECTION __attribute__((section(".noncacheable"))) -/* ================ USB DEVICE Configuration ================*/ - -/* core */ +/* ================= USB Device Stack Configuration ================ */ /* Ep0 max transfer buffer, specially for receiving data from ep0 out */ -#ifndef CONFIG_USBDEV_REQUEST_BUFFER_LEN #define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256 -#endif + /* 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 @@ -76,8 +69,6 @@ #endif #endif -/* audio class */ - #ifndef CONFIG_USBDEV_AUDIO_VERSION #define CONFIG_USBDEV_AUDIO_VERSION 0x0100 #endif @@ -86,28 +77,26 @@ #define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 8 #endif -/* ================ USB HOST Configuration ================ */ -/* core */ -/* Ep0 max transfer buffer */ -#ifndef CONFIG_USBHOST_REQUEST_BUFFER_LEN -#define CONFIG_USBHOST_REQUEST_BUFFER_LEN 512 -#endif +/* ================ USB HOST Stack Configuration ================== */ -#ifndef CONFIG_USBHOST_RHPORTS -#define CONFIG_USBHOST_RHPORTS 1 -#endif - -#ifndef CONFIG_USBHOST_EHPORTS -#define CONFIG_USBHOST_EHPORTS 4 -#endif - -#ifndef CONFIG_USBHOST_INTF_NUM +#define CONFIG_USBHOST_RHPORTS 1 +#define CONFIG_USBHOST_EHPORTS 4 #define CONFIG_USBHOST_INTF_NUM 6 +#define CONFIG_USBHOST_EP_NUM 4 + +#define CONFIG_USBHOST_DEV_NAMELEN 16 + +#ifndef CONFIG_USBHOST_PSC_PRIO +#define CONFIG_USBHOST_PSC_PRIO 4 +#endif +#ifndef CONFIG_USBHOST_PSC_STACKSIZE +#define CONFIG_USBHOST_PSC_STACKSIZE 2048 #endif -#ifndef CONFIG_USBHOST_EP_NUM -#define CONFIG_USBHOST_EP_NUM 4 -#endif +//#define CONFIG_USBHOST_GET_STRING_DESC + +/* Ep0 max transfer buffer */ +#define CONFIG_USBHOST_REQUEST_BUFFER_LEN 512 #ifndef CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT #define CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT 500 @@ -117,22 +106,15 @@ #define CONFIG_USBHOST_MSC_TIMEOUT 5000 #endif -#ifndef CONFIG_USBHOST_PSC_PRIO -#define CONFIG_USBHOST_PSC_PRIO 4 -#endif -#ifndef CONFIG_USBHOST_PSC_STACKSIZE -#define CONFIG_USBHOST_PSC_STACKSIZE 2048 -#endif +/* ================ USB Device Port Configuration ================*/ -#ifndef CONFIG_USBHOST_DEV_NAMELEN -#define CONFIG_USBHOST_DEV_NAMELEN 16 -#endif +//#define USBD_IRQHandler USBD_IRQHandler +//#define USB_BASE (0x40080000UL) +//#define USB_NUM_BIDIR_ENDPOINTS 4 -//#define CONFIG_USBHOST_GET_STRING_DESC +/* ================ USB Host Port Configuration ==================*/ -#ifndef CONFIG_USBHOST_PIPE_NUM #define CONFIG_USBHOST_PIPE_NUM 4 -#endif /* ================ EHCI Configuration ================ */ 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 e01b709d..9573485f 100644 --- a/demo/stm32/usb_device/stm32f103c8t6/Core/Inc/usb_config.h +++ b/demo/stm32/usb_device/stm32f103c8t6/Core/Inc/usb_config.h @@ -16,30 +16,31 @@ #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 ================*/ +/* data align size when use dma */ +#ifndef CONFIG_USB_ALIGN_SIZE +#define CONFIG_USB_ALIGN_SIZE 4 +#endif -/* core */ +/* attribute data into no cache ram */ +#define USB_NOCACHE_RAM_SECTION __attribute__((section(".noncacheable"))) + +/* ================= USB Device Stack Configuration ================ */ /* 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 @@ -68,8 +69,6 @@ #endif #endif -/* audio class */ - #ifndef CONFIG_USBDEV_AUDIO_VERSION #define CONFIG_USBDEV_AUDIO_VERSION 0x0100 #endif @@ -78,56 +77,50 @@ #define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 8 #endif -/* ================ USB HOST Configuration ================ */ +/* ================ USB HOST Stack Configuration ================== */ -#ifndef CONFIG_USBHOST_RHPORTS -#define CONFIG_USBHOST_RHPORTS 1 -#endif - -#ifndef CONFIG_USBHOST_EHPORTS -#define CONFIG_USBHOST_EHPORTS 4 -#endif - -#ifndef CONFIG_USBHOST_PIPE_NUM -#define CONFIG_USBHOST_PIPE_NUM 10 -#endif - -#ifndef CONFIG_USBHOST_INTF_NUM +#define CONFIG_USBHOST_RHPORTS 1 +#define CONFIG_USBHOST_EHPORTS 4 #define CONFIG_USBHOST_INTF_NUM 6 +#define CONFIG_USBHOST_EP_NUM 4 + +#define CONFIG_USBHOST_DEV_NAMELEN 16 + +#ifndef CONFIG_USBHOST_PSC_PRIO +#define CONFIG_USBHOST_PSC_PRIO 4 +#endif +#ifndef CONFIG_USBHOST_PSC_STACKSIZE +#define CONFIG_USBHOST_PSC_STACKSIZE 2048 #endif -#ifndef CONFIG_USBHOST_EP_NUM -#define CONFIG_USBHOST_EP_NUM 4 -#endif +//#define CONFIG_USBHOST_GET_STRING_DESC + +/* Ep0 max transfer buffer */ +#define CONFIG_USBHOST_REQUEST_BUFFER_LEN 512 #ifndef CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT -#define CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT 5000 +#define CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT 500 #endif #ifndef CONFIG_USBHOST_MSC_TIMEOUT #define CONFIG_USBHOST_MSC_TIMEOUT 5000 #endif -#ifndef CONFIG_USBHOST_PSC_PRIO -#define CONFIG_USBHOST_PSC_PRIO 4 -#endif -#ifndef CONFIG_USBHOST_PSC_STACKSIZE -#define CONFIG_USBHOST_PSC_STACKSIZE 4096 -#endif +/* ================ USB Device Port Configuration ================*/ -#ifndef CONFIG_USBHOST_DEV_NAMELEN -#define CONFIG_USBHOST_DEV_NAMELEN 16 -#endif +//#define USBD_IRQHandler USBD_IRQHandler +//#define USB_BASE (0x40080000UL) +//#define USB_NUM_BIDIR_ENDPOINTS 4 -#define CONFIG_USBHOST_ASYNCH -//#define CONFIG_USBHOST_GET_STRING_DESC +/* ================ USB Host Port Configuration ==================*/ + +#define CONFIG_USBHOST_PIPE_NUM 10 /* ================ 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_HCCR_BASE (0x20072000) +#define CONFIG_USB_EHCI_HCOR_BASE (0x20072000 + 0x10) +#define CONFIG_EHCI_FRAME_LIST_SIZE 1024 // #define CONFIG_USB_EHCI_INFO_ENABLE // #define CONFIG_USB_ECHI_HCOR_RESERVED_DISABLE // #define CONFIG_USB_EHCI_CONFIGFLAG 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 e01b709d..9573485f 100644 --- a/demo/stm32/usb_device/stm32f429igt6/Core/Inc/usb_config.h +++ b/demo/stm32/usb_device/stm32f429igt6/Core/Inc/usb_config.h @@ -16,30 +16,31 @@ #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 ================*/ +/* data align size when use dma */ +#ifndef CONFIG_USB_ALIGN_SIZE +#define CONFIG_USB_ALIGN_SIZE 4 +#endif -/* core */ +/* attribute data into no cache ram */ +#define USB_NOCACHE_RAM_SECTION __attribute__((section(".noncacheable"))) + +/* ================= USB Device Stack Configuration ================ */ /* 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 @@ -68,8 +69,6 @@ #endif #endif -/* audio class */ - #ifndef CONFIG_USBDEV_AUDIO_VERSION #define CONFIG_USBDEV_AUDIO_VERSION 0x0100 #endif @@ -78,56 +77,50 @@ #define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 8 #endif -/* ================ USB HOST Configuration ================ */ +/* ================ USB HOST Stack Configuration ================== */ -#ifndef CONFIG_USBHOST_RHPORTS -#define CONFIG_USBHOST_RHPORTS 1 -#endif - -#ifndef CONFIG_USBHOST_EHPORTS -#define CONFIG_USBHOST_EHPORTS 4 -#endif - -#ifndef CONFIG_USBHOST_PIPE_NUM -#define CONFIG_USBHOST_PIPE_NUM 10 -#endif - -#ifndef CONFIG_USBHOST_INTF_NUM +#define CONFIG_USBHOST_RHPORTS 1 +#define CONFIG_USBHOST_EHPORTS 4 #define CONFIG_USBHOST_INTF_NUM 6 +#define CONFIG_USBHOST_EP_NUM 4 + +#define CONFIG_USBHOST_DEV_NAMELEN 16 + +#ifndef CONFIG_USBHOST_PSC_PRIO +#define CONFIG_USBHOST_PSC_PRIO 4 +#endif +#ifndef CONFIG_USBHOST_PSC_STACKSIZE +#define CONFIG_USBHOST_PSC_STACKSIZE 2048 #endif -#ifndef CONFIG_USBHOST_EP_NUM -#define CONFIG_USBHOST_EP_NUM 4 -#endif +//#define CONFIG_USBHOST_GET_STRING_DESC + +/* Ep0 max transfer buffer */ +#define CONFIG_USBHOST_REQUEST_BUFFER_LEN 512 #ifndef CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT -#define CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT 5000 +#define CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT 500 #endif #ifndef CONFIG_USBHOST_MSC_TIMEOUT #define CONFIG_USBHOST_MSC_TIMEOUT 5000 #endif -#ifndef CONFIG_USBHOST_PSC_PRIO -#define CONFIG_USBHOST_PSC_PRIO 4 -#endif -#ifndef CONFIG_USBHOST_PSC_STACKSIZE -#define CONFIG_USBHOST_PSC_STACKSIZE 4096 -#endif +/* ================ USB Device Port Configuration ================*/ -#ifndef CONFIG_USBHOST_DEV_NAMELEN -#define CONFIG_USBHOST_DEV_NAMELEN 16 -#endif +//#define USBD_IRQHandler USBD_IRQHandler +//#define USB_BASE (0x40080000UL) +//#define USB_NUM_BIDIR_ENDPOINTS 4 -#define CONFIG_USBHOST_ASYNCH -//#define CONFIG_USBHOST_GET_STRING_DESC +/* ================ USB Host Port Configuration ==================*/ + +#define CONFIG_USBHOST_PIPE_NUM 10 /* ================ 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_HCCR_BASE (0x20072000) +#define CONFIG_USB_EHCI_HCOR_BASE (0x20072000 + 0x10) +#define CONFIG_EHCI_FRAME_LIST_SIZE 1024 // #define CONFIG_USB_EHCI_INFO_ENABLE // #define CONFIG_USB_ECHI_HCOR_RESERVED_DISABLE // #define CONFIG_USB_EHCI_CONFIGFLAG 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 e01b709d..9573485f 100644 --- a/demo/stm32/usb_device/stm32h743vbt6/Core/Inc/usb_config.h +++ b/demo/stm32/usb_device/stm32h743vbt6/Core/Inc/usb_config.h @@ -16,30 +16,31 @@ #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 ================*/ +/* data align size when use dma */ +#ifndef CONFIG_USB_ALIGN_SIZE +#define CONFIG_USB_ALIGN_SIZE 4 +#endif -/* core */ +/* attribute data into no cache ram */ +#define USB_NOCACHE_RAM_SECTION __attribute__((section(".noncacheable"))) + +/* ================= USB Device Stack Configuration ================ */ /* 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 @@ -68,8 +69,6 @@ #endif #endif -/* audio class */ - #ifndef CONFIG_USBDEV_AUDIO_VERSION #define CONFIG_USBDEV_AUDIO_VERSION 0x0100 #endif @@ -78,56 +77,50 @@ #define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 8 #endif -/* ================ USB HOST Configuration ================ */ +/* ================ USB HOST Stack Configuration ================== */ -#ifndef CONFIG_USBHOST_RHPORTS -#define CONFIG_USBHOST_RHPORTS 1 -#endif - -#ifndef CONFIG_USBHOST_EHPORTS -#define CONFIG_USBHOST_EHPORTS 4 -#endif - -#ifndef CONFIG_USBHOST_PIPE_NUM -#define CONFIG_USBHOST_PIPE_NUM 10 -#endif - -#ifndef CONFIG_USBHOST_INTF_NUM +#define CONFIG_USBHOST_RHPORTS 1 +#define CONFIG_USBHOST_EHPORTS 4 #define CONFIG_USBHOST_INTF_NUM 6 +#define CONFIG_USBHOST_EP_NUM 4 + +#define CONFIG_USBHOST_DEV_NAMELEN 16 + +#ifndef CONFIG_USBHOST_PSC_PRIO +#define CONFIG_USBHOST_PSC_PRIO 4 +#endif +#ifndef CONFIG_USBHOST_PSC_STACKSIZE +#define CONFIG_USBHOST_PSC_STACKSIZE 2048 #endif -#ifndef CONFIG_USBHOST_EP_NUM -#define CONFIG_USBHOST_EP_NUM 4 -#endif +//#define CONFIG_USBHOST_GET_STRING_DESC + +/* Ep0 max transfer buffer */ +#define CONFIG_USBHOST_REQUEST_BUFFER_LEN 512 #ifndef CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT -#define CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT 5000 +#define CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT 500 #endif #ifndef CONFIG_USBHOST_MSC_TIMEOUT #define CONFIG_USBHOST_MSC_TIMEOUT 5000 #endif -#ifndef CONFIG_USBHOST_PSC_PRIO -#define CONFIG_USBHOST_PSC_PRIO 4 -#endif -#ifndef CONFIG_USBHOST_PSC_STACKSIZE -#define CONFIG_USBHOST_PSC_STACKSIZE 4096 -#endif +/* ================ USB Device Port Configuration ================*/ -#ifndef CONFIG_USBHOST_DEV_NAMELEN -#define CONFIG_USBHOST_DEV_NAMELEN 16 -#endif +//#define USBD_IRQHandler USBD_IRQHandler +//#define USB_BASE (0x40080000UL) +//#define USB_NUM_BIDIR_ENDPOINTS 4 -#define CONFIG_USBHOST_ASYNCH -//#define CONFIG_USBHOST_GET_STRING_DESC +/* ================ USB Host Port Configuration ==================*/ + +#define CONFIG_USBHOST_PIPE_NUM 10 /* ================ 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_HCCR_BASE (0x20072000) +#define CONFIG_USB_EHCI_HCOR_BASE (0x20072000 + 0x10) +#define CONFIG_EHCI_FRAME_LIST_SIZE 1024 // #define CONFIG_USB_EHCI_INFO_ENABLE // #define CONFIG_USB_ECHI_HCOR_RESERVED_DISABLE // #define CONFIG_USB_EHCI_CONFIGFLAG diff --git a/demo/stm32/usb_host/stm32f429igt6/Core/Inc/usb_config.h b/demo/stm32/usb_host/stm32f429igt6/Core/Inc/usb_config.h index e33cca9d..5a4200e7 100644 --- a/demo/stm32/usb_host/stm32f429igt6/Core/Inc/usb_config.h +++ b/demo/stm32/usb_host/stm32f429igt6/Core/Inc/usb_config.h @@ -27,27 +27,20 @@ /* attribute data into no cache ram */ #define USB_NOCACHE_RAM_SECTION __attribute__((section(".noncacheable"))) -/* ================ USB DEVICE Configuration ================*/ - -/* core */ +/* ================= USB Device Stack Configuration ================ */ /* Ep0 max transfer buffer, specially for receiving data from ep0 out */ -#ifndef CONFIG_USBDEV_REQUEST_BUFFER_LEN #define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256 -#endif + /* 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 @@ -76,8 +69,6 @@ #endif #endif -/* audio class */ - #ifndef CONFIG_USBDEV_AUDIO_VERSION #define CONFIG_USBDEV_AUDIO_VERSION 0x0100 #endif @@ -86,28 +77,26 @@ #define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 8 #endif -/* ================ USB HOST Configuration ================ */ -/* core */ -/* Ep0 max transfer buffer */ -#ifndef CONFIG_USBHOST_REQUEST_BUFFER_LEN -#define CONFIG_USBHOST_REQUEST_BUFFER_LEN 512 -#endif +/* ================ USB HOST Stack Configuration ================== */ -#ifndef CONFIG_USBHOST_RHPORTS -#define CONFIG_USBHOST_RHPORTS 1 -#endif - -#ifndef CONFIG_USBHOST_EHPORTS -#define CONFIG_USBHOST_EHPORTS 4 -#endif - -#ifndef CONFIG_USBHOST_INTF_NUM +#define CONFIG_USBHOST_RHPORTS 1 +#define CONFIG_USBHOST_EHPORTS 4 #define CONFIG_USBHOST_INTF_NUM 6 +#define CONFIG_USBHOST_EP_NUM 4 + +#define CONFIG_USBHOST_DEV_NAMELEN 16 + +#ifndef CONFIG_USBHOST_PSC_PRIO +#define CONFIG_USBHOST_PSC_PRIO 4 +#endif +#ifndef CONFIG_USBHOST_PSC_STACKSIZE +#define CONFIG_USBHOST_PSC_STACKSIZE 2048 #endif -#ifndef CONFIG_USBHOST_EP_NUM -#define CONFIG_USBHOST_EP_NUM 4 -#endif +//#define CONFIG_USBHOST_GET_STRING_DESC + +/* Ep0 max transfer buffer */ +#define CONFIG_USBHOST_REQUEST_BUFFER_LEN 512 #ifndef CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT #define CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT 500 @@ -117,22 +106,15 @@ #define CONFIG_USBHOST_MSC_TIMEOUT 5000 #endif -#ifndef CONFIG_USBHOST_PSC_PRIO -#define CONFIG_USBHOST_PSC_PRIO 4 -#endif -#ifndef CONFIG_USBHOST_PSC_STACKSIZE -#define CONFIG_USBHOST_PSC_STACKSIZE 2048 -#endif +/* ================ USB Device Port Configuration ================*/ -#ifndef CONFIG_USBHOST_DEV_NAMELEN -#define CONFIG_USBHOST_DEV_NAMELEN 16 -#endif +//#define USBD_IRQHandler USBD_IRQHandler +//#define USB_BASE (0x40080000UL) +//#define USB_NUM_BIDIR_ENDPOINTS 4 -//#define CONFIG_USBHOST_GET_STRING_DESC +/* ================ USB Host Port Configuration ==================*/ -#ifndef CONFIG_USBHOST_PIPE_NUM #define CONFIG_USBHOST_PIPE_NUM 12 -#endif /* ================ EHCI Configuration ================ */ diff --git a/demo/stm32/usb_host/stm32h743xih6/Core/Inc/usb_config.h b/demo/stm32/usb_host/stm32h743xih6/Core/Inc/usb_config.h index e33cca9d..5a4200e7 100644 --- a/demo/stm32/usb_host/stm32h743xih6/Core/Inc/usb_config.h +++ b/demo/stm32/usb_host/stm32h743xih6/Core/Inc/usb_config.h @@ -27,27 +27,20 @@ /* attribute data into no cache ram */ #define USB_NOCACHE_RAM_SECTION __attribute__((section(".noncacheable"))) -/* ================ USB DEVICE Configuration ================*/ - -/* core */ +/* ================= USB Device Stack Configuration ================ */ /* Ep0 max transfer buffer, specially for receiving data from ep0 out */ -#ifndef CONFIG_USBDEV_REQUEST_BUFFER_LEN #define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256 -#endif + /* 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 @@ -76,8 +69,6 @@ #endif #endif -/* audio class */ - #ifndef CONFIG_USBDEV_AUDIO_VERSION #define CONFIG_USBDEV_AUDIO_VERSION 0x0100 #endif @@ -86,28 +77,26 @@ #define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 8 #endif -/* ================ USB HOST Configuration ================ */ -/* core */ -/* Ep0 max transfer buffer */ -#ifndef CONFIG_USBHOST_REQUEST_BUFFER_LEN -#define CONFIG_USBHOST_REQUEST_BUFFER_LEN 512 -#endif +/* ================ USB HOST Stack Configuration ================== */ -#ifndef CONFIG_USBHOST_RHPORTS -#define CONFIG_USBHOST_RHPORTS 1 -#endif - -#ifndef CONFIG_USBHOST_EHPORTS -#define CONFIG_USBHOST_EHPORTS 4 -#endif - -#ifndef CONFIG_USBHOST_INTF_NUM +#define CONFIG_USBHOST_RHPORTS 1 +#define CONFIG_USBHOST_EHPORTS 4 #define CONFIG_USBHOST_INTF_NUM 6 +#define CONFIG_USBHOST_EP_NUM 4 + +#define CONFIG_USBHOST_DEV_NAMELEN 16 + +#ifndef CONFIG_USBHOST_PSC_PRIO +#define CONFIG_USBHOST_PSC_PRIO 4 +#endif +#ifndef CONFIG_USBHOST_PSC_STACKSIZE +#define CONFIG_USBHOST_PSC_STACKSIZE 2048 #endif -#ifndef CONFIG_USBHOST_EP_NUM -#define CONFIG_USBHOST_EP_NUM 4 -#endif +//#define CONFIG_USBHOST_GET_STRING_DESC + +/* Ep0 max transfer buffer */ +#define CONFIG_USBHOST_REQUEST_BUFFER_LEN 512 #ifndef CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT #define CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT 500 @@ -117,22 +106,15 @@ #define CONFIG_USBHOST_MSC_TIMEOUT 5000 #endif -#ifndef CONFIG_USBHOST_PSC_PRIO -#define CONFIG_USBHOST_PSC_PRIO 4 -#endif -#ifndef CONFIG_USBHOST_PSC_STACKSIZE -#define CONFIG_USBHOST_PSC_STACKSIZE 2048 -#endif +/* ================ USB Device Port Configuration ================*/ -#ifndef CONFIG_USBHOST_DEV_NAMELEN -#define CONFIG_USBHOST_DEV_NAMELEN 16 -#endif +//#define USBD_IRQHandler USBD_IRQHandler +//#define USB_BASE (0x40080000UL) +//#define USB_NUM_BIDIR_ENDPOINTS 4 -//#define CONFIG_USBHOST_GET_STRING_DESC +/* ================ USB Host Port Configuration ==================*/ -#ifndef CONFIG_USBHOST_PIPE_NUM #define CONFIG_USBHOST_PIPE_NUM 12 -#endif /* ================ EHCI Configuration ================ */