cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103 USB Composite Device random comm problems in Windows 8

melchor
Associate II
Posted on July 15, 2013 at 08:39

I developed a device based on the STM32F103 MCU that implements an USB MSC + Custom HID composite device based on the ST USB FS library 4.0.0. The Custom HID is used to upload data (following a command/response exchange format with 18bytes length) to a PC at relatively high rate.

This has been working fine with Windows XP and Windows 7 OSs, but this does not work well under Windows 8. The device works well under Win8 for mass storage but with the Custom HID the communication interrupts at a random time.The communication can be resumed by cycling the device power or waiting some time.

After analyzing the traces with a software USB sniffer it looks like it is related to IN packets that are not delivered to the PC (crc or timeout errors) and the PC stops accepting IN packets from this endpoint. I tried to globally disable the Win8 selective suspend feature but with the same result.

I am investigating deeper the problem but I would like to know if anyone has a similar issue with Win 8 or has any hint about the possible cause of the problem.

Thanks,

6 REPLIES 6
dthedens23
Associate II
Posted on July 15, 2013 at 16:58

Not certain, but I think Microsoft tightened security on HID and Custom HID may not be supported in standard Win 8 drivers.  I just Googled a little and it seems to be an issue for others as well.

You will have to verify if this is indeed the issue.  I do Win driver work.  Win 8 does indeed stop communicating to a device when it misbehaves.  You have to remove device or reset hard.  Something you might want to consider for a countermeasure.

tsuneo
Senior
Posted on July 16, 2013 at 18:47

[quote]After analyzing the traces with a software USB sniffer it looks like it is related to IN packets that are not delivered to the PC (crc or timeout errors) and the PC stops accepting IN packets from this endpoint.[/quote]

It sound like hardware trouble of the PC (or hub, if any).

Try another PC.

Windows does heavy error recovery on Mass-Storage class (MSC), but no recovery for HID.

Single error report from host controller (after three retries on the host controller) freezes the HID interrupt IN endpoint.

MSC may look like working fine even when it is suffered with the same transaction errors as HID.

Tsuneo

melchor
Associate II
Posted on July 17, 2013 at 08:10

For my tests I am using a PC with Windows 7 and running Windows 8 in a virtual machine (Virtual Box). I don't have access yet to a PC running natively Windows 8, but one of the customers of my device reported the problem with this OS. Therefore it does not look a hardware problem but some difference in the Win8 driver implementation that interacts with my device, causing the problem.

Maybe what I have to do is analyze the packets in Win7 and see if there are errors and in this case, how the OS recovers from them and then compare with Win8.

tsuneo
Senior
Posted on July 17, 2013 at 19:05

> For my tests I am using a PC with Windows 7 and running Windows 8 in a virtual machine (Virtual Box).

Virtual box is not reliable to test USB device operation. Apply VMware (Player), instead.

''crc or timeout errors'' means that the host controller on the PC gets corrupted packet or no response, unless it were false sign brought by virtual box.

To confirm it, a hardware bus analyzer is much better.

Anyway, it's unfair you would hide such a serious information in your first post.

Tsuneo

melchor
Associate II
Posted on July 17, 2013 at 22:45

Hi Tsuneo,

I'm sorry, but it has been an oversight from my side not fully describing this important information.  

I am going to test with a VMware Player VM instead.

Thanks,

melchor
Associate II
Posted on July 29, 2013 at 10:20

Confirmed that with VMware the USB operation is stable.

After doing some fixes to the implementation I was able to have a reliable operation under WIN8.