Skip to content

Commit cf59c7d

Browse files
authored
Merge pull request #3082 from fpistm/update_USB
chore(usb): update to stm32-mw-usb_device v2.11.6
2 parents 54b6389 + ab25376 commit cf59c7d

51 files changed

Lines changed: 1830 additions & 960 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎libraries/USBDevice/src/cdc/usbd_cdc.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ USBD_ClassTypeDef USBD_CDC = {
159159
USBD_CDC_GetOtherSpeedCfgDesc,
160160
USBD_CDC_GetDeviceQualifierDescriptor,
161161
#endif /* USE_USBD_COMPOSITE */
162+
#if (USBD_SUPPORT_USER_STRING_DESC == 1U)
163+
NULL,
164+
#endif /* USBD_SUPPORT_USER_STRING_DESC */
162165
};
163166

164167
#ifndef USE_USBD_COMPOSITE

‎libraries/USBDevice/src/hid/usbd_hid_composite.c‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ USBD_ClassTypeDef USBD_COMPOSITE_HID = {
130130
USBD_HID_GetOtherSpeedCfgDesc,
131131
USBD_HID_GetDeviceQualifierDesc,
132132
#endif /* USE_USBD_COMPOSITE */
133+
#if (USBD_SUPPORT_USER_STRING_DESC == 1U)
134+
NULL,
135+
#endif /* USBD_SUPPORT_USER_STRING_DESC */
133136
};
134137

