2190669_en-US

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2190669_en-US

2190669_en-US

RT1052 USB HOST connection to Type-C headset IN endpoint not getting data
MCU Model: IMXRT1052DVL6B
SDK version: SDK_25_06_00_EVKB-IMXRT1050
Development environment: Windows + MDK
 

I used the NXP USB HOST stack to implement the playback of Type-C headphones and the acquisition of microphone sound by referring to the sample code in the SDK.

After testing, most Type-C headphones work fine, but there is an exception when testing Apple headphones, where the MCU is able to periodically output data to the OUT endpoint, but is unable to receive data from the IN endpoint. That is, after connecting the Apple headset, calling USB_HostAudioStreamSend can generate the callback normally, but after calling USB_HostAudioStreamRecv, no callback is triggered.
During online debugging, if you set a breakpoint in the callback function specified by USB_HostAudioStreamSend, and the program runs to this breakpoint and then manually continues to run, the callback specified by USB_HostAudioStreamRecv is executed. If all breakpoints are removed and the program is allowed to run at full speed, the callback specified by USB_HostAudioStreamRecv is not executed.

If I only turn on the microphone interface, the callback is generated normally after calling USB_HostAudioStreamRecv.

From what I've seen, the UI bit in the USBSTS register is only set once in 1 millisecond when Apple headphones are connected. Whereas when other normal working headphones are connected, this bit is set twice in 1 ms time.

Please help me see what the cause of this problem is?

Here's what the Apple headset prints when it's connected:

USB audio attached
AUDIO 2.0 device
AUDIO_GET_VOLUME_RANG
Audio Speaker device information.
more than one frequenuy is supported by device
- Frequency device support frequency ranges is :MIN 44100 Hz, MAX 44100 Hz, RES attributes 0Hz, and
- Frequency device support frequency ranges is :MIN 48000 Hz, MAX 48000 Hz, RES attributes 0Hz, and
- Bit resolution : 24 bits
- Number of channels : 2 channels
- Transfer type : Isochronous
- Sync type : Synchronous
- Usage type : Data endpoint
USB Speaker example will loop playback 48k_24bit_2 ch format audio.

USB audio attached
AUDIO 2.0 device
AUDIO_GET_VOLUME_RANG
Audio Recorder device information.
more than one frequenuy is supported by device
- Frequency device support frequency ranges is :MIN 44100 Hz, MAX 44100 Hz, RES attributes 0Hz, and
- Frequency device support frequency ranges is :MIN 48000 Hz, MAX 48000 Hz, RES attributes 0Hz, and
- Bit resolution : 16 bits
- Number of channels : 1 channel
- Transfer type : Isochronous
- Sync type : Synchronous
- Usage type : Data endpoint
USB Host Recorder example try to record 48k_16bit_1 ch audio using PCM format.
 

Attached is the Apple headset information obtained using the UsbTreeView software.

i.MXRT 105xRe: RT1052 USB HOST连接Type-C耳机IN端点获取不到数据

Hi @ryanschaw,

Our USB stack is not meant to be put on production out of the box. It is a general application for compatibility with most USB peripherals, but we cannot guarantee it will work flawlessly with every USB device in the market, like it is the case of these specific Type-C headphones.

BR,
Edwin.

Re: RT1052 USB HOST连接Type-C耳机IN端点获取不到数据

hi, @EdwinHz 

I don't have an MIMXRT1050-EVK development board; I only have an Easy-RT1052 development board from ZLG company.

This issue can be reproduced both on my own product's hardware and on the Easy-RT1052 development board.

Some individual headphones exhibit this problem, while most headphones work normally. The issue might not be related to hardware connections via the Type-C interface, but possibly lies within the USB peripheral driver code.


The following image is the USB circuit diagram of the Easy-RT1052.

ryanschaw_0-1762219865612.png

ryanschaw_1-1762219890840.png


Thanks!


Re: RT1052 USB HOST连接Type-C耳机IN端点获取不到数据

Hi @ryanschaw,

Could you please clarify if you are using the EVK? If so, how are you doing the connections of the USB Type-C headphones?

Re: RT1052 USB HOST连接Type-C耳机IN端点获取不到数据

Hi. @EdwinHz 

I tried adding a delay of 10 to 50 microseconds in USB_HostAudioStreamSend, but it made no difference. I also tried submitting the IN endpoint data first, then delaying by approximately 50 microseconds before submitting the OUT data, but that didn't resolve the issue either.

I've confirmed that the headphones don't have any special settings.

Thanks.

Re: RT1052 USB HOST连接Type-C耳机IN端点获取不到数据

Hi @ryanschaw,

The fact that the callback is triggered when a breakpoint is set suggests a timing issue. Try polling instead of relying on callbacks, to track when the data is available. Or, try adding a small delay between USB_HostAudioStreamSend and USB_HostAudioStreamRecv.

Are you using the EVK? How are doing the connections of the USB Type-C? Keep in mind Erratum ERR050101: Chip Errata for the i.MX RT1050

That said, if the issue is only caused with a specific brand's headphones, then it's possible that they have extra requirements or specifications. I recommend contacting this brand's support for more information on what requirements need to be followed for their products to work.

BR,
Edwin.


Tags (1)
No ratings
Version history
Last update:
‎11-20-2025 10:27 AM
Updated by: