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?
Solved! Go to Solution.
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
Could you please upload the whole project?
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
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.
You could invoke API libusb_control_transfer in Linux platform after you install libusb library.
For more example, you could refer to the folder ~/FX3_SDK_Linux_v1.3.3/cyusb_linux_1.0.4/src
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 | ( | dev_handle, | |
uint8_t | bmRequestType, | ||
uint8_t | bRequest, | ||
uint16_t | wValue, | ||
uint16_t | wIndex, | ||
unsigned char * | data, | ||
uint16_t | wLength, | ||
unsigned int | timeout | ||
) |