High speed USB audio interrupts should occur every 125uS right?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

High speed USB audio interrupts should occur every 125uS right?

ソリューションへジャンプ
1,648件の閲覧回数
EdSutter
Senior Contributor II

I am debugging some USB audio stuff on imx1060 and just noticed that my --apparently-- HIGH speed USB device is only being interrupted 1kHz (every millisecond) rather than the expected 8kHz (every 125 usec).  Any idea why that would be?  

0 件の賞賛
1 解決策
1,637件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi EdSutter,

Although SOF is sent every 1ms in full speed mode and 0.125 ms in high speed mode, USB controller will not generate interrupt when receiving SOF. It will interrupt when a transaction is complete. Please see the USBSTS and USBINTR register.

 

Regards,

Jing

元の投稿で解決策を見る

0 件の賞賛
5 返答(返信)
1,585件の閲覧回数
EdSutter
Senior Contributor II

Just want to add a comment here, since I just noticed one major part of my confusion regarding the rate at which the interrupts occur...

I was changing the polling interval in the ENDPOINT descriptor and not seeing any change in the interrupt rate.  I didn't realize that there is a function called at startup that overrides some of the descriptor settings based on whether the system is FULL or HIGH speed (USB_DeviceSetSpeed()).

As soon as I removed that call things started working as expected...

That call is useful to modify some points in the descriptor based on USB speed, but if your application is fixed to run at a particular speed, it seems to me, the best thing to do is just set them up in the initialized descriptor (as I was doing) and eliminate that call.

 

0 件の賞賛
1,620件の閲覧回数
AndyCapon
Contributor II

Hi Ed,

I have microframe polling going here in both directions with a hacked dev_composite_hid_audio_unified example.

You need the interval to be 0x01 and the packet size set to frameSize/8.

So for this example I changed:

#define HS_ISO_IN_ENDP_INTERVAL (0x04)

To:

#define HS_ISO_IN_ENDP_INTERVAL (0x01)

 

And changed :

#define HS_ISO_IN_ENDP_PACKET_SIZE (AUDIO_IN_TRANSFER_LENGTH_ONE_FRAME)

to:

#if (HS_ISO_IN_ENDP_INTERVAL < 4)
#if (HS_ISO_IN_ENDP_INTERVAL == 1U)
#define HS_ISO_IN_ENDP_PACKET_SIZE ((AUDIO_IN_TRANSFER_LENGTH_ONE_FRAME) / 8U)
#elif (HS_ISO_IN_ENDP_INTERVAL == 2U)
#define HS_ISO_IN_ENDP_PACKET_SIZE ((AUDIO_IN_TRANSFER_LENGTH_ONE_FRAME) / 4U)
#elif (HS_ISO_IN_ENDP_INTERVAL == 3U)
#define HS_ISO_IN_ENDP_PACKET_SIZE ((AUDIO_IN_TRANSFER_LENGTH_ONE_FRAME) / 2U)
#endif
#else
#define HS_ISO_IN_ENDP_PACKET_SIZE (AUDIO_IN_TRANSFER_LENGTH_ONE_FRAME)
#endif

 

1,610件の閲覧回数
EdSutter
Senior Contributor II

Andy,

Yea after my original post I discovered the "bInterval" field of the endpoint (see my earlier reply).

The thing I didn't realize is that the initialized descriptor is modifed by USB_DeviceSetSpeed() to update the endpoint bInterval values based on the USB speed.  I was incorrectly making the change in the initialized configuration descriptor.

Thanks...

0 件の賞賛
1,638件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi EdSutter,

Although SOF is sent every 1ms in full speed mode and 0.125 ms in high speed mode, USB controller will not generate interrupt when receiving SOF. It will interrupt when a transaction is complete. Please see the USBSTS and USBINTR register.

 

Regards,

Jing

0 件の賞賛
1,634件の閲覧回数
EdSutter
Senior Contributor II

Ok @jingpan , that makes sense...

Also, after posting this question, I noticed the 'bInterval' field of the endpoint descriptor (section 9.6.6 of USB spec rev 2)  which apparently also has an effect on the rate (some multiple of the 1mS/125uS frame rate) at which the processor is interrupted.  Is that correct?

Thanks

0 件の賞賛