135138
#ifndef USE_USBD_COMPOSITE
@@ -1033,15 +1036,19 @@ static uint8_t *USBD_HID_GetOtherSpeedCfgDesc(uint16_t *length)
10331036
static uint8_t USBD_HID_DataIn(USBD_HandleTypeDef *pdev,
10341037
uint8_t epnum)
10351038
{
1036-
1039+
uint8_t status = (uint8_t)USBD_OK;
10371040
/* Ensure that the FIFO is empty before a new transfer, this condition could
10381041
be caused by a new transfer before the end of the previous transfer */
1039-
if (epnum == (HID_KEYBOARD_EPIN_ADDR & 0x7F)) {
1040-
((USBD_HID_HandleTypeDef *)pdev->pClassDataCmsit[pdev->classId])->Keyboardstate = HID_IDLE;
1041-
} else if (epnum == (HID_MOUSE_EPIN_ADDR & 0x7F)) {
1042-
((USBD_HID_HandleTypeDef *)pdev->pClassDataCmsit[pdev->classId])->Mousestate = HID_IDLE;
1042+
if (pdev->pClassDataCmsit[pdev->classId] == NULL) {
1043+
status = (uint8_t)USBD_FAIL;
1044+
} else {
1045+
if (epnum == (HID_KEYBOARD_EPIN_ADDR & 0x7F)) {
1046+
((USBD_HID_HandleTypeDef *)pdev->pClassDataCmsit[pdev->classId])->Keyboardstate = HID_IDLE;
1047+
} else if (epnum == (HID_MOUSE_EPIN_ADDR & 0x7F)) {
1048+
((USBD_HID_HandleTypeDef *)pdev->pClassDataCmsit[pdev->classId])->Mousestate = HID_IDLE;
1049+
}
10431050
}
1044-
return (uint8_t)USBD_OK;
1051+
return status;
10451052
}
10461053

10471054
#ifndef USE_USBD_COMPOSITE

‎system/Middlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Inc/usbd_audio.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ extern "C" {
7171
#define USB_DEVICE_CLASS_AUDIO 0x01U
7272
#define AUDIO_SUBCLASS_AUDIOCONTROL 0x01U
7373
#define AUDIO_SUBCLASS_AUDIOSTREAMING 0x02U
74+
#define AUDIO_SUBCLASS_MIDISTREAMING 0x03U
7475
#define AUDIO_PROTOCOL_UNDEFINED 0x00U
7576
#define AUDIO_STREAMING_GENERAL 0x01U
7677
#define AUDIO_STREAMING_FORMAT_TYPE 0x02U

‎system/Middlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Src/usbd_audio.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ USBD_ClassTypeDef USBD_AUDIO =
162162
USBD_AUDIO_GetCfgDesc,
163163
USBD_AUDIO_GetDeviceQualifierDesc,
164164
#endif /* USE_USBD_COMPOSITE */
165+
#if (USBD_SUPPORT_USER_STRING_DESC == 1U)
166+
NULL,
167+
#endif /* USBD_SUPPORT_USER_STRING_DESC */
165168
};
166169

167170
#ifndef USE_USBD_COMPOSITE

‎system/Middlewares/ST/STM32_USB_Device_Library/Class/CCID/Inc/usbd_ccid.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ extern "C" {
6060
#define CCID_CMD_FS_BINTERVAL 0x10U
6161
#endif /* CCID_CMD_FS_BINTERVAL */
6262

63+
#ifndef CCID_CMD_PACKET_SIZE
64+
#define CCID_CMD_PACKET_SIZE 8U /* Control Endpoint Packet size */
65+
#endif /* CCID_CMD_PACKET_SIZE */
6366

6467
#define CCID_DATA_HS_MAX_PACKET_SIZE 512U /* Endpoint IN & OUT Packet size */
6568
#define CCID_DATA_FS_MAX_PACKET_SIZE 64U /* Endpoint IN & OUT Packet size */
66-
#define CCID_CMD_PACKET_SIZE 8U /* Control Endpoint Packet size */
6769

6870
#define USB_CCID_CONFIG_DESC_SIZ 93U
6971
#define CCID_DATA_HS_IN_PACKET_SIZE CCID_DATA_HS_MAX_PACKET_SIZE

‎system/Middlewares/ST/STM32_USB_Device_Library/Class/CCID/Src/usbd_ccid.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ USBD_ClassTypeDef USBD_CCID =
129129
USBD_CCID_GetOtherSpeedCfgDesc,
130130
USBD_CCID_GetDeviceQualifierDescriptor,
131131
#endif /* USE_USBD_COMPOSITE */
132+
#if (USBD_SUPPORT_USER_STRING_DESC == 1U)
133+
NULL,
134+
#endif /* USBD_SUPPORT_USER_STRING_DESC */
132135
};
133136

134137
#ifndef USE_USBD_COMPOSITE

‎system/Middlewares/ST/STM32_USB_Device_Library/Class/CCID/Src/usbd_ccid_cmd.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ static void CCID_UpdateCommandStatus(USBD_HandleTypeDef *pdev, uint8_t cmd_stat
4242
uint8_t PC_to_RDR_IccPowerOn(USBD_HandleTypeDef *pdev)
4343
{
4444
/* Apply the ICC VCC
45-
Fills the Response buffer with ICC ATR
46-
This Command is returned with RDR_to_PC_DataBlock();
47-
*/
48-
USBD_CCID_HandleTypeDef *hccid = (USBD_CCID_HandleTypeDef *)pdev->pClassDataCmsit[pdev->classId];
45+
* Fills the Response buffer with ICC ATR
46+
* This Command is returned with RDR_to_PC_DataBlock();
47+
*/
48+
USBD_CCID_HandleTypeDef *hccid = (USBD_CCID_HandleTypeDef *)pdev->pClassDataCmsit[pdev->classId];
4949
uint8_t voltage;
5050
uint8_t sc_voltage = 0U;
5151
uint8_t index;

‎system/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc/usbd_cdc.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,13 @@ extern "C" {
5858
#define CDC_FS_BINTERVAL 0x10U
5959
#endif /* CDC_FS_BINTERVAL */
6060

61+
#ifndef CDC_CMD_PACKET_SIZE
62+
#define CDC_CMD_PACKET_SIZE 8U /* Control Endpoint Packet size */
63+
#endif /* CDC_CMD_PACKET_SIZE */
64+
6165
/* CDC Endpoints parameters: you can fine tune these values depending on the needed baudrates and performance. */
6266
#define CDC_DATA_HS_MAX_PACKET_SIZE 512U /* Endpoint IN & OUT Packet size */
6367
#define CDC_DATA_FS_MAX_PACKET_SIZE 64U /* Endpoint IN & OUT Packet size */
64-
#define CDC_CMD_PACKET_SIZE 8U /* Control Endpoint Packet size */
6568

6669
#define USB_CDC_CONFIG_DESC_SIZ 67U
6770
#define CDC_DATA_HS_IN_PACKET_SIZE CDC_DATA_HS_MAX_PACKET_SIZE

‎system/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ USBD_ClassTypeDef USBD_CDC =
161161
USBD_CDC_GetOtherSpeedCfgDesc,
162162
USBD_CDC_GetDeviceQualifierDescriptor,
163163
#endif /* USE_USBD_COMPOSITE */
164+
#if (USBD_SUPPORT_USER_STRING_DESC == 1U)
165+
NULL,
166+
#endif /* USBD_SUPPORT_USER_STRING_DESC */
164167
};
165168

166169
#ifndef USE_USBD_COMPOSITE

‎system/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_ECM/Inc/usbd_cdc_ecm.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,17 @@ extern "C" {
6868
#define CDC_ECM_FS_BINTERVAL 0x10U
6969
#endif /* CDC_ECM_FS_BINTERVAL */
7070

71+
#ifndef CDC_ECM_CMD_PACKET_SIZE
72+
#define CDC_ECM_CMD_PACKET_SIZE 16U /* Control Endpoint Packet size */
73+
#endif /* CDC_ECM_CMD_PACKET_SIZE */
74+
7175
#ifndef USBD_SUPPORT_USER_STRING_DESC
7276
#define USBD_SUPPORT_USER_STRING_DESC 1U
7377
#endif /* USBD_SUPPORT_USER_STRING_DESC */
7478

7579
/* CDC_ECM Endpoints parameters: you can fine tune these values depending on the needed baudrates and performance. */
7680
#define CDC_ECM_DATA_HS_MAX_PACKET_SIZE 512U /* Endpoint IN & OUT Packet size */
7781
#define CDC_ECM_DATA_FS_MAX_PACKET_SIZE 64U /* Endpoint IN & OUT Packet size */
78-
#define CDC_ECM_CMD_PACKET_SIZE 16U /* Control Endpoint Packet size */
7982

8083
#define CDC_ECM_CONFIG_DESC_SIZ 79U
8184

0 commit comments

Comments
 (0)