cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
1,585 Views
Registered: ‎04-06-2018

USB Interface for Zynq SoC

Jump to solution

Hello everyone

 

I started a few weeks ago working on the MicroZed board, equipped with a ZYNQ SoC, and I have to receive datas from the USB port of the board (in the end I'll have to catch a video stream from the USB). I'm new in the field of USB interface, and xilinx tools, so I have a lot of trouble!

 

I made some research, I found a lot of code (like the xusbps, since I'm coding in C), but I don't know how to use it, and there I'm a little bit lost! Does someone has an idea on how to use the USB port? The only posts I found on forums seems to be written by experts, for experts :p

 

Thanks for your help!

 

Thomas

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Moderator
Moderator
1,858 Views
Registered: ‎02-07-2018

Hi ,

 

Please  refer below link for verifying usb peripheral mode, The bare metal driver will only support peripheral mode and it will not host & otg mode.

 

http://www.wiki.xilinx.com/Zynq+Standalone+USB+device+driver

 

You can find the bare metal USB applications in SDK installed path : C:\Xilinx\SDK\2017.3\data\embeddedsw\XilinxProcessorIPLib\drivers\usbpsu_v1_3\examples

Please create an empty application with SDK and copy this files (xusbpsu_ch9_storage.c , xusbpsu_ch9_storage.h , xusbpsu_ch9.c , xusbpsu_ch9.h , xusbpsu_class_storage.c , xusbpsu_class_storage.h , xusbpsu_intr_example.c)  and don’t copy *dfu files and build.

 

For your reference to create an application using SDK:

https://www.xilinx.com/support/documentation/sw_manuals/xilinx2013_4/SDK_Doc/tasks/sdk_t_project_creation_zynq_fsbl.htm

 

Please let me know in case if you face any issues.

 

Thanks & regards

Aravind

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------

 

View solution in original post

5 Replies
Highlighted
Moderator
Moderator
1,859 Views
Registered: ‎02-07-2018

Hi ,

 

Please  refer below link for verifying usb peripheral mode, The bare metal driver will only support peripheral mode and it will not host & otg mode.

 

http://www.wiki.xilinx.com/Zynq+Standalone+USB+device+driver

 

You can find the bare metal USB applications in SDK installed path : C:\Xilinx\SDK\2017.3\data\embeddedsw\XilinxProcessorIPLib\drivers\usbpsu_v1_3\examples

Please create an empty application with SDK and copy this files (xusbpsu_ch9_storage.c , xusbpsu_ch9_storage.h , xusbpsu_ch9.c , xusbpsu_ch9.h , xusbpsu_class_storage.c , xusbpsu_class_storage.h , xusbpsu_intr_example.c)  and don’t copy *dfu files and build.

 

For your reference to create an application using SDK:

https://www.xilinx.com/support/documentation/sw_manuals/xilinx2013_4/SDK_Doc/tasks/sdk_t_project_creation_zynq_fsbl.htm

 

Please let me know in case if you face any issues.

 

Thanks & regards

Aravind

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------

 

View solution in original post

Highlighted
Visitor
Visitor
1,527 Views
Registered: ‎04-06-2018

Hello

 

Thanks a lot for your help!

 

I did what you told me, I created a new empty project, copied the files, but I have some errors with the defines from the "xparameters.h" header file. In fact in the source code I copied I find a lot of definitions not written in the xparameters.h

 

Do you know how to fix that? I don't feel like I should put some random values for the variables like "DEVICE_ID" or whatever

 

Thanks

 

PS: I'm using the usbpsu v1_2, since I don't have the v1_3 in my SDK install. A suppose there is not a lot of difference between these 2 versions for my purpose... Feel free to tell me if I absolutely need the v1_3

0 Kudos
Highlighted
Moderator
Moderator
1,512 Views
Registered: ‎02-07-2018

Hi,

 

Yes you are right usbpsu v1_2 is having some build errors and usbpsu v1_3 is working fine . more ever for zynq-7000 dont use usbpsu_v3 drivers path.

Please build the files from this path:C:\Xilinx\SDK\2017.3\data\embeddedsw\XilinxProcessorIPLib\drivers\usbps_v2_4\examples path for zynq platform.

 

Let me know if you face any issues.

 

Thanks & regards

Aravind

 

 

 

Highlighted
Visitor
Visitor
1,503 Views
Registered: ‎04-06-2018

 I'm having a look at the usbps v2_4 code, and something is weird:

 

I'm stuck in a while loop, in the xusbps_intr_example.c code:

 

line 312:

while(NumReceivedFrames < 1){

          /*NOP*/

}

 

And nowhere in the project the NumReceivedFrame's value is modified.

Then, I don't really understand what this code is supposed to do, I mean, I build, compile and execute the code, and nothing happens, even when I plug in a USB key. (Sorry if I have troubles to understand, I'm all learning by myself with this project)

0 Kudos
Highlighted
Moderator
Moderator
1,427 Views
Registered: ‎02-07-2018

Hi,

 

Let  me know is it worked or not, It should work if you follow my previous steps which i mentioned in same thread.

 

 

Thanks & regards

Aravind

0 Kudos