Serial IN Interface in GPIF II

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
E_521156
Level 4
Level 4
100 sign-ins 50 replies posted 50 sign-ins

Hi ,
I have two FX3 boards. I used from Serial interface using GPIF II and Using FX3 GPIF in Serial Mode : Example projects  and I sent out data by serial out (DQ[15], SOF and clock(internal) ) in endpoint 0x01 output and it works when I checked on oscilloscope. (serial out interface in GPIF works)

I am trying to receive that data on the other board by serial in(DQ[14], SOF, EOF and clock(external))  by endpoint 0x81 input. I don't receive any thing. I connected  DQ[15], SOF and EOF  in one board to DQ[14], SOF and EOF in the other board, respectively by 3 wires and one more wire for GND.(should  I connect in another way?)
I modified the "usbtogpif" code and changed  CY_U3P_PIB_GPIF_SERIAL_IN_CONFIG = 0x00007c83  and CY_U3P_PIB_GPIF_SERIAL_OUT_CONFIG = 0x00001F82. I also tested different state for bit8-9 in CY_U3P_PIB_GPIF_SERIAL_IN_CONFIG.  when it is bi8:9=0, I always get zero in control center and for other values in these bits, I got error 997.  Should I change anything else?
Thanks

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

I downloaded the firmware from my previous response and programmed both the FX3 with respective firmware.

The results are as follows

gpif_serial.PNG

gpif_serial_1.PNG

Please try sending the data as per these settings and let me know the results.

It is strange the bulk out (usb to gpif ) is failing becaus usb block commits short packets also. Please confirm that you used C:\Users\rasx\Downloads\UsbtoGpif (1)\UsbtoGpif\Debug\UsbToGpif.img file for programming

The DMA buffer size as per the firmware is 512 bytes. Please try sending 512 bytes and check. As the PROD event would occur when the DMA buffer is full. The firmware does not commit partial DMA buffer. So please confirm you send the data equal or more than  DMA buffer size

There is a possibility of error 997 at bulk out to occur when the data is continuously sent to DMA buffer and the DMA buffer are not consumed by the consumer. As the buffer size is 512 bytes, in the firmware i shared in my previous response, you check by increasing the DMA buffer count.

Pins DQ 9 and DQ8 can be used as SOF and EOF respectively. You cannot use GPIO[26] and [27] as SOF and EOF.

GPIO 17 and 18 are not actually used in the GPIF state machine. Please ignore them.

Regards,

Rashi

Regards,
Rashi

View solution in original post

0 Likes
9 Replies
lock attach
Attachments are accessible only for community members.
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

Please let me know what is desired word size you want the serial IN to be configured for.

I have tested the default firmware shared in this thread Using FX3 GPIF in Serial Mode : Example projects using Streamer Device. It is working fine.

Please refer to the attached snippet of  streamer application

Regards,

Rashi

Regards,
Rashi
0 Likes
lock attach
Attachments are accessible only for community members.

Hi,
Thanks for your answer. the word size is 32 bit.
I connected two boards back to back(something like AN87216 by samtec connector) and connect pin15 and pin14 by a jumper.

As I mentioned, I also get zero same as you in control center and streamer. but I want to received whatever that I sent by "BULK out" from one board, in "BULK IN" of another board, but I always get zero because it is WORD_SIZE based and all time it takes zeros as data and I couldn't capture my data when it is not stream. I want data after SOF.  But when I change bi8:9 (sof to sof - sof to eof) in CY_U3P_PIB_GPIF_SERIAL_IN_CONFIG , I got error 997.


I did another test : I send constant data(x0EF) by streamer EP 0x01, and tried to get it in another streamer EP 0x81, it has shift by each stop and start in bulk in streamer: 0xbf, 0xfd, 0xfe, 0xef, 0x7f, 0xf7,....  and it goes to zero when I disconnect bulk out stream(I attached the screenshot).

My questions are:

1- How can I get stream data without shift(Synchronized with SOF)? 

2- How can I receive  whatever that i sent(data with each SOF), not more than that?  


Thanks

0 Likes
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

Apologies for late reply

Please share the header file (gpif2config.h) with settings (issue of shifting while starting and stopping) .

Regards,

Rashi

Regards,
Rashi
0 Likes
lock attach
Attachments are accessible only for community members.

Hi,
I attached two header file on two FX3.
File's suffix are changed here as _SerIn and _SerOut.

Thanks,

0 Likes
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

I am using this configurations

Serial in:

0x8000C300,  /*  CY_U3P_PIB_GPIF_CONFIG */  //External clock

0x00007C83,  /*  CY_U3P_PIB_GPIF_SERIAL_IN_CONFIG */

Serial out:

0x8000C3B0,  /*  CY_U3P_PIB_GPIF_CONFIG */  //Internal clock

0x00001F83,  /*  CY_U3P_PIB_GPIF_SERIAL_OUT_CONFIG */

I am able to get the shifting data as you mentioned but that is what is expected every positive edge of clock one bit will be pushed in.

But the usb block will not consume the data every positive edge of clock.

As per the output at my end the sequence is (input 0xEF)

0xFE > 0xBF (shift by 2) > 0xEF (shift by2) > 0xFB  (shift by2) > 0xFE (shift by2)

This behavior is expected. the sequence will depend on the time you consume the data

I am able to reproduce the 997 error for settings sof to sof. I will get back on this.

Regards,

Rashi

Regards,
Rashi
0 Likes
lock attach
Attachments are accessible only for community members.

Hello,

Please test the attached firmware

usbtogpif -  FX3 Transmitter

gpiftousb - FX3 Receiver

Hardware setup

gpif_serial.PNG

The results will be as follows

Bulk OUT from transmitter

gpif_serial_in.PNG

Bulk IN from reciever

gpif_serial_in1.PNG

Please check at your end and let me know the results

Regards,

Rashi

Regards,
Rashi
0 Likes

Hi,
Thanks for your reply.
I uses the attached firmware but it doesn't work. I got error 997 for both in and out.
Even I only loaded USBtoGpif on a board, but I got :BULK OUT transfer failed with Error Code:997.

In hardware setup, you set DQ08 and DQ09. How can I change it to Gpio[26] and Gpio[27]?

In GPIF II project, it is GIO17 and 18 and I couldn't see them in state machine.

Thanks

0 Likes
lock attach
Attachments are accessible only for community members.
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

I downloaded the firmware from my previous response and programmed both the FX3 with respective firmware.

The results are as follows

gpif_serial.PNG

gpif_serial_1.PNG

Please try sending the data as per these settings and let me know the results.

It is strange the bulk out (usb to gpif ) is failing becaus usb block commits short packets also. Please confirm that you used C:\Users\rasx\Downloads\UsbtoGpif (1)\UsbtoGpif\Debug\UsbToGpif.img file for programming

The DMA buffer size as per the firmware is 512 bytes. Please try sending 512 bytes and check. As the PROD event would occur when the DMA buffer is full. The firmware does not commit partial DMA buffer. So please confirm you send the data equal or more than  DMA buffer size

There is a possibility of error 997 at bulk out to occur when the data is continuously sent to DMA buffer and the DMA buffer are not consumed by the consumer. As the buffer size is 512 bytes, in the firmware i shared in my previous response, you check by increasing the DMA buffer count.

Pins DQ 9 and DQ8 can be used as SOF and EOF respectively. You cannot use GPIO[26] and [27] as SOF and EOF.

GPIO 17 and 18 are not actually used in the GPIF state machine. Please ignore them.

Regards,

Rashi

Regards,
Rashi
0 Likes

Thank you so much for your help.
It works now with these setting.

Thanks

0 Likes