Reboot DFUDelay dfu failures

Technical questions regarding the XTC tools and programming with XMOS.
MyKeys
Active Member
Posts: 33
Joined: Mon Jul 03, 2017 9:41 am

Reboot DFUDelay dfu failures

Post by MyKeys »

Hi,

Does anyone know why DFUDelay(50000000) is used before rebooting in to dfu mode?
I see in the audio ref design that a delay of half a second (50,000,000 cycles @ 100MHz) is used before rebooting in one place and 50ms in another, is this a typo?

We have devices that fail to firmware update on some Windows 10 machines (Thesycon driver) and it seems that after issuing a reboot the usb device doesn't come back correctly (Error 0x0000001f reading descriptors).

I can stop the issue from occurring by either removing the HID_CONTROLS, or changing the half second delay to 50ms like the other.

The problem is consistent on the machines that fail, and the ones that work always seem to work.

Note the device is an XUF224 so the reboot process has been changed from the ref design to support a multi node device.

Any help appreciated,
Mike.


User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

Just reaching here but is it possible that the machines that fail are behind a USB hub? Can you confirm the details? Curious on this detail.

Perhaps the extra delay is to allow for enumeration through such USB hub controllers?

Do you have a USB bus analyzer to further investigate the transactions? Respectively, if the 50ms delay works (after lots of testing), is that an option you can consider? Till someone from XMOS chimes in with an official response, guessing that the delay is a feel good value to allow for some work around on boxes.
cl-b
Active Member
Posts: 44
Joined: Fri Sep 15, 2017 2:58 pm

Post by cl-b »

Hi Mike,

Can you detail how you changed the reboot process for XUF224 ?
MyKeys
Active Member
Posts: 33
Joined: Mon Jul 03, 2017 9:41 am

Post by MyKeys »

No hub required on one machine, on another I can trigger the problem by using a hub.

It looks like I spoke to soon, changing to the 50ms delay hasn't fixed the problem. Looks like things aren't as consistent as I had first thought.
Unplugging and then replugging the usb in does seem to resolve the usb connection issue so I guess I really need a USB bus analyzer to see what's going on.

The delay comes in after the USB request has been handled and before the reboot is triggered. I wonder why the delay is not consistent between different reboot paths, half a second of stalling the endpoint0 thread seem like a bad idea.

Thanks for helping,
Mike
MyKeys
Active Member
Posts: 33
Joined: Mon Jul 03, 2017 9:41 am

Post by MyKeys »

Hi Claire,

I think my colleague Steve has already replied to you on your other thread with the pertinent code.

Thanks,
Mike.
cl-b
Active Member
Posts: 44
Joined: Fri Sep 15, 2017 2:58 pm

Post by cl-b »

Thanks, I was just wondering whether something else has to modified.
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

@MyKeys, we have some USB Bus analyzers in the lab. Do you have a simple / basic project that can raise this issue and run on perhaps the XCORE-200 eXplorer Kit?

As there are many factors that may or may not work the same for our side, time permitting, can attempt to first test the project and if we see the same quirk, then place and log onto the USB analyzer.

Aside from this, fair to say that your USB cables are at least 2.0 compliant? The USB IP does operate @ 480 Mbps so only use quality and (truly) certified, short as possible 2.0 cables. In addition to this, be sure that your PCB design has impedance controlled traces @ 90 ohms otherwise you will be in the land of fairy dust.

Other preaching advice - can you test your hardware with perhaps XMOS supplied CDC / HID example? With such IP, does your hardware work on every platform with stability?

We have this XCORE-200 board:
Attachments
xmos-xcore-200-explorerkit-200.jpg
xmos-xcore-200-explorerkit-200.jpg (54.75 KiB) Viewed 3328 times
xmos-xcore-200-explorerkit-200.jpg
xmos-xcore-200-explorerkit-200.jpg (54.75 KiB) Viewed 3328 times
MyKeys
Active Member
Posts: 33
Joined: Mon Jul 03, 2017 9:41 am

Post by MyKeys »

Thanks mon2,

So far the issue has only affected our quad tile device based product (xuf224) so it's hard to get the same test setup on reference hardware.
Looking in more detail on the machine that was failing without a hub, it turns out the ports I'd plugged in to are running through an internal hub.
Using the ports on the back (without hub) run fine.

So far the only combination that fails is when using a hub with HID_CONTROLS enabled on an XUF224.
I'm going to try Microsoft Message Analyzer to see if I can get more detail of what going on.

Thanks again,
Mike.
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

Other USB software based analyzer options:

https://freeusbanalyzer.com/

http://www.sysnucleus.com/
* time limited trialware
MyKeys
Active Member
Posts: 33
Joined: Mon Jul 03, 2017 9:41 am

Post by MyKeys »

So I've been looking at this issue all day with Microsoft's message analyzer.

Comparing the trace from a working dfu update (a very similar but different product with HID) with the failing quad tile device I see the following differences during the reboot process:

Interrupt In Transfer - USBD_STATUS_XACT_ERROR (HID in interrupt endpoint)

Start IOCTL_INTERNAL_USB_RESET_PORT
USB Device Internal Reset Started
USB Device Internal Reset Completed
Complete IOCTL_INTERNAL_USB_RESET_PORT

At this point the device re-initializes

4 seconds later:

Control Out Transfer - USBD_STATUS_STALL_PID
Interrupt In Transfer - USBD_STATUS_XACT_ERROR (HID in interrupt endpoint)

The XACT error apparently is a transaction error caused by either a crc error, timeout, invalid PID, or a buffer error (makes sense if the XMOS is rebooted?).
With HID_CONTROLS disabled none of the above errors/resets occur.

Maybe it's time to switch to the XMOS multichannel reference board I have and see if I can reproduce the issue.

Any help or random thoughts appreciated.
Post Reply