cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

anal_2415406
New Contributor

Hi,

For our application, we need GPIF 32 bit for communicating between FX3 and Artix7 FPGA. A design was made in GPIFII designer following AN75779 as we need UVC for streaming video from a camera sensor. In GPIFII designer, interface was changed to 32 bit and LD_DATA_COUNT and LD_ADDR_COUNT was adjusted as per instructions mentioned in the datasheet. We have attached the GPIFII designer project for perusal. It would be great if someone can confirm whether the project and files generated are correct.

We were getting errors in DMA channel commit. While changing to 32bit implementation, we have modified the following.

  • /* UVC Probe Control Settings for a USB 3.0 connection. */

uint8_t glProbeCtrl[CY_FX_UVC_MAX_PROBE_SETTING] = { 0x00, 0x00, /* bmHint : no hit */

0x01, /* Use 1st Video format index */

0x01, /* Use 1st Video frame index */

0x0A, 0x8B, 0x02, 0x00, /* Desired frame interval in the unit of 100ns: 60 fps */

0x00, 0x00, /* Key frame rate in key frame/video frame units: only applicable

to video streaming with adjustable compression parameters */

0x00, 0x00, /* PFrame rate in PFrame / key frame units: only applicable to

video streaming with adjustable compression parameters */

0x00, 0x00, /* Compression quality control: only applicable to video streaming

with adjustable compression parameters */

0x00, 0x00, /* Window size for average bit rate: only applicable to video

streaming with adjustable compression parameters */

0x00, 0x00, /* Internal video streaming i/f latency in ms */

//OPENCV

0xF0, 0xF9, 0x2C, 0x00, /* Max video frame size in bytes */

0x00, 0x78, 0x00, 0x00 /* No. of bytes device can rx in single payload = 30 KB */

};

/* UVC Probe Control Setting for a USB 2.0 connection. */

uint8_t glProbeCtrl20[CY_FX_UVC_MAX_PROBE_SETTING] = { 0x00, 0x00, /* bmHint : no hit */

0x01, /* Use 1st Video format index */

0x01, /* Use 1st Video frame index */

0x0A, 0x8B, 0x02, 0x00, /* Desired frame interval in the unit of 100ns: 15 fps */

0x00, 0x00, /* Key frame rate in key frame/video frame units: only applicable

to video streaming with adjustable compression parameters */

0x00, 0x00, /* PFrame rate in PFrame / key frame units: only applicable to

video streaming with adjustable compression parameters */

0x00, 0x00, /* Compression quality control: only applicable to video streaming

with adjustable compression parameters */

0x00, 0x00, /* Window size for average bit rate: only applicable to video

streaming with adjustable compression parameters */

0x00, 0x00, /* Internal video streaming i/f latency in ms */

// OPENCV.

0xF0, 0xF9, 0x2C, 0x00, /* Max video frame size in bytes */

0x00, 0x78, 0x00, 0x00 /* No. of bytes device can rx in single payload =30KB */

};

  • /* UVC Video Streaming Endpoint Packet Size */

#define CY_FX_EP_BULK_VIDEO_PKT_SIZE    (0x400)         /* 1024 Bytes */

/* UVC Video Streaming Endpoint Packet Count */

#define CY_FX_EP_BULK_VIDEO_PKTS_COUNT  (0x1E)          /* 16 packets (burst of 16) per DMA buffer. */

/* DMA buffer size used for video streaming. */

#define CY_FX_UVC_STREAM_BUF_SIZE      (CY_FX_EP_BULK_VIDEO_PKTS_COUNT * CY_FX_EP_BULK_VIDEO_PKT_SIZE)  /* 16 KB */

/* Maximum video data that can be accommodated in one DMA buffer. */

#define CY_FX_UVC_BUF_FULL_SIZE        (CY_FX_UVC_STREAM_BUF_SIZE - 16)

/* Number of DMA buffers per GPIF DMA thread. */

#define CY_FX_UVC_STREAM_BUF_COUNT     (4)

  • DQ32bit is set to true, SPI is disabled

is there any change we need to make in DMA width or something to get successful transactions or CY_U3P_PIB_GPIF_BUS_CONFIG field

0 Likes
1 Solution
SrinathS_16
Moderator
Moderator

Hello,

- In the GPIF state machine, the LD_ADDR_COUNT and LD_DATA_COUNT values need to be filled with value such that is satisfies the below equation.

pastedImage_1.png

Since, you have used a 16kB buffer, a 32-bit wide data bus and header/footer data, this number should be loaded to 4191. Rest of the changes are fine for a 32-bit sensor.

- Also, please capture the USB traces during the failure to see the actual number of bytes transmitted. You can use a software analyzer to view the data.

Best regards,

Srinath S

View solution in original post

0 Likes
5 Replies
SrinathS_16
Moderator
Moderator

Hello,

- If you have UART debug prints in your application, kindly share the same.

- Do you see multiple commit buffer failures and does the application stop?

- Please follow the instructions in the below KBA if the CyU3PDmaChannelCommitBuffer() API fails with an error code 71.

Invalid Sequence Error in Multi-Channel Commit Buffer - KBA218830

Best regards,
Srinath S

0 Likes
anal_2415406
New Contributor

Hi,

As suggested by you, i tried adding the fix for commit buffer, but there is no difference. My amcap still shows a black screen. I have attached th entire project and uART prints for the issue. For shifting to GPIF 32 bit mode, please do confirm whatever we have done is enough or not.

commitbuffer.png

0 Likes
anal_2415406
New Contributor

Hi Srinath,

Any suggestions?

0 Likes
anal_2415406
New Contributor

Is there any example project for GPIFII 32bit implementation? If yes, please share the same.

Do we have to make any changes in DMA configuration for successful transactions when we change from 16 to 32bit?

0 Likes
SrinathS_16
Moderator
Moderator

Hello,

- In the GPIF state machine, the LD_ADDR_COUNT and LD_DATA_COUNT values need to be filled with value such that is satisfies the below equation.

pastedImage_1.png

Since, you have used a 16kB buffer, a 32-bit wide data bus and header/footer data, this number should be loaded to 4191. Rest of the changes are fine for a 32-bit sensor.

- Also, please capture the USB traces during the failure to see the actual number of bytes transmitted. You can use a software analyzer to view the data.

Best regards,

Srinath S

View solution in original post

0 Likes