FX3 problem with single data transfer. One word out of 1024 is missing

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

cross mob
IvPe_2751061
Level 1
Level 1

I am trying to use FX3 in Slave FIFO interface. I am using code from an example provided with AN65974.

The only difference to the example is that I tried to do it using single transfer with Burst set to 0 as follows:.

#else //16

    CyU3PGpifSocketConfigure (0,CY_U3P_PIB_SOCKET_0,3,CyFalse,0);

    CyU3PGpifSocketConfigure (3,CY_U3P_PIB_SOCKET_3,3,CyFalse,0);

#endif

Only flaga (DMA_RDY) is used.

I am sending a sequence of increasing numbers to check if it works .

It appears that one word (16 bit) is always missing each time after next 1024 bytes are transferred. It looks like this:

(at address 400h: word B1 5D is missing)

pastedImage_6.png

Here is FPGA state machine for a single transfer.

The fifo_emprty flag is not used.

Clipboard02.bmp

0 Likes
1 Solution

Hello Ivan,

If you are using only one flag i.e (DMA_READY) you don't need to call the CyU3PGpifSocketConfigure() API.

It is only used when we use the Watermark Flag.

Is this Flag dedicated to a thread or configured for current thread?

Watermark flag is used when partial flags are used. A watermark value must be selected such that the flag is asserted when the number of 32-bit words that may be read or written is less than or equal to the watermark value.

Are there any changes you made to the GPIF state machine (Please share the GPIF state machine and interface definition )

For which mode are using 1) LOOPBACK_SHRT_ZLP or 2) STREAM_IN_OUT or the default . This is asked  to know the DMA buffer size.

Can you probe the interfacing pins (i.e. clock, SLWR, SLCS, Flags, PKTEND) and share the traces so that I can understand the problem better. Do it without calling the CyU3PGpifSocketConfigure() API and epCfg.burstLen = 1; (default)

Regards,

Rashi

Regards,
Rashi

View solution in original post

4 Replies
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

- Can you try with burst size 1? What is the result?

- Also, let me know the no. clock cycles for which you drive the data after flag is asserted (burst =0)

Regards,

Rashi

Regards,
Rashi
0 Likes

Hello Rashi,

I changed FW to:

"

#else //16

CyU3PGpifSocketConfigure (0,CY_U3P_PIB_SOCKET_0,3,CyFalse,1);

CyU3PGpifSocketConfigure (3,CY_U3P_PIB_SOCKET_3,3,CyFalse,1);

"

Also:

"

epCfg.burstLen = 1;

"

A word is still missing at 1024 (A0,A2,A3...), then 2048 (A1,A3,A4...), etc.

The state machine is here:

"

assign slwr_ = (current_state == state_write) ? 1'b0 : 1'b1;

// state machine combo

always @(*)begin

next_state = current_state;

case(current_state)

state_idle:begin

next_state = state_wait_flaga;

end

state_wait_flaga :begin

if(flaga_d == 1'b1)begin

next_state = state_write;

end else begin

next_state = state_wait_flaga;

end

end

state_write:begin

next_state = state_write_wr_delay;

end

state_write_wr_delay:begin

next_state = state_idle;

end

endcase

end

"

The input data are coming at 16.368 MS, the FX3 clock is 6 times of it =

98.208.

The output clock are phase shifted 180, but tried w/o it as well.

I have reduced clocks to x 4 = 65.472. Same result.

Best regards,

Ivan

On Mon, Sep 23, 2019 at 11:24 PM RashiV_61 <community-manager@cypress.com>

0 Likes

Hello Ivan,

If you are using only one flag i.e (DMA_READY) you don't need to call the CyU3PGpifSocketConfigure() API.

It is only used when we use the Watermark Flag.

Is this Flag dedicated to a thread or configured for current thread?

Watermark flag is used when partial flags are used. A watermark value must be selected such that the flag is asserted when the number of 32-bit words that may be read or written is less than or equal to the watermark value.

Are there any changes you made to the GPIF state machine (Please share the GPIF state machine and interface definition )

For which mode are using 1) LOOPBACK_SHRT_ZLP or 2) STREAM_IN_OUT or the default . This is asked  to know the DMA buffer size.

Can you probe the interfacing pins (i.e. clock, SLWR, SLCS, Flags, PKTEND) and share the traces so that I can understand the problem better. Do it without calling the CyU3PGpifSocketConfigure() API and epCfg.burstLen = 1; (default)

Regards,

Rashi

Regards,
Rashi

Hello Rashi,

thank you that helped,

it appeared that I was using a  a mixture from streamer examples in SDK and AN .

I took GPIFII files from one and fifo firmware from another.

When I compared cyfxgpif2config.h from both, they appeared be different in one line.

In one version configuration register values were 0x00000018 and   0x00000019 and in another one (AN):

   0x00000018 and  0x00000018. When I tried to figure them out it looked like they indicated the same flag twice. 

The firmware code was also different.

Finally I used both code from SDK, because GPIF interface from AN doesn't feature flags. When I use both of them from the same source it start working.

Best regards,

Ivan

0 Likes