Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IP core integration with Nios II #4

Closed
ExcielAT opened this issue Jun 2, 2022 · 6 comments
Closed

IP core integration with Nios II #4

ExcielAT opened this issue Jun 2, 2022 · 6 comments

Comments

@ExcielAT
Copy link

ExcielAT commented Jun 2, 2022

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!

@WangXuan95
Copy link
Owner

Did my original code works well? Before adding your vendor specific descriptor, it is recommended to run my original design.

@ExcielAT
Copy link
Author

ExcielAT commented Jun 3, 2022

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.

@WangXuan95
Copy link
Owner

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.

@ExcielAT
Copy link
Author

ExcielAT commented Jun 4, 2022

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.

@WangXuan95
Copy link
Owner

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.

@WangXuan95
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants