Skip to content

Commit

Permalink
mcux: mcux-sdk-middleware-usb: Add SDK 2.16.000
Browse files Browse the repository at this point in the history
Adding in the v2.16.000 of USB middleware

Signed-off-by: David Leach <[email protected]>
  • Loading branch information
dleach02 committed Aug 5, 2024
1 parent ff0b450 commit 1238174
Show file tree
Hide file tree
Showing 38 changed files with 2,500 additions and 390 deletions.
27 changes: 25 additions & 2 deletions mcux/middleware/mcux-sdk-middleware-usb/ChangeLogKSDK.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,30 @@
@page middleware_log Middleware Change Log

@section USB USB stack for MCUXpresso SDK
The current version of USB stack is 2.9.0.
The current version of USB stack is 2.10.0.
- 2.10.0
- New features and demos:
- Implement the USB Host ECM.
- Add new USB host example: usb_host_cdc_ecm
- Add one new USB host audio example: usb_host_audio_unified.
- eUSB support on EHCI.
- Add L1 LPM low power feature on EHCI for device and host.
- Improvement:
- Enable cache maintenance in the usb_host_msd_fatfs, usb_device_msc_disk and usb_device_msc_ramdisk examples on the RT1040-EVK, RT1050-EVKB, RT1060-EVKC and RT1170-EVKB platforms.
- Improve Host VNIC to be more compatible with other USB devices.
- Add USB_DEVICE_CONFIG_SOF_NOTIFICATION for device stack.
- Clear the pending FR_Swap during initialization to prevent the FR_Swap from affecting the later PD negotiation.
- Bug fixes:
- Fix on IP3511 driver that SETUP bit is cleared by mistake.
- Fix on IP3516 driver that cannot do multiple ISO endpoints transfers at the same time.
- Fix on IP3516 driver that the Token Done interrupt is cleared but the last completed transfer is not processed.
- Fix on IP3516 driver that the transfer will continue when receiving a short packet.
- Fix on host audio class driver that entities cannot be distinguished between recorder and speaker.
- 2.9.1
- Improvement:
- Update EHCI controller driver for basic support of eUSB.
- Replace the hard code in audio cases with macro.
- Uniform the Chapter9 for device lite cases.
- 2.9.0
- Improvement:
- Change ROOT2 as enabled by default in device stack.
Expand Down Expand Up @@ -31,7 +54,7 @@
- Update dev_composite_hid_audio_unified_bm demo to suppport independent mute/unmute and volume control.
- 2.8.1
- Improvement:
- update USB audio demos to use audio component (components\audio).
- update USB audio demos to use audio component (components/audio).
- Add the checking of function call return value.
- Add audio multiple channels demo (usb_device_composite_audio_multi_ch_unified) on RT600 audio board.
- Fix audio noise on sync mode and improve overflow/underflow checking method.
Expand Down
3 changes: 3 additions & 0 deletions mcux/middleware/mcux-sdk-middleware-usb/device/usb_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ typedef enum _usb_device_event
kUSB_DeviceEventGetConfiguration, /*!< Get current configuration index */
kUSB_DeviceEventGetInterface, /*!< Get current interface alternate setting value */
kUSB_DeviceEventSetBHNPEnable,
#if (defined(USB_DEVICE_CONFIG_SOF_NOTIFICATIONS) && (USB_DEVICE_CONFIG_SOF_NOTIFICATIONS > 0U))
kUSB_DeviceEventSOF, /*!< Start of Frame received */
#endif
#if (defined(USB_DEVICE_CONFIG_CHARGER_DETECT) && (USB_DEVICE_CONFIG_CHARGER_DETECT > 0U))
kUSB_DeviceEventDcdDetectionfinished, /*!< The DCD detection finished */
#endif
Expand Down
47 changes: 25 additions & 22 deletions mcux/middleware/mcux-sdk-middleware-usb/device/usb_device_dci.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
#include "usb_device_dwc3.h"
#endif

#if (defined(USB_DEVICE_CONFIG_BUFFER_PROPERTY_CACHEABLE) && (USB_DEVICE_CONFIG_BUFFER_PROPERTY_CACHEABLE > 0U))
#include "fsl_cache.h"
#endif

/*******************************************************************************
* Definitions
******************************************************************************/
Expand All @@ -46,12 +42,6 @@
#define FSL_COMPONENT_ID "middleware.usb.device_stack"
#endif

