USB Communication


Quick question for you, do you perhaps have the source code for the git repo ](
I noticed that repo is no long available and would like to work with it since so far it is the only one that has worked so far.



The tinyFPGA_testing in the posts above is gone. I am trying to get usb serial working based on @lawrie.griffiths’s work . Actually I started a few times already looking into it but there seems to be a small problem in the code.

Under Linux at least the hello world example fails to output hello world. It is only when I plug out the device that all of a sudden I will get a few hello_world instances displayed on my screen. I suspect there is a small problem in the implementation that perhaps does not fully follow the specs.

any clue?


David Williams’s version is an improvement on mine -


Unfortunately that version doesn’t seem to work for me either, having the same problem as @MartyMacGyver. Enumeration on Windows 10 seems to fail with either:

This device cannot start. (Code 10)

{Operation Failed}
The requested operation was unsuccessful.


Windows has stopped this device because it has reported problems. (Code 43)

A request for the USB device descriptor failed.

I’m building the firmware from inside a docker image and then flashing it from Windows with tinyprog.


Follow up! I think I’ve fixed the UART on Windows!

For whatever reason, Windows requests a very large descriptor size, greater than a byte, and the bit fiddling that the usb_serial_ctrl_ep module does causes this to wrap over.


Excellent work!

I read your thread on twitter, I have a question …
I am not an expert in USB protocol, but … host request a 265 bytes descriptor, do you give it a 67 bytes descriptor and does it work? :roll_eyes:
Why? And why does Win10 request 265 bytes? Or is it just that driver? :thinking:



I am also now spending some time on this project. I am porting the examples from @lawrie.griffiths to the newer usb stack and making modifications to allow for more emulation.

At the same time I think that running test benches would be a nice idea. The idea here is to use usbmon on linux / windows and capture the usb packets in wireshark. this should give us a “definitive guide” on making it work on all platforms :stuck_out_tongue:


I am trying to send data as fast I can can from the FPGA to the host. I was/am expecting that I am free to write data to the UART as long as uart_in_ready is true but this is not what I am experiencing.

From looking at the code (digging into usb_uart_bridge_ep I find the following line

  // connect the pipeline register to the outgoing port
  assign uart_in_ready = ( pipeline_in_state == PipelineInState_CycleData ) && in_ep_data_free;

is appears that the ready state can only be valid while in the cycleData state. is this intentional? and if so how do i determine if I am allowed to push write data to the host?