cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

Contributor

Hi,

I've added below led test function to cyfxssrammaster.c.

static void

my_led (int loop, int time)

{

    for (int a = 0; a < loop; a = a + 1)

    {

    CyU3PGpioSetValue (LED_GPIO, CyFalse);      /* Turn LED-ON */

        CyU3PThreadSleep (time);             /* ON-time */

        CyU3PGpioSetValue (LED_GPIO, CyTrue);       /* Turn LED-OFF */

        CyU3PThreadSleep (time);            /* OFF-time */

    }

}

After firmware is loaded, I can see LED is blinking. Basically proved LED test code and HW are good.

But if I add my_led to SRAM_READ_COMMAND, led is not blinking.

This indicates SRAM_READ_COMMAND is never run.

My question is how to make the firmware run SRAM_READ_COMMAND?

pastedImage_1.png

0 Likes
Reply
1 Solution
Moderator
Moderator

Hello,

Please note that SRAM_READ_COMMAND is a vendor command used in the SRAMMaster project. To invoke the part of the code under this command, the corresponding vendor request should be issued from the host. Please see the attached screenshot inc which the Cypress USB Control Center issues the vendor request 0xBB which corresponds to SRAM_READ_COMMAND.

After the completion of vendor command, the data from the SRAM can be read into the host over the BULK IN endpoint.

Best regards,

Srinath S

View solution in original post

0 Likes
Reply
5 Replies
Employee

Could you please upload the whole project?

0 Likes
Reply
Moderator
Moderator

Hello,

Please note that SRAM_READ_COMMAND is a vendor command used in the SRAMMaster project. To invoke the part of the code under this command, the corresponding vendor request should be issued from the host. Please see the attached screenshot inc which the Cypress USB Control Center issues the vendor request 0xBB which corresponds to SRAM_READ_COMMAND.

After the completion of vendor command, the data from the SRAM can be read into the host over the BULK IN endpoint.

Best regards,

Srinath S

View solution in original post

0 Likes
Reply
Contributor

Could you give me an example of sending the 0xBB request with linux command line application.

I've tried GUI tool, it's working.

If I manually set “Req code” - 0xBB, and select “Req type” - Vendor, after click “Transfer Data”, probe has been triggered and it’s reading data out of FPGA.

2019-01-23 09_57_58-192.168.168.16 - Remote Desktop Connection.png

2019-01-23 09_56_57-192.168.168.16 - Remote Desktop Connection.png

0 Likes
Reply
Employee

You could invoke API libusb_control_transfer in Linux platform after you install libusb library.

Synchronous device I/O

For more example, you could refer to the folder ~/FX3_SDK_Linux_v1.3.3/cyusb_linux_1.0.4/src

0 Likes
Reply
Contributor

Tried below function, it's working! Thanks a lot!

   r = cyusb_control_transfer(h1, 0x40, 0xBB, 0x0000, 0x0000, buf, 16, timeout * 1000);

int libusb_control_transfer

(

libusb_device_handle *

dev_handle,

uint8_t

bmRequestType,

uint8_t

bRequest,

uint16_t

wValue,

uint16_t

wIndex,

unsigned char *

data,

uint16_t

wLength,

unsigned int

timeout

)

0 Likes
Reply