cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Sugita
Visitor
Visitor
181 Views
Registered: ‎05-24-2021

USB3.0 Bulk transfar to Register in PL

Hello.
I'm using Ultra96-v2 on bare metal.
I have modified the code of the USB mass storage class (xusb_intr_example) so that I can access the registers in the PL.
However, when I checked the operation using libusb1.0, there is a problem that the value written in the PL register is not output on the first read.

From the Linux (Ubuntu) host, access the registers of the PL connected to AXI_HPM0_FPD (0xA0000000) via USB 3.0.

The changes in the USB mass storage class (xusb_intr_example) of the software are as follows.

 

  • xusb_ch9_storage.c

Change idVendor to "0x03FD" and idProduct to "0x0000".

Sugita_0-1621903801801.png

 

Change bInterfaceclass to "USB_CLASS_VENDOR".

Sugita_1-1621903861873.png

 

Deleted "EpBufferRecv" line in "Usb_SetConfigurationApp".

Sugita_2-1621903906199.png

 

 

  • xusb_intr_example.c

Change to ".Usb_ClassReq = NULL,".

Sugita_3-1621903963541.png

 

Add three lines after "Usb_Start(UsbInstance.PrivateData);" in the main function, as shown in the figure below.

Sugita_4-1621904016722.png

 

Changed "BulkOutHandler" and "BulkInHandler" as shown in the following figure.

Sugita_5-1621904060158.png

 

I used libusb1.0 on Linux to read and write values to registers using bulk transfer (libusb_bulk_transfer)


Read the initial value ("200150"), and then write "01".
After that, the first read will output the initial value ("200150").
The second read will reflect the value you wrote ("01").
If you do not read twice, the written value will not be read.

 

Sugita_7-1621904156617.png

Attached is the application (libusb_tst.c) that performed the bulk transfer.

 

I want to know what the solution is.
I would appreciate any solution.

0 Kudos
0 Replies