#if defined __CORTEX_M && (__CORTEX_M == 7U)
#if (defined(USB_DEVICE_CONFIG_BUFFER_PROPERTY_CACHEABLE) && (USB_DEVICE_CONFIG_BUFFER_PROPERTY_CACHEABLE > 0U))
#warning USB_DEVICE_CONFIG_BUFFER_PROPERTY_CACHEABLE is not supported.
#endif
#endif

/*******************************************************************************
* Prototypes
******************************************************************************/
Expand Down Expand Up @@ -291,25 +281,13 @@ static usb_status_t USB_DeviceTransfer(usb_device_handle handle,
OSA_EXIT_CRITICAL();
if (0U != (endpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_MASK))
{
#if (defined(USB_DEVICE_CONFIG_BUFFER_PROPERTY_CACHEABLE) && (USB_DEVICE_CONFIG_BUFFER_PROPERTY_CACHEABLE > 0U))
if (0U != length)
{
DCACHE_CleanByRange((uint32_t)buffer, length);
}
#endif
/* Call the controller send interface, the callbackFn is initialized in
USB_DeviceGetControllerInterface */
status = deviceHandle->controllerInterface->deviceSend(deviceHandle->controllerHandle, endpointAddress,
buffer, length);
}
else
{
#if (defined(USB_DEVICE_CONFIG_BUFFER_PROPERTY_CACHEABLE) && (USB_DEVICE_CONFIG_BUFFER_PROPERTY_CACHEABLE > 0U))
if (length)
{
DCACHE_CleanInvalidateByRange((uint32_t)buffer, length);
}
#endif
/* Call the controller receive interface, the callbackFn is initialized in
USB_DeviceGetControllerInterface */
status = deviceHandle->controllerInterface->deviceRecv(deviceHandle->controllerHandle, endpointAddress,
Expand Down Expand Up @@ -581,6 +559,26 @@ static usb_status_t USB_DeviceDcdDetectFinihsedNotification(usb_device_struct_t
}
#endif

#if (defined(USB_DEVICE_CONFIG_SOF_NOTIFICATIONS) && (USB_DEVICE_CONFIG_SOF_NOTIFICATIONS > 0U))
/*!
* @brief Handle the SOF notification.
*
* This function is used to handle the SOF notification.
*
* @param handle The device handle. It equals the value returned from USB_DeviceInit.
* @param message The device callback message handle.
*
* @return A USB error code or kStatus_USB_Success.
*/
static usb_status_t USB_DeviceSOFNotification(usb_device_struct_t *handle,
usb_device_callback_message_struct_t *message)
{
/* Call device callback to notify the application that the SOF packet is received.
the deviceCallback is the second parameter of USB_DeviceInit */
return handle->deviceCallback(handle, kUSB_DeviceEventSOF, NULL);
}
#endif

/*!
* @brief Handle the attach notification.
*
Expand Down Expand Up @@ -636,6 +634,11 @@ static usb_status_t USB_DeviceNotification(usb_device_struct_t *handle, usb_devi
status = USB_DeviceDcdDetectFinihsedNotification(handle, message);
break;
#endif
#if (defined(USB_DEVICE_CONFIG_SOF_NOTIFICATIONS) && (USB_DEVICE_CONFIG_SOF_NOTIFICATIONS > 0U))
case kUSB_DeviceNotifySOF:
status = USB_DeviceSOFNotification(handle, message);
break;
#endif

default:
if (endpoint < USB_DEVICE_CONFIG_ENDPOINTS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ typedef enum _usb_device_notification
kUSB_DeviceNotifyError, /*!< Errors happened in bus */
kUSB_DeviceNotifyDetach, /*!< Device disconnected from a host */
kUSB_DeviceNotifyAttach, /*!< Device connected to a host */
#if (defined(USB_DEVICE_CONFIG_SOF_NOTIFICATIONS) && (USB_DEVICE_CONFIG_SOF_NOTIFICATIONS > 0U))
kUSB_DeviceNotifySOF, /*!< Start of Frame received */
#endif
#if (defined(USB_DEVICE_CONFIG_CHARGER_DETECT) && (USB_DEVICE_CONFIG_CHARGER_DETECT > 0U))
kUSB_DeviceNotifyDcdDetectFinished, /*!< Device charger detection finished */
#endif
Expand Down
Loading

0 comments on commit 1238174

Please sign in to comment.