Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

int TX_PACKET_LEN = 51200;//102400;
int packetlen = TX_PACKET_LEN;
unsigned int packets = 500; //1200;//1200;
unsigned long TIMEOUT = 1000;
byte * data;
byte * data_temp = NULL;
unsigned int total_cnt = 0;
unsigned int errors = 0;
double TheElapsedTime = 0;
PI_PipeNumber PipeNo = PI_EP8;
data = new byte [TX_PACKET_LEN*packets]; //allocate memory //
ResetFX2FifoStatus(USBDeviceList);
//starts test
bool bResultDataWrite = false;
byte PipeNoHex = 0x00;
unsigned int XferSizeRead=0;
unsigned int DeviceDriverBufferSize = 131072;//409600;//131072;
// Find a second bulk OUT endpoint in the EndPoints[] array
CCyBulkEndPoint *BulkOutEP = NULL;
TE_USB_FX2_SetData_InstanceDriverBuffer (USBDeviceList, &BulkOutEP, PipeNo, TIMEOUT, DeviceDriverBufferSize);
ElapsedTime.Start(); //StopWatch start
total_cnt = 0;
for (unsigned int i = 0; i < packets; i++)
{
     long packetlen = RX_PACKET_LEN;
     data_temp = &data[total_cnt];

     //start test
     SendFPGAcommand(USBDeviceList, FX22MB_REG0_START_RX);
     if (TE_USB_FX2_SetData(&BulkOutEP, data_temp, packetlen))
     {
         cout << "ERROR" << endl;
         break;
     }

//stops test
SendFPGAcommand(USBDeviceList, FX22MB_REG0_STOP);
total_cnt += packetlen;
}
//StopWatch timer
TheElapsedTime = ElapsedTime.Stop(false);
//stops test
Note: If you make the combination 2

  • data throughput is halved with regard to combination 1 and
  • the test will fail because it is not the way it is supposed to be used.

...

Byte

Value

Description

1

0xAD

I2C_WRITE command ID

2

0x3F

I2C Address
MB_I2C_ADRESS=0x3F

3

0x0C
(12)

FX2_Parameters.I2C_BYTES=0x0C
Number of bytes to write (max 32)

4

0x00

-

5

0x00

-

6

0x00

-

7

0x03

MB_Commands.FX22MB_REG0_START_RX
Start read data integrity test of data transmitted from computer to EP8 of FX2.

From 8 to 64

-

Not used

Table 34: FX22MB_REG0_START_RX MicroBlaze command.
Reply packet doesn't contain any usable information