mirror of
https://github.com/STMicroelectronics/stm32-mw-usb-device.git
synced 2026-02-08 20:18:07 -05:00
Release v2.11.5
This commit is contained in:
@@ -1,31 +1,46 @@
|
|||||||
## Contributing guide
|
# Contributing guide
|
||||||
This document serves as a checklist before contributing to this repository.
|
|
||||||
It includes links to read up on if topics are unclear to you.
|
|
||||||
|
|
||||||
This guide mainly focuses on the proper use of Git.
|
This guide mainly focuses on the steps to follow to submit an issue or a pull request.
|
||||||
|
|
||||||
### 1. Before opening an issue
|
## 1. Issues
|
||||||
Please check the following boxes before posting an issue:
|
|
||||||
- [ ] `Make sure you are using the latest commit (major releases are Tagged, but corrections are available as new commits).`
|
|
||||||
- [ ] `Make sure your issue is a question/feedback/suggestions RELATED TO the software provided in this repository.` Otherwise, it should be discussed on the [ST Community/STM32 MCUs forum](https://community.st.com/s/group/0F90X000000AXsASAW/stm32-mcus).
|
|
||||||
- [ ] `Make sure your issue is not already reported/fixed on GitHub or discussed on a previous issue.` Please refer to this [dashboard](https://github.com/orgs/STMicroelectronics/projects/5) for the list of issues and pull-requests. Do not forget to browse into the **closed** issues.
|
|
||||||
|
|
||||||
### 2. Posting the issue
|
### 1.1 Before opening an issue
|
||||||
When you have checked the previous boxes. You will find two templates (Bug Report or Other Issue) available in the **Issues** tab of the repository ([link](https://github.com/STMicroelectronics/stm32_mw_usb_device/issues/new/choose)).
|
|
||||||
|
Before posting an issue, please ensure:
|
||||||
|
* You are using the latest commit.
|
||||||
|
* Your issue is **not** a vulnerability. Otherwise, please refer to section [3](CONTRIBUTING.md#3-vulnerabilities) below.
|
||||||
|
* Your issue is **related to** the software provided in this repository. Otherwise, please refer to section [4](CONTRIBUTING.md#4-support-requests-and-miscellaneous) below.
|
||||||
|
* Your issue is not already reported, fixed or discussed in a previous one. Remember to browse the **closed** issues.
|
||||||
|
|
||||||
|
### 1.2 Posting the issue
|
||||||
|
|
||||||
|
When you have checked the previous points, create a new report from the **Issues** tab of this repository. A couple of templates are available [here](../../issues/new/choose).
|
||||||
|
|
||||||
|
## 2. Pull Requests
|
||||||
|
|
||||||
|
### 2.1 Before opening a pull request
|
||||||
|
|
||||||
### 3. Pull Requests
|
|
||||||
STMicrolectronics is happy to receive contributions from the community, based on an initial Contributor License Agreement (CLA) procedure.
|
STMicrolectronics is happy to receive contributions from the community, based on an initial Contributor License Agreement (CLA) procedure.
|
||||||
|
|
||||||
* If you are an individual writing original source code and you are sure **you own the intellectual property**, then you need to sign an Individual CLA (https://cla.st.com).
|
* If you are an individual writing original source code and you are sure **you own the intellectual property**, then you need to sign an **Individual** [CLA](https://cla.st.com).
|
||||||
* If you work for a company that wants also to allow you to contribute with your work, your company needs to provide a Corporate CLA (https://cla.st.com) mentioning your GitHub account name.
|
* If you work for a company that wants also to allow you to contribute with your work, your company needs to provide a **Corporate** [CLA](https://cla.st.com) mentioning your GitHub account name.
|
||||||
* If you are not sure that a CLA (Individual or Corporate) has been signed for your GitHub account you can check here (https://cla.st.com).
|
* If you are not sure that a CLA (Individual or Corporate) has been signed for your GitHub account you can check the [CLA](https://cla.st.com) dedicated page.
|
||||||
|
|
||||||
Please note that:
|
> [!IMPORTANT]
|
||||||
* The Corporate CLA will always take precedence over the Individual CLA.
|
> Please note that:
|
||||||
* One CLA submission is sufficient, for any project proposed by STMicroelectronics.
|
> * The Corporate CLA will always take precedence over the Individual CLA.
|
||||||
|
> * One CLA submission is sufficient, for any project proposed by STMicroelectronics.
|
||||||
|
|
||||||
#### How to proceed
|
### 2.2 How to proceed
|
||||||
|
|
||||||
* We recommend to engage first a communication thru an issue, in order to present your proposal. Just to confirm that it corresponds to STMicroelectronics domain or scope.
|
* We recommend to engage first a communication thru an issue, in order to present your proposal, just to confirm that it corresponds to STMicroelectronics' domain or scope.
|
||||||
* Then fork the project to your GitHub account to further develop your contribution. Please use the latest commit version.
|
* Then fork the project to your GitHub account to further develop your contribution. Please use the latest commit version.
|
||||||
* Please, submit one Pull Request for one new feature or proposal. This will ease the analysis and the final merge if accepted.
|
* Please, submit one pull request per new feature or proposal. This will ease the analysis and the final merge if accepted.
|
||||||
|
|
||||||
|
## 3. Vulnerabilities
|
||||||
|
|
||||||
|
To report a **vulnerability**, please refer to the [SECURITY.md](./SECURITY.md) file for instructions.
|
||||||
|
|
||||||
|
## 4. Support requests and miscellaneous
|
||||||
|
|
||||||
|
For support requests or any other topics not related to the content of this repository, you can submit a post to the **ST Community** on the appropriate topic [page](https://community.st.com/s/topiccatalog).
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ extern "C" {
|
|||||||
#define USB_DEVICE_CLASS_AUDIO 0x01U
|
#define USB_DEVICE_CLASS_AUDIO 0x01U
|
||||||
#define AUDIO_SUBCLASS_AUDIOCONTROL 0x01U
|
#define AUDIO_SUBCLASS_AUDIOCONTROL 0x01U
|
||||||
#define AUDIO_SUBCLASS_AUDIOSTREAMING 0x02U
|
#define AUDIO_SUBCLASS_AUDIOSTREAMING 0x02U
|
||||||
|
#define AUDIO_SUBCLASS_MIDISTREAMING 0x03U
|
||||||
#define AUDIO_PROTOCOL_UNDEFINED 0x00U
|
#define AUDIO_PROTOCOL_UNDEFINED 0x00U
|
||||||
#define AUDIO_STREAMING_GENERAL 0x01U
|
#define AUDIO_STREAMING_GENERAL 0x01U
|
||||||
#define AUDIO_STREAMING_FORMAT_TYPE 0x02U
|
#define AUDIO_STREAMING_FORMAT_TYPE 0x02U
|
||||||
|
|||||||
@@ -162,6 +162,9 @@ USBD_ClassTypeDef USBD_AUDIO =
|
|||||||
USBD_AUDIO_GetCfgDesc,
|
USBD_AUDIO_GetCfgDesc,
|
||||||
USBD_AUDIO_GetDeviceQualifierDesc,
|
USBD_AUDIO_GetDeviceQualifierDesc,
|
||||||
#endif /* USE_USBD_COMPOSITE */
|
#endif /* USE_USBD_COMPOSITE */
|
||||||
|
#if (USBD_SUPPORT_USER_STRING_DESC == 1U)
|
||||||
|
NULL,
|
||||||
|
#endif /* USBD_SUPPORT_USER_STRING_DESC */
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef USE_USBD_COMPOSITE
|
#ifndef USE_USBD_COMPOSITE
|
||||||
|
|||||||
@@ -129,6 +129,9 @@ USBD_ClassTypeDef USBD_CCID =
|
|||||||
USBD_CCID_GetOtherSpeedCfgDesc,
|
USBD_CCID_GetOtherSpeedCfgDesc,
|
||||||
USBD_CCID_GetDeviceQualifierDescriptor,
|
USBD_CCID_GetDeviceQualifierDescriptor,
|
||||||
#endif /* USE_USBD_COMPOSITE */
|
#endif /* USE_USBD_COMPOSITE */
|
||||||
|
#if (USBD_SUPPORT_USER_STRING_DESC == 1U)
|
||||||
|
NULL,
|
||||||
|
#endif /* USBD_SUPPORT_USER_STRING_DESC */
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef USE_USBD_COMPOSITE
|
#ifndef USE_USBD_COMPOSITE
|
||||||
|
|||||||
@@ -161,6 +161,9 @@ USBD_ClassTypeDef USBD_CDC =
|
|||||||
USBD_CDC_GetOtherSpeedCfgDesc,
|
USBD_CDC_GetOtherSpeedCfgDesc,
|
||||||
USBD_CDC_GetDeviceQualifierDescriptor,
|
USBD_CDC_GetDeviceQualifierDescriptor,
|
||||||
#endif /* USE_USBD_COMPOSITE */
|
#endif /* USE_USBD_COMPOSITE */
|
||||||
|
#if (USBD_SUPPORT_USER_STRING_DESC == 1U)
|
||||||
|
NULL,
|
||||||
|
#endif /* USBD_SUPPORT_USER_STRING_DESC */
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef USE_USBD_COMPOSITE
|
#ifndef USE_USBD_COMPOSITE
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ USBD_ClassTypeDef USBD_CUSTOM_HID =
|
|||||||
#endif /* USE_USBD_COMPOSITE */
|
#endif /* USE_USBD_COMPOSITE */
|
||||||
#if (USBD_SUPPORT_USER_STRING_DESC == 1U)
|
#if (USBD_SUPPORT_USER_STRING_DESC == 1U)
|
||||||
NULL,
|
NULL,
|
||||||
#endif
|
#endif /* USBD_SUPPORT_USER_STRING_DESC */
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef USE_USBD_COMPOSITE
|
#ifndef USE_USBD_COMPOSITE
|
||||||
|
|||||||
@@ -940,6 +940,12 @@ static void DFU_Download(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
|
|||||||
if ((hdfu->dev_state == DFU_STATE_DNLOAD_IDLE) || (hdfu->dev_state == DFU_STATE_IDLE))
|
if ((hdfu->dev_state == DFU_STATE_DNLOAD_IDLE) || (hdfu->dev_state == DFU_STATE_IDLE))
|
||||||
{
|
{
|
||||||
#if (USBD_DFU_VENDOR_CHECK_ENABLED == 1U)
|
#if (USBD_DFU_VENDOR_CHECK_ENABLED == 1U)
|
||||||
|
/* Fill the buffer to be checked with the address stored in data buffer */
|
||||||
|
hdfu->buffer.d8[1] = (uint8_t)(hdfu->data_ptr & 0xFFU);
|
||||||
|
hdfu->buffer.d8[2] = (uint8_t)((hdfu->data_ptr & 0xFF00U) >> 8U);
|
||||||
|
hdfu->buffer.d8[3] = (uint8_t)((hdfu->data_ptr & 0xFF0000U) >> 16U);
|
||||||
|
hdfu->buffer.d8[4] = (uint8_t)((hdfu->data_ptr & 0xFF000000U) >> 24U);
|
||||||
|
|
||||||
if (DfuInterface->VendorCheck(hdfu->buffer.d8, IS_DFU_SETADDRESSPOINTER, &VendorStatus) != USBD_OK)
|
if (DfuInterface->VendorCheck(hdfu->buffer.d8, IS_DFU_SETADDRESSPOINTER, &VendorStatus) != USBD_OK)
|
||||||
{
|
{
|
||||||
/* Update the state machine */
|
/* Update the state machine */
|
||||||
|
|||||||
@@ -128,6 +128,9 @@ USBD_ClassTypeDef USBD_HID =
|
|||||||
USBD_HID_GetOtherSpeedCfgDesc,
|
USBD_HID_GetOtherSpeedCfgDesc,
|
||||||
USBD_HID_GetDeviceQualifierDesc,
|
USBD_HID_GetDeviceQualifierDesc,
|
||||||
#endif /* USE_USBD_COMPOSITE */
|
#endif /* USE_USBD_COMPOSITE */
|
||||||
|
#if (USBD_SUPPORT_USER_STRING_DESC == 1U)
|
||||||
|
NULL,
|
||||||
|
#endif /* USBD_SUPPORT_USER_STRING_DESC */
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef USE_USBD_COMPOSITE
|
#ifndef USE_USBD_COMPOSITE
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ USBD_ClassTypeDef USBD_MSC =
|
|||||||
#endif /* USE_USBD_COMPOSITE */
|
#endif /* USE_USBD_COMPOSITE */
|
||||||
#if (USBD_SUPPORT_USER_STRING_DESC == 1U)
|
#if (USBD_SUPPORT_USER_STRING_DESC == 1U)
|
||||||
NULL,
|
NULL,
|
||||||
#endif
|
#endif /* USBD_SUPPORT_USER_STRING_DESC */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* USB Mass storage device Configuration Descriptor */
|
/* USB Mass storage device Configuration Descriptor */
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ extern "C" {
|
|||||||
* Appendix C. Device Properties
|
* Appendix C. Device Properties
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* MTP device properties code*/
|
/* MTP device properties code */
|
||||||
#define MTP_DEV_PROP_UNDEFINED 0x5000U
|
#define MTP_DEV_PROP_UNDEFINED 0x5000U
|
||||||
#define MTP_DEV_PROP_BATTERY_LEVEL 0x5001U
|
#define MTP_DEV_PROP_BATTERY_LEVEL 0x5001U
|
||||||
#define MTP_DEV_PROP_FUNCTIONAL_MODE 0x5002U
|
#define MTP_DEV_PROP_FUNCTIONAL_MODE 0x5002U
|
||||||
@@ -336,7 +336,7 @@ extern "C" {
|
|||||||
#define MTP_CONT_TYPE_EVENT 4U
|
#define MTP_CONT_TYPE_EVENT 4U
|
||||||
|
|
||||||
#ifndef MTP_STORAGE_ID
|
#ifndef MTP_STORAGE_ID
|
||||||
#define MTP_STORAGE_ID 0x00010001U /* SD card is inserted*/
|
#define MTP_STORAGE_ID 0x00010001U /* SD card is inserted */
|
||||||
#endif /* MTP_STORAGE_ID */
|
#endif /* MTP_STORAGE_ID */
|
||||||
|
|
||||||
#define MTP_NBR_STORAGE_ID 1U
|
#define MTP_NBR_STORAGE_ID 1U
|
||||||
|
|||||||
@@ -53,15 +53,16 @@ extern "C" {
|
|||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
DATA_TYPE = 0x00,
|
DATA_TYPE = 0x00U,
|
||||||
REP_TYPE = 0x01,
|
REP_TYPE = 0x01U,
|
||||||
} MTP_CONTAINER_TYPE;
|
} MTP_CONTAINER_TYPE;
|
||||||
|
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
READ_FIRST_DATA = 0x00,
|
READ_FIRST_DATA = 0x00U,
|
||||||
READ_REST_OF_DATA = 0x01,
|
READ_REST_OF_DATA = 0x01U,
|
||||||
|
READ_SEND_ZLP_DATA = 0x02U
|
||||||
} MTP_READ_DATA_STATUS;
|
} MTP_READ_DATA_STATUS;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -128,6 +128,9 @@ USBD_ClassTypeDef USBD_MTP =
|
|||||||
USBD_MTP_GetOtherSpeedCfgDesc,
|
USBD_MTP_GetOtherSpeedCfgDesc,
|
||||||
USBD_MTP_GetDeviceQualifierDescriptor,
|
USBD_MTP_GetDeviceQualifierDescriptor,
|
||||||
#endif /* USE_USBD_COMPOSITE */
|
#endif /* USE_USBD_COMPOSITE */
|
||||||
|
#if (USBD_SUPPORT_USER_STRING_DESC == 1U)
|
||||||
|
NULL,
|
||||||
|
#endif /* USBD_SUPPORT_USER_STRING_DESC */
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef USE_USBD_COMPOSITE
|
#ifndef USE_USBD_COMPOSITE
|
||||||
|
|||||||
@@ -537,50 +537,30 @@ static void MTP_Get_PayloadContent(USBD_HandleTypeDef *pdev)
|
|||||||
{
|
{
|
||||||
USBD_MTP_HandleTypeDef *hmtp = (USBD_MTP_HandleTypeDef *)pdev->pClassDataCmsit[pdev->classId];
|
USBD_MTP_HandleTypeDef *hmtp = (USBD_MTP_HandleTypeDef *)pdev->pClassDataCmsit[pdev->classId];
|
||||||
USBD_MTP_ItfTypeDef *hmtpif = (USBD_MTP_ItfTypeDef *)pdev->pUserData[pdev->classId];
|
USBD_MTP_ItfTypeDef *hmtpif = (USBD_MTP_ItfTypeDef *)pdev->pUserData[pdev->classId];
|
||||||
uint8_t *buffer = hmtp->GenericContainer.data;
|
uint8_t *buffer;
|
||||||
uint32_t i;
|
|
||||||
uint32_t n_idx;
|
uint32_t n_idx;
|
||||||
|
|
||||||
switch (hmtp->OperationsContainer.code)
|
switch (hmtp->OperationsContainer.code)
|
||||||
{
|
{
|
||||||
case MTP_OP_GET_DEVICE_INFO:
|
case MTP_OP_GET_DEVICE_INFO:
|
||||||
(void)MTP_Get_DeviceInfo();
|
(void)MTP_Get_DeviceInfo();
|
||||||
(void)USBD_memcpy(buffer, (const uint8_t *)&MTP_DeviceInfo, sizeof(MTP_DeviceInfo));
|
(void)USBD_memcpy(hmtp->GenericContainer.data, (const uint8_t *)&MTP_DeviceInfo,
|
||||||
|
MIN(sizeof(MTP_DeviceInfo), MTP_MEDIA_PACKET));
|
||||||
for (i = 0U; i < sizeof(MTP_StorageIDS); i++)
|
|
||||||
{
|
|
||||||
hmtp->GenericContainer.data[i] = buffer[i];
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MTP_OP_GET_STORAGE_IDS:
|
case MTP_OP_GET_STORAGE_IDS:
|
||||||
(void)MTP_Get_StorageIDS();
|
(void)MTP_Get_StorageIDS();
|
||||||
(void)USBD_memcpy(buffer, (const uint8_t *)&MTP_StorageIDS, sizeof(MTP_StorageIDS));
|
(void)USBD_memcpy(hmtp->GenericContainer.data, (const uint8_t *)&MTP_StorageIDS, sizeof(MTP_StorageIDS));
|
||||||
|
|
||||||
for (i = 0U; i < sizeof(MTP_StorageIDS); i++)
|
|
||||||
{
|
|
||||||
hmtp->GenericContainer.data[i] = buffer[i];
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MTP_OP_GET_STORAGE_INFO:
|
case MTP_OP_GET_STORAGE_INFO:
|
||||||
(void)MTP_Get_StorageInfo(pdev);
|
(void)MTP_Get_StorageInfo(pdev);
|
||||||
(void)USBD_memcpy(buffer, (const uint8_t *)&MTP_StorageInfo, sizeof(MTP_StorageInfo));
|
(void)USBD_memcpy(hmtp->GenericContainer.data, (const uint8_t *)&MTP_StorageInfo, sizeof(MTP_StorageInfo));
|
||||||
|
|
||||||
for (i = 0U; i < sizeof(MTP_StorageInfo); i++)
|
|
||||||
{
|
|
||||||
hmtp->GenericContainer.data[i] = buffer[i];
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MTP_OP_GET_OBJECT_HANDLES:
|
case MTP_OP_GET_OBJECT_HANDLES:
|
||||||
(void)MTP_Get_ObjectHandle(pdev);
|
(void)MTP_Get_ObjectHandle(pdev);
|
||||||
(void)USBD_memcpy(buffer, (const uint8_t *)&MTP_ObjectHandle, hmtp->ResponseLength);
|
(void)USBD_memcpy(hmtp->GenericContainer.data, (const uint8_t *)&MTP_ObjectHandle, hmtp->ResponseLength);
|
||||||
|
|
||||||
for (i = 0U; i < hmtp->ResponseLength; i++)
|
|
||||||
{
|
|
||||||
hmtp->GenericContainer.data[i] = buffer[i];
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MTP_OP_GET_OBJECT_INFO:
|
case MTP_OP_GET_OBJECT_INFO:
|
||||||
@@ -589,12 +569,7 @@ static void MTP_Get_PayloadContent(USBD_HandleTypeDef *pdev)
|
|||||||
|
|
||||||
case MTP_OP_GET_OBJECT_PROPS_SUPPORTED:
|
case MTP_OP_GET_OBJECT_PROPS_SUPPORTED:
|
||||||
(void)MTP_Get_ObjectPropSupp();
|
(void)MTP_Get_ObjectPropSupp();
|
||||||
(void)USBD_memcpy(buffer, (const uint8_t *)&MTP_ObjectPropSupp, sizeof(MTP_ObjectPropSupp));
|
(void)USBD_memcpy(hmtp->GenericContainer.data, (const uint8_t *)&MTP_ObjectPropSupp, sizeof(MTP_ObjectPropSupp));
|
||||||
|
|
||||||
for (i = 0U; i < sizeof(MTP_ObjectPropSupp); i++)
|
|
||||||
{
|
|
||||||
hmtp->GenericContainer.data[i] = buffer[i];
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MTP_OP_GET_OBJECT_PROP_DESC:
|
case MTP_OP_GET_OBJECT_PROP_DESC:
|
||||||
@@ -604,12 +579,7 @@ static void MTP_Get_PayloadContent(USBD_HandleTypeDef *pdev)
|
|||||||
|
|
||||||
case MTP_OP_GET_OBJECT_PROP_REFERENCES:
|
case MTP_OP_GET_OBJECT_PROP_REFERENCES:
|
||||||
MTP_Ref.ref_len = 0U;
|
MTP_Ref.ref_len = 0U;
|
||||||
(void)USBD_memcpy(buffer, (const uint8_t *)&MTP_Ref.ref_len, sizeof(MTP_Ref.ref_len));
|
(void)USBD_memcpy(hmtp->GenericContainer.data, (const uint8_t *)&MTP_Ref.ref_len, sizeof(MTP_Ref.ref_len));
|
||||||
|
|
||||||
for (i = 0U; i < sizeof(MTP_Ref.ref_len); i++)
|
|
||||||
{
|
|
||||||
hmtp->GenericContainer.data[i] = buffer[i];
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MTP_OP_GET_OBJECT_PROPLIST:
|
case MTP_OP_GET_OBJECT_PROPLIST:
|
||||||
@@ -618,20 +588,13 @@ static void MTP_Get_PayloadContent(USBD_HandleTypeDef *pdev)
|
|||||||
|
|
||||||
case MTP_OP_GET_OBJECT_PROP_VALUE:
|
case MTP_OP_GET_OBJECT_PROP_VALUE:
|
||||||
buffer = MTP_Get_ObjectPropValue(pdev);
|
buffer = MTP_Get_ObjectPropValue(pdev);
|
||||||
for (i = 0U; i < hmtp->ResponseLength; i++)
|
(void)USBD_memcpy(hmtp->GenericContainer.data, (const uint8_t *)buffer, hmtp->ResponseLength);
|
||||||
{
|
|
||||||
hmtp->GenericContainer.data[i] = buffer[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MTP_OP_GET_DEVICE_PROP_DESC:
|
case MTP_OP_GET_DEVICE_PROP_DESC:
|
||||||
(void)MTP_Get_DevicePropDesc();
|
(void)MTP_Get_DevicePropDesc();
|
||||||
(void)USBD_memcpy(buffer, (const uint8_t *)&MTP_DevicePropDesc, sizeof(MTP_DevicePropDesc));
|
(void)USBD_memcpy(hmtp->GenericContainer.data, (const uint8_t *)&MTP_DevicePropDesc,
|
||||||
for (i = 0U; i < sizeof(MTP_DevicePropDesc); i++)
|
MIN(sizeof(MTP_DevicePropDesc), MTP_MEDIA_PACKET));
|
||||||
{
|
|
||||||
hmtp->GenericContainer.data[i] = buffer[i];
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MTP_OP_SEND_OBJECT_INFO:
|
case MTP_OP_SEND_OBJECT_INFO:
|
||||||
@@ -837,7 +800,7 @@ static void MTP_Get_ObjectPropDesc(USBD_HandleTypeDef *pdev)
|
|||||||
|
|
||||||
case MTP_OB_PROP_PARENT_OBJECT :
|
case MTP_OB_PROP_PARENT_OBJECT :
|
||||||
MTP_ObjectPropDesc.ObjectPropertyCode = (uint16_t)(hmtp->OperationsContainer.Param1);
|
MTP_ObjectPropDesc.ObjectPropertyCode = (uint16_t)(hmtp->OperationsContainer.Param1);
|
||||||
MTP_ObjectPropDesc.DataType = MTP_DATATYPE_STR;
|
MTP_ObjectPropDesc.DataType = MTP_DATATYPE_UINT32;
|
||||||
MTP_ObjectPropDesc.GetSet = MTP_PROP_GET;
|
MTP_ObjectPropDesc.GetSet = MTP_PROP_GET;
|
||||||
MTP_ObjectPropDesc.DefValue = 0U;
|
MTP_ObjectPropDesc.DefValue = 0U;
|
||||||
MTP_ObjectPropDesc.GroupCode = 0U;
|
MTP_ObjectPropDesc.GroupCode = 0U;
|
||||||
@@ -951,8 +914,8 @@ static uint8_t *MTP_Get_ObjectPropValue(USBD_HandleTypeDef *pdev)
|
|||||||
*/
|
*/
|
||||||
static void MTP_Get_ObjectPropList(USBD_HandleTypeDef *pdev)
|
static void MTP_Get_ObjectPropList(USBD_HandleTypeDef *pdev)
|
||||||
{
|
{
|
||||||
USBD_MTP_HandleTypeDef *hmtp = (USBD_MTP_HandleTypeDef *)pdev->pClassDataCmsit[pdev->classId];
|
USBD_MTP_HandleTypeDef *hmtp = (USBD_MTP_HandleTypeDef *)pdev->pClassDataCmsit[pdev->classId];
|
||||||
USBD_MTP_ItfTypeDef *hmtpif = (USBD_MTP_ItfTypeDef *)pdev->pUserData[pdev->classId];
|
USBD_MTP_ItfTypeDef *hmtpif = (USBD_MTP_ItfTypeDef *)pdev->pUserData[pdev->classId];
|
||||||
uint16_t filename[255];
|
uint16_t filename[255];
|
||||||
uint32_t storageid = MTP_STORAGE_ID;
|
uint32_t storageid = MTP_STORAGE_ID;
|
||||||
uint32_t default_val = 0U;
|
uint32_t default_val = 0U;
|
||||||
@@ -960,6 +923,7 @@ static void MTP_Get_ObjectPropList(USBD_HandleTypeDef *pdev)
|
|||||||
uint16_t format;
|
uint16_t format;
|
||||||
uint64_t objsize;
|
uint64_t objsize;
|
||||||
uint32_t parent_proval;
|
uint32_t parent_proval;
|
||||||
|
uint8_t mtp_pers_uniq_obj_id[16] = {0};
|
||||||
|
|
||||||
MTP_PropertiesList.MTP_Properties_len = SUPP_OBJ_PROP_LEN;
|
MTP_PropertiesList.MTP_Properties_len = SUPP_OBJ_PROP_LEN;
|
||||||
hmtp->ResponseLength = 4U; /* size of MTP_PropertiesList.MTP_Properties_len */
|
hmtp->ResponseLength = 4U; /* size of MTP_PropertiesList.MTP_Properties_len */
|
||||||
@@ -1020,9 +984,13 @@ static void MTP_Get_ObjectPropList(USBD_HandleTypeDef *pdev)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MTP_OB_PROP_PERS_UNIQ_OBJ_IDEN :
|
case MTP_OB_PROP_PERS_UNIQ_OBJ_IDEN :
|
||||||
|
/* Fill in the first 4 bytes with Param1 (Object ID) */
|
||||||
|
(void)USBD_memcpy(mtp_pers_uniq_obj_id, &hmtp->OperationsContainer.Param1,
|
||||||
|
sizeof(hmtp->OperationsContainer.Param1));
|
||||||
|
|
||||||
MTP_PropertiesList.MTP_Properties[i].PropertyCode = MTP_OB_PROP_PERS_UNIQ_OBJ_IDEN;
|
MTP_PropertiesList.MTP_Properties[i].PropertyCode = MTP_OB_PROP_PERS_UNIQ_OBJ_IDEN;
|
||||||
MTP_PropertiesList.MTP_Properties[i].Datatype = MTP_DATATYPE_UINT128;
|
MTP_PropertiesList.MTP_Properties[i].Datatype = MTP_DATATYPE_UINT128;
|
||||||
MTP_PropertiesList.MTP_Properties[i].propval = (uint8_t *)&hmtp->OperationsContainer.Param1;
|
MTP_PropertiesList.MTP_Properties[i].propval = (uint8_t *)mtp_pers_uniq_obj_id;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MTP_OB_PROP_PROTECTION_STATUS :
|
case MTP_OB_PROP_PROTECTION_STATUS :
|
||||||
@@ -1187,7 +1155,8 @@ static uint32_t MTP_build_data_proplist(USBD_HandleTypeDef *pdev,
|
|||||||
MTP_PropertiesListTypedef proplist, uint32_t idx)
|
MTP_PropertiesListTypedef proplist, uint32_t idx)
|
||||||
{
|
{
|
||||||
USBD_MTP_HandleTypeDef *hmtp = (USBD_MTP_HandleTypeDef *)pdev->pClassDataCmsit[pdev->classId];
|
USBD_MTP_HandleTypeDef *hmtp = (USBD_MTP_HandleTypeDef *)pdev->pClassDataCmsit[pdev->classId];
|
||||||
uint8_t propval_size = (MTP_FileName.FileName_len * 2U) + 1U;
|
uint8_t *propval = proplist.MTP_Properties[idx].propval;
|
||||||
|
uint8_t propval_size = (propval[0] * 2U) + 1U;
|
||||||
uint32_t dataLength;
|
uint32_t dataLength;
|
||||||
|
|
||||||
dataLength = offsetof(MTP_PropertiesTypedef, propval);
|
dataLength = offsetof(MTP_PropertiesTypedef, propval);
|
||||||
|
|||||||
@@ -152,11 +152,19 @@ uint8_t USBD_MTP_STORAGE_ReadData(USBD_HandleTypeDef *pdev)
|
|||||||
/* Start USB data transmission to the host */
|
/* Start USB data transmission to the host */
|
||||||
(void)USBD_MTP_STORAGE_SendData(pdev, (uint8_t *)data_buff, MIN(MTP_DataLength.readbytes, buffer_size));
|
(void)USBD_MTP_STORAGE_SendData(pdev, (uint8_t *)data_buff, MIN(MTP_DataLength.readbytes, buffer_size));
|
||||||
|
|
||||||
/* Move to response phase */
|
if (((MTP_DataLength.totallen + MTP_CONT_HEADER_SIZE) % hmtp->MaxPcktLen) == 0U)
|
||||||
hmtp->MTP_ResponsePhase = MTP_RESPONSE_PHASE;
|
{
|
||||||
|
/* Send ZLP Packet */
|
||||||
|
ReadDataStatus = READ_SEND_ZLP_DATA;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Move to response phase */
|
||||||
|
hmtp->MTP_ResponsePhase = MTP_RESPONSE_PHASE;
|
||||||
|
|
||||||
/* Reset the state machine */
|
/* Reset the state machine */
|
||||||
ReadDataStatus = READ_FIRST_DATA;
|
ReadDataStatus = READ_FIRST_DATA;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -168,6 +176,19 @@ uint8_t USBD_MTP_STORAGE_ReadData(USBD_HandleTypeDef *pdev)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case READ_SEND_ZLP_DATA:
|
||||||
|
|
||||||
|
/* Send ZLP to the host */
|
||||||
|
(void)USBD_MTP_STORAGE_SendData(pdev, (uint8_t *)data_buff, 0U);
|
||||||
|
|
||||||
|
/* Move to response phase */
|
||||||
|
hmtp->MTP_ResponsePhase = MTP_RESPONSE_PHASE;
|
||||||
|
|
||||||
|
/* Reset the state machine */
|
||||||
|
ReadDataStatus = READ_FIRST_DATA;
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,6 +141,9 @@ USBD_ClassTypeDef USBD_PRNT =
|
|||||||
USBD_PRNT_GetOtherSpeedCfgDesc,
|
USBD_PRNT_GetOtherSpeedCfgDesc,
|
||||||
USBD_PRNT_GetDeviceQualifierDescriptor,
|
USBD_PRNT_GetDeviceQualifierDescriptor,
|
||||||
#endif /* USE_USBD_COMPOSITE */
|
#endif /* USE_USBD_COMPOSITE */
|
||||||
|
#if (USBD_SUPPORT_USER_STRING_DESC == 1U)
|
||||||
|
NULL,
|
||||||
|
#endif /* USBD_SUPPORT_USER_STRING_DESC */
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef USE_USBD_COMPOSITE
|
#ifndef USE_USBD_COMPOSITE
|
||||||
|
|||||||
@@ -140,6 +140,9 @@ USBD_ClassTypeDef USBD_VIDEO =
|
|||||||
USBD_VIDEO_GetOtherSpeedCfgDesc,
|
USBD_VIDEO_GetOtherSpeedCfgDesc,
|
||||||
USBD_VIDEO_GetDeviceQualifierDesc,
|
USBD_VIDEO_GetDeviceQualifierDesc,
|
||||||
#endif /* USE_USBD_COMPOSITE */
|
#endif /* USE_USBD_COMPOSITE */
|
||||||
|
#if (USBD_SUPPORT_USER_STRING_DESC == 1U)
|
||||||
|
NULL,
|
||||||
|
#endif /* USBD_SUPPORT_USER_STRING_DESC */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* USB VIDEO device Configuration Descriptor (same for all speeds thanks to user defines) */
|
/* USB VIDEO device Configuration Descriptor (same for all speeds thanks to user defines) */
|
||||||
|
|||||||
134
LICENSE.md
134
LICENSE.md
@@ -1,80 +1,94 @@
|
|||||||
SLA0044 Rev5/February 2018
|
This software component is provided to you as part of a software package and
|
||||||
|
applicable license terms are in the Package_license file. If you received this
|
||||||
|
software component outside of a package or without applicable license terms,
|
||||||
|
the terms of the SLA0044 license shall apply and are fully reproduced below:
|
||||||
|
|
||||||
|
SLA0044 Rev6/October 2025
|
||||||
|
|
||||||
## Software license agreement
|
## Software license agreement
|
||||||
|
|
||||||
### __ULTIMATE LIBERTY SOFTWARE LICENSE AGREEMENT__
|
### __ULTIMATE LIBERTY SOFTWARE LICENSE AGREEMENT__
|
||||||
|
|
||||||
BY INSTALLING, COPYING, DOWNLOADING, ACCESSING OR OTHERWISE USING THIS SOFTWARE
|
BY CLICKING ON THE "I ACCEPT" BUTTON OR BY UNZIPPING, INSTALLING, COPYING,
|
||||||
OR ANY PART THEREOF (AND THE RELATED DOCUMENTATION) FROM STMICROELECTRONICS
|
DOWNLOADING, ACCESSING OR OTHERWISE USING THIS SOFTWARE OR ANY PART THEREOF,
|
||||||
INTERNATIONAL N.V, SWISS BRANCH AND/OR ITS AFFILIATED COMPANIES
|
INCLUDING ANY RELATED DOCUMENTATION (collectively the “SOFTWARE”)
|
||||||
(STMICROELECTRONICS), THE RECIPIENT, ON BEHALF OF HIMSELF OR HERSELF, OR ON
|
FROM STMICROELECTRONICS INTERNATIONAL N.V, SWISS BRANCH AND/OR
|
||||||
BEHALF OF ANY ENTITY BY WHICH SUCH RECIPIENT IS EMPLOYED AND/OR ENGAGED AGREES
|
ITS AFFILIATED COMPANIES (collectively “STMICROELECTRONICS”),
|
||||||
TO BE BOUND BY THIS SOFTWARE LICENSE AGREEMENT.
|
YOU (hereinafter referred also to as “THE RECIPIENT”), ON BEHALF OF YOURSELF,
|
||||||
|
OR ON BEHALF OF ANY ENTITY BY WHICH YOU ARE EMPLOYED AND/OR ENGAGED,
|
||||||
|
AGREE TO BE BOUND BY THIS AGREEMENT.
|
||||||
|
|
||||||
Under STMicroelectronics’ intellectual property rights, the redistribution,
|
Under STMICROELECTRONICS’ intellectual property rights, the redistribution,
|
||||||
reproduction and use in source and binary forms of the software or any part
|
reproduction and use in source and binary forms of the SOFTWARE or any part
|
||||||
thereof, with or without modification, are permitted provided that the following
|
thereof, with or without modification, are permitted provided that the following
|
||||||
conditions are met:
|
conditions are met:
|
||||||
|
|
||||||
1. Redistribution of source code (modified or not) must retain any copyright
|
1. Redistribution of source code (modified or not) must retain any copyright
|
||||||
notice, this list of conditions and the disclaimer set forth below as items 10
|
notice accompanying the SOFTWARE, this list of conditions and the disclaimer below.
|
||||||
and 11.
|
|
||||||
|
|
||||||
2. Redistributions in binary form, except as embedded into microcontroller or
|
2. Redistributions in binary form, except as embedded into a processing unit device
|
||||||
microprocessor device manufactured by or for STMicroelectronics or a software
|
manufactured by or for STMicroelectronics or a software update for any such device,
|
||||||
update for such device, must reproduce any copyright notice provided with the
|
must reproduce the accompanying copyright notice, this list of conditions,
|
||||||
binary code, this list of conditions, and the disclaimer set forth below as
|
and the below disclaimer in capital type, in the documentation and/or
|
||||||
items 10 and 11, in documentation and/or other materials provided with the
|
other materials provided with the distribution.
|
||||||
distribution.
|
|
||||||
|
|
||||||
3. Neither the name of STMicroelectronics nor the names of other contributors to
|
3. Neither the name of STMicroelectronics nor the names of other contributors
|
||||||
this software may be used to endorse or promote products derived from this
|
to the SOFTWARE may be used to endorse or promote products derived
|
||||||
software or part thereof without specific written permission.
|
from the SOFTWARE or part thereof without specific written permission.
|
||||||
|
|
||||||
4. This software or any part thereof, including modifications and/or derivative
|
4. The SOFTWARE or any part thereof, including modifications and/or
|
||||||
works of this software, must be used and execute solely and exclusively on or in
|
derivative works of the SOFTWARE, must be used and execute solely
|
||||||
combination with a microcontroller or microprocessor device manufactured by or
|
and exclusively on or in combination with a processing unit device
|
||||||
for STMicroelectronics.
|
manufactured by or for STMicroelectronics.
|
||||||
|
|
||||||
5. No use, reproduction or redistribution of this software partially or totally
|
5. No use, reproduction or redistribution of the SOFTWARE partially
|
||||||
may be done in any manner that would subject this software to any Open Source
|
or totally may be done in any manner that would subject the SOFTWARE
|
||||||
Terms. “Open Source Terms” shall mean any open source license which requires as
|
to any Open Source Terms. “Open Source Terms” shall mean
|
||||||
part of distribution of software that the source code of such software is
|
any open source license which requires as part of distribution
|
||||||
distributed therewith or otherwise made available, or open source license that
|
of software that the source code of such software is distributed
|
||||||
substantially complies with the Open Source definition specified at
|
therewith or otherwise made available, or open source license
|
||||||
www.opensource.org and any other comparable open source license such as for
|
that substantially complies with the Open Source definition specified
|
||||||
example GNU General Public License (GPL), Eclipse Public License (EPL), Apache
|
at www.opensource.org and any other comparable open source license
|
||||||
Software License, BSD license or MIT license.
|
such as for example GNU General Public License (GPL),
|
||||||
|
Eclipse Public License (EPL), Apache Software License, BSD license
|
||||||
|
or MIT license.
|
||||||
|
|
||||||
6. STMicroelectronics has no obligation to provide any maintenance, support or
|
6. STMicroelectronics has no obligation to provide any maintenance,
|
||||||
updates for the software.
|
support or updates for the SOFTWARE.
|
||||||
|
|
||||||
7. The software is and will remain the exclusive property of STMicroelectronics
|
7. The SOFTWARE is and will remain the exclusive property of
|
||||||
and its licensors. The recipient will not take any action that jeopardizes
|
STMicroelectronics and its licensors. The RECIPIENT will not take
|
||||||
STMicroelectronics and its licensors' proprietary rights or acquire any rights
|
any action that jeopardizes STMicroelectronics and its
|
||||||
in the software, except the limited rights specified hereunder.
|
licensors' proprietary rights or acquire any rights in the SOFTWARE,
|
||||||
|
except the limited rights specified hereunder.
|
||||||
|
|
||||||
8. The recipient shall comply with all applicable laws and regulations affecting
|
8. The RECIPIENT shall comply with all applicable laws and regulations
|
||||||
the use of the software or any part thereof including any applicable export
|
affecting the use of the SOFTWARE or any part thereof including
|
||||||
control law or regulation.
|
any applicable export control law or regulation.
|
||||||
|
|
||||||
9. Redistribution and use of this software or any part thereof other than as
|
9. Redistribution and use of the SOFTWARE or any part thereof other
|
||||||
permitted under this license is void and will automatically terminate your
|
than as permitted under this AGREEMENT is void and will automatically
|
||||||
rights under this license.
|
terminate RECIPIENT’s rights under this AGREEMENT.
|
||||||
|
|
||||||
10. THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" AND
|
10. The RECIPIENT shall be solely liable to determine and verify that
|
||||||
ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
the SOFTWARE is fit for the RECIPIENT intended use, environment or
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
application and comply with all regulatory, safety and security
|
||||||
NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS, WHICH ARE
|
related requirements concerning any use.
|
||||||
DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT SHALL
|
|
||||||
STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
||||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
||||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
||||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
11. EXCEPT AS EXPRESSLY PERMITTED HEREUNDER, NO LICENSE OR OTHER RIGHTS, WHETHER
|
DISCLAIMER:
|
||||||
EXPRESS OR IMPLIED, ARE GRANTED UNDER ANY PATENT OR OTHER INTELLECTUAL PROPERTY
|
|
||||||
RIGHTS OF STMICROELECTRONICS OR ANY THIRD PARTY.
|
THE SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING,BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS, ARE
|
||||||
|
DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW.
|
||||||
|
IN NO EVENT SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
|
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
EXCEPT AS EXPRESSLY PERMITTED HEREUNDER, NO LICENSE OR OTHER RIGHTS,
|
||||||
|
WHETHER EXPRESS OR IMPLIED, ARE GRANTED UNDER ANY PATENT OR OTHER INTELLECTUAL
|
||||||
|
PROPERTY RIGHTS OF STMICROELECTRONICS OR ANY THIRD PARTY.
|
||||||
|
|||||||
50
README.md
50
README.md
@@ -1,36 +1,40 @@
|
|||||||
# Middleware USB Device MCU Component
|
# USB Device Middleware Library MCU Software Component
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Overview
|
## Overview of the STM32Cube MCU offer on GitHub
|
||||||
|
|
||||||
**STM32Cube** is an STMicroelectronics original initiative to ease developers' life by reducing efforts, time and cost.
|
**STM32Cube** is an original initiative by STMicroelectronics to **simplify** prototyping and development by **reducing** effort, time, and cost. It supports the entire ARM™ Cortex-based STM32 microcontroller portfolio and provides a **comprehensive** software solution including:
|
||||||
|
* The CMSIS Core and Device interfaces enabling access to processor core features and device-specific peripherals of STM32 microcontrollers.
|
||||||
|
* The STM32 HAL-LL drivers, an abstraction layer offering a set of APIs ensuring maximized portability across the STM32 portfolio.
|
||||||
|
* The BSP drivers enabling access to peripherals on the STM32 development boards, external to the microcontroller itself.
|
||||||
|
* A consistent set of middleware libraries offering standardized, high-level functionalities — such as USB, TCP/IP, file systems, and graphics.
|
||||||
|
* A full set of software projects (basic examples, applications, and demonstrations) that showcase specific functionalities or use cases, and provided with support for multiple IDEs.
|
||||||
|
|
||||||
**STM32Cube** covers the overall STM32 products portfolio. It includes a comprehensive embedded software platform delivered for each STM32 series.
|
The **STM32Cube embedded software** is available in two flavors:
|
||||||
* The CMSIS modules (core and device) corresponding to the ARM(tm) core implemented in this STM32 product.
|
* The **MCU Firmware** _monolithic_ offer, where **all** software components (Drivers, Middleware, Projects, Utilities) are included in a **single** repository for each STM32 series.
|
||||||
* The STM32 HAL-LL drivers, an abstraction layer offering a set of APIs ensuring maximized portability across the STM32 portfolio.
|
* The **MCU Software Components** _modular_ offer, where **each** software component (mainly Drivers and Middleware) is provided in a **dedicated** repository, allowing users to **select** only the components they need.
|
||||||
* The BSP drivers of each evaluation, demonstration or nucleo board provided for this STM32 series.
|
|
||||||
* A consistent set of middleware libraries such as RTOS, USB, FatFS, graphics, touch sensing library...
|
|
||||||
* A full set of software projects (basic examples, applications, and demonstrations) for each board provided for this STM32 series.
|
|
||||||
|
|
||||||
Two models of publication are proposed for the STM32Cube embedded software:
|
The complete list of repositories is available [here](https://github.com/STMicroelectronics/STM32Cube_MCU_Overall_Offer/blob/master/README.md#content).
|
||||||
* The monolithic **MCU Package**: all STM32Cube software modules of one STM32 series are present (Drivers, Middleware, Projects, Utilities) in the repository (usual name **STM32Cubexx**, xx corresponding to the STM32 series).
|
|
||||||
* The **MCU component**: each STM32Cube software module being part of the STM32Cube MCU Package, is delivered as an individual repository, allowing the user to select and get only the required software functions.
|
|
||||||
|
|
||||||
## Description
|
## Repository content
|
||||||
|
|
||||||
This **stm32_mw_usb_device** MCU component repository is one element **common to all** STM32Cube MCU embedded software packages, providing the **USB Device MCU Middleware** part.
|
This repository provides the STM32Cube **USB Device** Middleware Library, **common to every** STM32Cube MCU firmware that supports it.
|
||||||
|
|
||||||
It represents ST offer to ensure the support of USB Devices on STM32 MCUs.
|
This represents STMicroelectronics’ offering to support the USB Device role on STM32 MCUs. It includes two main modules:
|
||||||
It includes two main modules:
|
|
||||||
* **Core** module for the USB device standard peripheral control APIs. It includes the files ensuring USB 2.0 standard code implementation for an USB device.
|
- **Core**: provides USB Device standard peripheral control APIs implementing the USB 2.0 standard code for a USB device. These APIs are called in every USB Device application, regardless of the desired functionality.
|
||||||
These files’ APIs will be called within every USB device application regardless of the desired functionality.
|
|
||||||
* **Class** module for the commonly supported classes APIs. it includes the files including different USB device classes. All STM32 USB classes are implemented according to the USB 2.0 and every class’s specifications. These files’ APIs will be called within USB device applications according to the desired functionality.
|
- **Class**: provides APIs for commonly supported USB Device classes complying with USB 2.0 standard and their respective class specifications. These APIs are called in USB Device applications based on the desired functionality.
|
||||||
|
|
||||||
## Release note
|
## Release note
|
||||||
|
|
||||||
Details about the content of this release are available in the release note [here](https://htmlpreview.github.io/?https://github.com/STMicroelectronics/stm32_mw_usb_device/blob/master/Release_Notes.html).
|
Details about the content of this release are available in the release note [here](https://htmlpreview.github.io/?https://github.com/STMicroelectronics/stm32-mw-usb-device/blob/master/Release_Notes.html).
|
||||||
|
|
||||||
## Troubleshooting
|
## Compatibility information
|
||||||
|
|
||||||
Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) guide.
|
Please refer to the **release note** in the firmware repository for the STM32 series you are using ([list](https://github.com/STMicroelectronics/STM32Cube_MCU_Overall_Offer/blob/master/README.md#stm32cube-mcu-packages)). It is **important** to use a **consistent set** of software component versions (i.e., CMSIS, HAL-LL, BSP, MW) as specified in the release note.
|
||||||
|
|
||||||
|
## Feedback and contributions
|
||||||
|
|
||||||
|
Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) guide.
|
||||||
|
|||||||
@@ -59,7 +59,43 @@ Page</a> : STM32Cube USB Wiki Page</li>
|
|||||||
<section id="update-history" class="col-sm-12 col-lg-8">
|
<section id="update-history" class="col-sm-12 col-lg-8">
|
||||||
<h1>Update History</h1>
|
<h1>Update History</h1>
|
||||||
<div class="collapse">
|
<div class="collapse">
|
||||||
<input type="checkbox" id="collapse-section25" checked aria-hidden="true">
|
<input type="checkbox" id="collapse-section26" checked aria-hidden="true">
|
||||||
|
<label for="collapse-section26" aria-hidden="true">V2.11.5 /
|
||||||
|
26-September-2025</label>
|
||||||
|
<div>
|
||||||
|
<h2 id="main-changes">Main Changes</h2>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr class="header">
|
||||||
|
<th style="text-align: left;">Headline</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr class="even">
|
||||||
|
<td style="text-align: left;"><strong>USB Core:</strong></td>
|
||||||
|
</tr>
|
||||||
|
<tr class="odd">
|
||||||
|
<td style="text-align: left;">SLA0044 Legal terms updated to latest revision (Rev 6 / October 2025)</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td style="text-align: left;"><strong>USB Classes:</strong></td>
|
||||||
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td style="text-align: left;">Add missing NULL pointer for user string descriptor</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="odd">
|
||||||
|
<td style="text-align: left;"><strong>USB MTP Class:</strong></td>
|
||||||
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td style="text-align: left;">Minor enhancement; improve device data buffer management</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="collapse">
|
||||||
|
<input type="checkbox" id="collapse-section25" aria-hidden="true">
|
||||||
<label for="collapse-section25" aria-hidden="true">V2.11.4 /
|
<label for="collapse-section25" aria-hidden="true">V2.11.4 /
|
||||||
11-April-2025</label>
|
11-April-2025</label>
|
||||||
<div>
|
<div>
|
||||||
@@ -379,7 +415,7 @@ Serial Bus Device Class Media Transfer Protocol Revision 1.1</td>
|
|||||||
Style</td>
|
Style</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="even">
|
<tr class="even">
|
||||||
<td style="text-align: left;">Update the way to declare licenses</td>
|
<td style="text-align: left;">Update the way to declare Legal terms</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="odd">
|
<tr class="odd">
|
||||||
<td style="text-align: left;"><strong>USB CDC/RNDIS/ECM
|
<td style="text-align: left;"><strong>USB CDC/RNDIS/ECM
|
||||||
@@ -757,8 +793,8 @@ NVIC_SystemReset() prototype change</td>
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr class="odd">
|
<tr class="odd">
|
||||||
<td style="text-align: left;">Update license section by adding path to
|
<td style="text-align: left;">Update Legal terms section by adding path to
|
||||||
get copy of ST Ultimate Liberty license</td>
|
get copy of ST Ultimate Liberty Legal terms</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="even">
|
<tr class="even">
|
||||||
<td style="text-align: left;">Core: Fix unexpected stall during status
|
<td style="text-align: left;">Core: Fix unexpected stall during status
|
||||||
@@ -794,7 +830,7 @@ Break on USBD_Template_Setup API</td>
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr class="odd">
|
<tr class="odd">
|
||||||
<td style="text-align: left;">Update license section</td>
|
<td style="text-align: left;">Update Legal terms section</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="even">
|
<tr class="even">
|
||||||
<td style="text-align: left;">Update some functions to be MISRAC 2004
|
<td style="text-align: left;">Update some functions to be MISRAC 2004
|
||||||
@@ -1141,8 +1177,8 @@ development</strong></p>
|
|||||||
<td style="text-align: left;">Official support of STM32F4xx devices</td>
|
<td style="text-align: left;">Official support of STM32F4xx devices</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="even">
|
<tr class="even">
|
||||||
<td style="text-align: left;">All source files: license disclaimer text
|
<td style="text-align: left;">All source files: Legal terms disclaimer text
|
||||||
update and add link to the License file on ST Internet.</td>
|
update and add link to the Legal terms file on ST Internet.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="odd">
|
<tr class="odd">
|
||||||
<td style="text-align: left;">Handle test mode in the set feature
|
<td style="text-align: left;">Handle test mode in the set feature
|
||||||
|
|||||||
31
SECURITY.md
Normal file
31
SECURITY.md
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# Report potential product security vulnerabilities
|
||||||
|
|
||||||
|
ST places a high priority on security, and our Product Security Incident
|
||||||
|
Response Team (PSIRT) is committed to rapidly addressing potential security
|
||||||
|
vulnerabilities affecting our products. PSIRT's long history and vast experience
|
||||||
|
in security allows ST to perform clear analyses and provide appropriate guidance
|
||||||
|
on mitigations and solutions when applicable.
|
||||||
|
|
||||||
|
If you wish to report potential security vulnerabilities regarding our products,
|
||||||
|
**please do not report them through public GitHub issues.** Instead, we
|
||||||
|
encourage you to report them to our ST PSIRT following the process described at:
|
||||||
|
**https://www.st.com/content/st_com/en/security/report-vulnerabilities.html**
|
||||||
|
|
||||||
|
### IMPORTANT - READ CAREFULLY:
|
||||||
|
|
||||||
|
STMicroelectronics International N.V., on behalf of itself, its affiliates and
|
||||||
|
subsidiaries, (collectively “ST”) takes all potential security vulnerability
|
||||||
|
reports or other related communications (“Report(s)”) seriously. In order to
|
||||||
|
review Your Report (the terms “You” and “Yours” include your employer, and all
|
||||||
|
affiliates, subsidiaries and related persons or entities) and take actions as
|
||||||
|
deemed appropriate, ST requires that we have the rights and Your permission to
|
||||||
|
do so.
|
||||||
|
|
||||||
|
As such, by submitting Your Report to ST, You agree that You have the right to
|
||||||
|
do so, and You grant to ST the rights to use the Report for purposes related to
|
||||||
|
security vulnerability analysis, testing, correction, patching, reporting and
|
||||||
|
any other related purpose or function.
|
||||||
|
|
||||||
|
By submitting Your Report, You agree that ST’s
|
||||||
|
[Privacy Policy](https://www.st.com/content/st_com/en/common/privacy-portal.html)
|
||||||
|
applies to all related communications.
|
||||||
Reference in New Issue
Block a user