cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

lopo_1264666
New Contributor II

From "SuperSpeed Design Examples V1.2.1" and with CollectData set to "File To Receive".

Using Counter1.xsvf and defaulted GPIF clock (80MHz) for GPIF_Example1, found out that the gap = 56 forever using CheckData for File Transfer TimeOut = 20s. Next, I used command “PCLK-“ to reduce the GPIF clock to 50MHz and the gap reduced to 40 forever for File Transfer TimeOut = 20s.

Using Counter1.xsvf and defaulted GPIF clock (80MHz) for GPIF_Example2, found out that the gap alternates between these 2 values: 8192 and -8192 using CheckData for File Transfer TimeOut = 20s. Next, I used command “PCLK-“ to reduce the GPIF clock to 50MHz and the gap changed to -1 forever for File Transfer TimeOut = 20s.

Since gap = -1 represents perfect case where host computer can keep up with the counter count in CPLD while gap = positive number means missing counter count, how about -8192?

I don’t really understand the last statement returned by CheckData. TotalMissedSamples = summation of all gap values? How about the percentage analysis such as 2%, 1160%? I tried to plug in the numbers but couldn’t get its value correctly. Please refer to my attachment.

0 Likes
11 Replies
Hemanth
Moderator
Moderator

Hi,

Did you get a chance to look at the following CheckData.cpp file in the below path:

SuperSpeed_Design_Examples_V1.2.1\SuperSpeed Design Examples V1.2.1\Visual Studio Projects\CheckData\CheckData

You can find the logic here.

Regards,

Hemanth

Hemanth
0 Likes
Hemanth
Moderator
Moderator

Alternating 8192 and -8192 may also mean Host is not keeping up.

Regards,

Hemanth

Hemanth
0 Likes
lopo_1264666
New Contributor II

I added in two printf() statement there to check “CorrectValue” and “FileBuffer” values. I was surprised to find out that new exe and old exe showed different results. For an example, using Counter1.xsvf and GPIF_Example1, old exe gives gap = 56 while new exe gives gap = 0 with default settings. I am not sure if I overlook sth.

while (BytesRead)

{

Success = ReadFile(ReadFileHandle, FileBuffer, sizeof(FileBuffer), &BytesRead, 0);

for (i=0; i<BytesRead/4; i++)

{

if (FirstTime)

{

FirstTime = false;

CorrectValue = FileBuffer[0];

}

else CorrectValue++;

TotalSamples++;

printf("\nCorrectValue = %ld", CorrectValue);

printf("\nFileBufferValue = %ld", FileBuffer);

if (FileBuffer != CorrectValue)

{

MissedSamples = FileBuffer - CorrectValue;

Value = FileBuffer;

FilePtr = &FileBuffer;

TotalMissedSamples += MissedSamples;

printf("\nGap of %d at index %d", MissedSamples, TotalSamples);

CorrectValue = FileBuffer; // Fixup for next sample

}

}

}

0 Likes
lopo_1264666
New Contributor II

Showing below is CheckData output where I used the same "CollectData.bin" file for both exe. The original exe showed gap = 56 but the new exe showed gap = 0 where CorrectValue tracks FileBufferValue and both count.

GPIF_Example1_and_Counter1.png

0 Likes
Hemanth
Moderator
Moderator

Hi,

Please let me know which are the old and new exe you are referring to?

Regards,

Hemanth

Hemanth
0 Likes
lopo_1264666
New Contributor II

New exe has these 2 extra lines of codes:

· printf("\nCorrectValue = %ld", CorrectValue);

printf("\nFileBufferValue = %ld", FileBuffer);

Original exe showed this result:

Gap of 55 at index 4097

Cap of 55 at index 8193

Gap of 56 at index 12289

……

New exe showed this result:

CorrectValue = 88833281

FileBufferValue = 88833281

CorrectValue = 88833282

FileBufferValue = 88833282

……

0 Likes
Hemanth
Moderator
Moderator

can you please share the .bin file you used?

Regards,

Hemanth

Hemanth
0 Likes
lopo_1264666
New Contributor II

The file size is huge ~ 3GB.

0 Likes
Hemanth
Moderator
Moderator

Please copy first 10KB of data into separate file and save it.

Regards,

Hemanth

Hemanth
0 Likes
lopo_1264666
New Contributor II

I don’t know how to split and save the file.

There is another discussion “DMA watermark<https://community.cypress.com/message/227405#227405>“ with the same problem description and your colleague is getting in the CPLD board to duplicate my problem.

0 Likes
Hemanth
Moderator
Moderator

Okay. we can wait for reproducing the problem.

Meanwhile if possible, you can use Hex editor neo or HxD editor to copy first 10KB to a new file.

Regards,

Hemanth

Hemanth
0 Likes