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.
Change idVendor to "0x03FD" and idProduct to "0x0000".
Change bInterfaceclass to "USB_CLASS_VENDOR".
Deleted "EpBufferRecv" line in "Usb_SetConfigurationApp".
Change to ".Usb_ClassReq = NULL,".
Add three lines after "Usb_Start(UsbInstance.PrivateData);" in the main function, as shown in the figure below.
Changed "BulkOutHandler" and "BulkInHandler" as shown in the following figure.
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.
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.