Issues with ReadFromPipeOut

Hi,

I am trying to read from XEM3010 bytes that I wrote to it. But it does not read what I wrote to it. When I print the array used to read the bytes from the board to the standard output, I get garbage characters. Please see below a section of the code.
I am writing 1024 bytes to Pipe 0x80 and reading it out from pipe 0xA0. Are those endpoints correct in my case?

Question:
In general, if we write n number of bytes at pipe in A located at address 0xAA, how do we determine the address of the pipe out B(i.e 0xBB for example) to read out from the n bytes?


xem->UpdateWireIns();
    xem->ActivateTriggerIn(0x40, 0);

WrittenLength = xem->WriteToPipeIn(0x80, 1024, WrittenBuffer);
  
printf("%d bytes were written for the second time.\n",WrittenLength); // the value of WrittenLength is 1024

xem->UpdateTriggerOuts();
if (!(xem->IsTriggered(0x60, 1)))
{
	printf("ERROR:Trigger failed.\n");
    exit(0);
}

xem->UpdateWireOuts();
// Read the resulting RAM block. 0xA0
if (((ReadLength = xem->ReadFromPipeOut(0xA0, 1024, ReadBuffer)) == 0 ))
{
	printf("ERROR:ReadFromPipeOut failed.\n");
    exit(0);
}
printf("%d bytes were read.\n",ReadLength); // Thevalue of ReadLength is 0.

Additional info:
Device firmware version: 1.4
Device device ID: Opal Kelly XEM3010

Thanks for your help.

Regards,

Fabini

Hi I am using verilog to read and write data into the BOARD it works fine as long as it is simple read and write but when i use the same concept for huge prog the output from the ram seems to be absurd . Did you happen to find why is it happening like that .