We found a problem in the usb_device_descriptor.c file of the frdmmcxn947_dev_phdc_weighscale_freertos_cm33_core0 sample project for the FRDM-MCXN947 development board. We used this project as the basis for a new project. After an upgrade to MacOS version Tahoe 26.4 our USB communication stopped working. The symptom of the problem was that communication from the Mac to the FRDM-MCXN947 development board worked, but communication from the development board back to the Mac stopped working. The fix to the problem was the following code changes to the USB_DeviceSetSpeed() function in usb_device_descriptor.c:
- if (((pDescStart->endpoint.bEndpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_MASK) ==
+ if (((pDescStart->endpoint.bmAttributes & USB_DESCRIPTOR_ENDPOINT_ATTRIBUTE_TYPE_MASK) ==
+ USB_ENDPOINT_INTERRUPT) &&
+ ((pDescStart->endpoint.bEndpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_MASK) ==
- else if (((pDescStart->endpoint.bEndpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_MASK) ==
+ else if (((pDescStart->endpoint.bmAttributes & USB_DESCRIPTOR_ENDPOINT_ATTRIBUTE_TYPE_MASK) ==
+ USB_ENDPOINT_BULK) &&
+ ((pDescStart->endpoint.bEndpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_MASK) ==
- else if (((pDescStart->endpoint.bEndpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_MASK) ==
+ else if (((pDescStart->endpoint.bmAttributes & USB_DESCRIPTOR_ENDPOINT_ATTRIBUTE_TYPE_MASK) ==
+ USB_ENDPOINT_BULK) &&
+ ((pDescStart->endpoint.bEndpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_MASK) ==
- if (((pDescStart->endpoint.bEndpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_MASK) ==
+ if (((pDescStart->endpoint.bmAttributes & USB_DESCRIPTOR_ENDPOINT_ATTRIBUTE_TYPE_MASK) ==
+ USB_ENDPOINT_INTERRUPT) &&
+ ((pDescStart->endpoint.bEndpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_MASK) ==
- else if (((pDescStart->endpoint.bEndpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_MASK) ==
+ else if (((pDescStart->endpoint.bmAttributes & USB_DESCRIPTOR_ENDPOINT_ATTRIBUTE_TYPE_MASK) ==
+ USB_ENDPOINT_BULK) &&
+ ((pDescStart->endpoint.bEndpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_MASK) ==
- else if (((pDescStart->endpoint.bEndpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_MASK) ==
+ else if (((pDescStart->endpoint.bmAttributes & USB_DESCRIPTOR_ENDPOINT_ATTRIBUTE_TYPE_MASK) ==
+ USB_ENDPOINT_BULK) &&
+ ((pDescStart->endpoint.bEndpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_MASK) ==
We no longer have problems with USB communication. I am posting this information in case it solves USB communication problems for others as well.