IP core integration with Nios II
ExcielAT opened this issue · 6 comments
An important part is the integratoon with microprocessors. So, i tried to build an IP core based on your design and with this design i could communicate using CDC interface. Now I am trying to build with vendor specific descriptor, but still can't make it works. Hoping for some help!
Did my original code works well? Before adding your vendor specific descriptor, it is recommended to run my original design.
I have not start that part.
I think vendor specific descriptor setting is a bit hard for me, because its first time i work with usb interface.
I mean you should do it step-by-step. There's no need to run in the NIOS SOPC system for the first time. You can directly build a simple RTL-only FPGA project, including my Verilog code (without any modification), soldering the USB circuit, and trying to run it on board. If success, when you plug the USB to PC, you will see the USB-CDC device. After this simple RTL-only project is verified, you can try to integrate it to NIOS SOPC system.
Yes. That's what i did, in fact, works perfect. And after that I did incorporate it to NIOS and works perfect every time I configure it using DE0-NANO and CDC descriptor setting. I use your first recommended setting. What I mean is that I need the way to build using vendor specific settings.
There's a RAM wire [7:0] descriptor_rom [1024]
in usb_cdc_top.sv
. You can modify it to make your own descriptor, including device descriptor , string descriptor , configuration descriptor , interface descriptor , endpoint descriptor ... . This will need some USB developing skills to understand the meaning of these descriptors. Maybe you need to learn USB specification first.
BTW, a quick way for you to make your own descriptors is to use the software called 'USBlyser'. Using USBlyser, you can view and copy the descriptors from existing USB devices (such as your mouse and USB disk), and of course, this way can only let you to 'copy' the existing USB devices to FPGA.
Besides the descriptors, note that my usbfs_core_top.sv
only offers two endpoints: endpoint 0x01 for data sending and endpoint 0x81 for data receiving. So it cannot realize some complex USB devices (such as USB-hub or multichannel USB-serial) which has more endpoints. Unless someone modify my usbfs_core_top.sv
, which is quite difficult. But don't worry, quite a few USB devices use only two endpoints.
I‘ve updated this repo in 2022.10. Now it is more convenient to customize descriptors, and provide more examples of USB devices (UVC camera, UAC audio, and USB disk). If you need to develop other USB devices, please read readme.md
.