WangXuan95 / FPGA-USB-Device

An FPGA-based USB full-speed device core to implement USB-serial, USB-camera, USB-audio, USB-hid, etc. It requires only 3 FPGA common IOs rather than additional chips. 基于FPGA的USB full-speed device端控制器,可实现USB串口、USB摄像头、USB音频、U盘、USB键盘等设备,只需要3个FPGA普通IO,而不需要额外的接口芯片。
https://gitee.com/wangxuan95/FPGA-USB-Device
GNU General Public License v3.0
555 stars 94 forks source link

Device Descriptor Request Failed #21

Closed Long-Tam closed 6 months ago

Long-Tam commented 7 months ago

Hi Wang.

Thanks for sharing your project. I tried to implement your project for an Altera Cyclone II and successfully compile the code after doing a minor adjustment to the PLL so that it works for the Cyclone II board. The rest is left untouched. After uploading the code to the device and plug it in my computer, which runs on Windows 10, it reports Device Descriptor Request Failed: image I manage to hook it up to a digital analyser and seeing there is some transactions. I compare the packages of the FPGA implemented your code with that of the pin D+ and D- of a USB UART CP2102 and there seems to be a difference in the control transaction:

image This is the control transaction of your the FPGA implemented with your code, it doesn't do handshake after the Data0

image And this is the control transaction of a USB UART which end by an ACK handshake

I couldn't figure out any way to resolve this issue. Any help would be appreciated, thanks in advance.

P/s:

mauriliomauri commented 6 months ago

It seems that the setup is at the address 0x00. This is the default address at the power on and it is ok that the device doesn't respond. Whereas the PID IN is at the address 0x02. You should check the packets after the device accepts its new address with set_address request.

Long-Tam commented 6 months ago

Thanks mauriliomauri, I have just rechecked my connection and it turns out that my FPGA pins' logic high voltage is 5V, after convert it to 3.3 V, everything works.