Comments (15)
- Did this happen the first ever time, and then never again after re-plugging?
Correct.
- Does a reboot get it to occur again?
It works fine after a reboot.
(does anything / can you reproduce it?)
You can artificially make it happen the second time by uninstalling the driver using the Device Manager, unplugging the device, and plugging it back in.
Also, I am fairly certain it will happen once per physical device (i.e. VID/PID/DID/serial number combination).
from glasgow.
No, not physical port. It was originally plugged into Port_#0004.Hub_#0002
. After plugging it in Port_#0002.Hub_#0002
it works fine.
The device instance path remains the same, USB\VID_20B7&PID_9DB1\C3-20230729T201611Z
, so the same device settings are used. It is only the location that is updated when it is plugged in a different port.
from glasgow.
In addition, it looks like this implementation of STALL_EP0()
is incorrect:
https://github.com/whitequark/libfx2/blob/82d154153f548b29b1be60f1c11d7a5bc102486d/firmware/library/include/fx2usb.h#L76-L77
It should be EP0CS = _HSNAK|_STALL
instead:
from glasgow.
This isn't correct. In case of an IN request, it is necessary to wait for
EP0CS & _BUSY
to clear first.
My apologies; I wasn't paying enough attention and got confused.
There is no point in waiting for EP0CS & _BUSY
to clear in the beginning of the SUDAV deferred interrupt handler because it will never be set at that point:
It only makes sense to wait for EP0CS & _BUSY
to clear after an EP0 data transfer has been set up. In case of libfx2, this would be after a call to SETUP_EP0_BUF
, SETUP_EP0_IN_DATA
, or SETUP_EP0_IN_DESC
.
The issue is caused by not stalling EP0 as described here:
from glasgow.
Unplugging the device and plugging it back in resolves the issue.
Could you clarify?
- Did this happen the first ever time, and then never again after re-plugging?
- Does a reboot get it to occur again? (does anything / can you reproduce it?)
from glasgow.
Also, I am fairly certain it will happen once per physical device (i.e. VID/PID/DID/serial number combination).
Knowing Windows, possibly physical port too...! (could you confirm?)
from glasgow.
I will be able to capture ETW traces later.
I would really appreciate ETW traces (or any additional information about this issue) because I'm at a loss of where to even begin debugging it.
from glasgow.
@esden Have you already programmed all of the Early Bird units? This could be an unpleasant thing for people who use Windows to hit on their first plug in...
@attie I think we need to catch usb1.USBErrorNotSupported
on Windows and ask the operator to unplug it and plug it back again to see if that solves it, until we can fix this properly >_>
from glasgow.
No, not physical port
That's good... FTDI UARTs (and I'm sure something else) used to have a habit of tying the COMn
to a physical port.
catch
usb1.USBErrorNotSupported
on Windows and ask the operator to unplug it and plug it back again
I've got access to Windows too, though my knowledge is far below where it could be.
I'm a little surprised it doesn't "figure things out" and that a replug is required... but that's a good idea.
from glasgow.
I'm a little surprised it doesn't "figure things out" and that a replug is required... but that's a good idea.
It might be related to WinUSB somehow?
from glasgow.
@VioletEternity Could you test #385, please?
from glasgow.
I've attached the ETW trace capturing USB transactions on first plug-in of the device:
usbtrace.zip
It seems that the cause of the issue might be the failure of the requests with FNs 378 and 390:
I've included the requests below:
from glasgow.
It looks like an unrecognized USB request that is received by the device will always fall through to this line:
Line 837 in 3146305
This isn't correct. In case of an IN request, it is necessary to wait for EP0CS & _BUSY
to clear first.
As a result, EP0 is stalled after an unrecognized Microsoft-specific request arrives, but instead of rejecting just this request, a following GET_DESCRIPTOR request is also rejected. This causes the Windows USB stack to mark the device as faulty, since a GET_DESCRIPTOR(Device) should always succeed. Windows only queries the Microsoft OS descriptor on the first plug-in, so on the next one the issue does not arise.
from glasgow.
All right, I can't quite get it to work right now, but I also realized that I think I understood this part of the FX2 TRM wrong this whole time and I need to rewrite a significant amount of code. I'll do this tomorrow >_>
from glasgow.
Related Issues (20)
- Installing with Python 3.10 HOT 2
- The `asyncio.coroutine` decorator has been removed in Python 3.11 HOT 4
- Synthesis for `jtag-probe` fails with latest YoWASP Yosys HOT 16
- error: The 'amaranth' distribution was not found and is required by glasgow (install not working) HOT 4
- ImportError: cannot import name 'soft_unicode' from 'markupsafe' HOT 6
- Integrate YoWASP so that it is used automatically HOT 1
- jtag-openocd behaviour doesn't match jtag-svf HOT 5
- Synthesis for applets fails with YoWASP with: ERROR: Assert `ofs.is_open()' failed in ../yosys-src/passes/techmap/abc9_ops.cc:950. HOT 5
- Replace `crcmod` with `crc` HOT 3
- Documentation HOT 1
- PIC MCU ICSP (or Enhanced ICSP) programming HOT 1
- Custom USB Manufacturer String HOT 1
- [RFC] New basis of operation: Reliable Datagram Pipe HOT 18
- JESD3 lexer calculates wrong checksum whenever CR newlines are used HOT 1
- Replace the dependency on `crc` using `amaranth.lib.crc`
- A logo
- Instructions in README do not make it possible to build bitstreams on Windows HOT 4
- Glasgow does not gracefully shutdown if the device is unplugged... HOT 3
- Devices may "forget" firmware. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glasgow.