diff --git a/components/drivers/usb/usbdevice/class/cdc_vcom.c b/components/drivers/usb/usbdevice/class/cdc_vcom.c index 119e2838983aa2ec389a7c6a20a786234492f163..c83043314e76d784829cc800581f283aa5472ae9 100644 --- a/components/drivers/usb/usbdevice/class/cdc_vcom.c +++ b/components/drivers/usb/usbdevice/class/cdc_vcom.c @@ -82,6 +82,7 @@ struct vcom_tx_msg rt_size_t size; }; +ALIGN(4) static struct udevice_descriptor dev_desc = { USB_DESC_LENGTH_DEVICE, //bLength; @@ -101,6 +102,7 @@ static struct udevice_descriptor dev_desc = }; //FS and HS needed +ALIGN(4) static struct usb_qualifier_descriptor dev_qualifier = { sizeof(dev_qualifier), //bLength @@ -115,6 +117,7 @@ static struct usb_qualifier_descriptor dev_qualifier = }; /* communcation interface descriptor */ +ALIGN(4) const static struct ucdc_comm_descriptor _comm_desc = { #ifdef RT_USB_DEVICE_COMPOSITE @@ -184,6 +187,7 @@ const static struct ucdc_comm_descriptor _comm_desc = }; /* data interface descriptor */ +ALIGN(4) const static struct ucdc_data_descriptor _data_desc = { /* interface descriptor */ @@ -217,7 +221,7 @@ const static struct ucdc_data_descriptor _data_desc = 0x00, }, }; - +ALIGN(4) static char serno[_SER_NO_LEN + 1] = {'\0'}; RT_WEAK rt_err_t vcom_get_stored_serno(char *serno, int size); @@ -225,7 +229,7 @@ rt_err_t vcom_get_stored_serno(char *serno, int size) { return RT_ERROR; } - +ALIGN(4) const static char* _ustring[] = { "Language", diff --git a/components/drivers/usb/usbdevice/class/hid.c b/components/drivers/usb/usbdevice/class/hid.c index 8f34d4c1afd6dae228bb66796860bec6d663860e..aea6d802d11f3cee5d01422ae964cabb2baaf723 100644 --- a/components/drivers/usb/usbdevice/class/hid.c +++ b/components/drivers/usb/usbdevice/class/hid.c @@ -35,6 +35,7 @@ struct hid_s }; /* CustomHID_ConfigDescriptor */ +ALIGN(4) const rt_uint8_t _report_desc[]= { #ifdef RT_USB_DEVICE_HID_KEYBOARD @@ -239,6 +240,7 @@ const rt_uint8_t _report_desc[]= #endif }; /* CustomHID_ReportDescriptor */ +ALIGN(4) static struct udevice_descriptor _dev_desc = { USB_DESC_LENGTH_DEVICE, //bLength; @@ -258,6 +260,7 @@ static struct udevice_descriptor _dev_desc = }; //FS and HS needed +ALIGN(4) static struct usb_qualifier_descriptor dev_qualifier = { sizeof(dev_qualifier), //bLength @@ -273,6 +276,7 @@ static struct usb_qualifier_descriptor dev_qualifier = /* hid interface descriptor */ +ALIGN(4) const static struct uhid_comm_descriptor _hid_comm_desc = { #ifdef RT_USB_DEVICE_COMPOSITE @@ -357,7 +361,7 @@ const static struct uhid_comm_descriptor _hid_comm_desc = }, }; - +ALIGN(4) const static char* _ustring[] = { "Language", diff --git a/components/drivers/usb/usbdevice/class/mstorage.c b/components/drivers/usb/usbdevice/class/mstorage.c index 5131f83840b4342f079837ddb87973354052fe67..6a6e92415b61ae74aa9c874536fbb3f9379ffd87 100644 --- a/components/drivers/usb/usbdevice/class/mstorage.c +++ b/components/drivers/usb/usbdevice/class/mstorage.c @@ -68,6 +68,7 @@ struct mstorage struct rt_device_blk_geometry geometry; }; +ALIGN(4) static struct udevice_descriptor dev_desc = { USB_DESC_LENGTH_DEVICE, //bLength; @@ -87,6 +88,7 @@ static struct udevice_descriptor dev_desc = }; //FS and HS needed +ALIGN(4) static struct usb_qualifier_descriptor dev_qualifier = { sizeof(dev_qualifier), //bLength @@ -101,7 +103,7 @@ static struct usb_qualifier_descriptor dev_qualifier = }; - +ALIGN(4) const static struct umass_descriptor _mass_desc = { #ifdef RT_USB_DEVICE_COMPOSITE @@ -148,6 +150,7 @@ const static struct umass_descriptor _mass_desc = }, }; +ALIGN(4) const static char* _ustring[] = { "Language", @@ -170,6 +173,7 @@ static rt_size_t _read_10(ufunction_t func, ustorage_cbw_t cbw); static rt_size_t _write_10(ufunction_t func, ustorage_cbw_t cbw); static rt_size_t _verify_10(ufunction_t func, ustorage_cbw_t cbw); +ALIGN(4) static struct scsi_cmd cmd_data[] = { {SCSI_TEST_UNIT_READY, _test_unit_ready, 6, FIXED, 0, DIR_NONE}, diff --git a/components/drivers/usb/usbdevice/class/rndis.c b/components/drivers/usb/usbdevice/class/rndis.c index e07c6349d060fae4c22deadbc29dc2c5f5e323c2..8996b728e6640a6e60efda44691dd17e27c652f0 100644 --- a/components/drivers/usb/usbdevice/class/rndis.c +++ b/components/drivers/usb/usbdevice/class/rndis.c @@ -214,6 +214,7 @@ const static char* _ustring[] = USB_STRING_OS }; +ALIGN(4) struct usb_os_function_comp_id_descriptor rndis_func_comp_id_desc = { .bFirstInterfaceNumber = USB_DYNAMIC, @@ -222,7 +223,9 @@ struct usb_os_function_comp_id_descriptor rndis_func_comp_id_desc = .subCompatibleID = {'5', '1', '6', '2', '0', '0', '1', 0x00}, .reserved2 = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }; + //FS and HS needed +ALIGN(4) static struct usb_qualifier_descriptor dev_qualifier = { sizeof(dev_qualifier), //bLength diff --git a/components/drivers/usb/usbdevice/class/winusb.c b/components/drivers/usb/usbdevice/class/winusb.c index ff2a81a4da65aa5176b16602ad885eeb6ad7e57f..bf4b353d739674249f3fb23b2d9771100a332f1e 100644 --- a/components/drivers/usb/usbdevice/class/winusb.c +++ b/components/drivers/usb/usbdevice/class/winusb.c @@ -24,6 +24,7 @@ struct winusb_device typedef struct winusb_device * winusb_device_t; +ALIGN(4) static struct udevice_descriptor dev_desc = { USB_DESC_LENGTH_DEVICE, //bLength; @@ -41,7 +42,9 @@ static struct udevice_descriptor dev_desc = USB_STRING_SERIAL_INDEX, //iSerialNumber; USB_DYNAMIC, //bNumConfigurations; }; + //FS and HS needed +ALIGN(4) static struct usb_qualifier_descriptor dev_qualifier = { sizeof(dev_qualifier), //bLength @@ -55,6 +58,7 @@ static struct usb_qualifier_descriptor dev_qualifier = 0, }; +ALIGN(4) struct winusb_descriptor _winusb_desc = { #ifdef RT_USB_DEVICE_COMPOSITE @@ -102,7 +106,7 @@ struct winusb_descriptor _winusb_desc = }, }; - +ALIGN(4) const static char* _ustring[] = { "Language", @@ -113,11 +117,14 @@ const static char* _ustring[] = "Interface", USB_STRING_OS//must be }; + +ALIGN(4) struct usb_os_proerty winusb_proerty[] = { USB_OS_PROERTY_DESC(USB_OS_PROERTY_TYPE_REG_SZ,"DeviceInterfaceGUID",RT_WINUSB_GUID), }; +ALIGN(4) struct usb_os_function_comp_id_descriptor winusb_func_comp_id_desc = { .bFirstInterfaceNumber = USB_DYNAMIC,