Trenz Electronic GmbH Support Forum

Trenz Electronic Products => Trenz Electronic FPGA Modules => Topic started by: umitcelik on September 19, 2011, 06:14:08 AM

Title: Microblaze to PC data transfer problem using USB
Post by: umitcelik on September 19, 2011, 06:14:08 AM
Hi,

I am using TE0320 board for my project. I need to make data transfer between PC and microblaze. I acheived to send data from PC to microblaze but I could not achieve to send data microblaze to PC.

This is my PC side code:

data = new byte [16]; //allocate memory
for (unsigned int j = 0; j < 16; j++)
      data[j] = j;

ResetFX2FifoStatus(handle);
if (TE0300_SetData(handle, data, sizeof(data), PI_EP8)) //sizeof(data)
   {
      cout << "ERROR" << endl;
   }
   
   SendFPGAcommand(handle,WRITETOUB); //starts test


Microblaze side code(In the interrupt handler):

XPS_FX2_SetUSB_FIFOadr(XPAR_XPS_FX2_0_BASEADDR, PI_EP8); //dataread         
count = XPS_FX2_GetRXFIFOcount(XPAR_XPS_FX2_0_BASEADDR);
DDR_MEM = XPS_FX2_ReadRXFifo(XPAR_XPS_FX2_0_BASEADDR);

When I run PC side code there is no error but every time XPS_FX2_GetRXFIFOcount in microblaze returns zero. so, XPS_FX2_ReadRXFifo(XPAR_XPS_FX2_0_BASEADDR) always zeros.. I connected rs232 port to see the content of the registers.

Could you help me, I dont know what am I doing wrong. I dont need fast data transfer(DMA). It is enough to send data microblaze to PC or PC to microblaze.

best regards,

-umit





Title: Re: Microblaze to PC data transfer problem using USB
Post by: Ales Gorkic on September 19, 2011, 09:27:27 AM
Hi Umit,

First of all:
1. Did you used the precompiled SW and bitstream? I suggest you use the bistream without bootloader.
2. In the PC terminal application press: 1 ent, 2 ent, w ent, r ent

If still does not work then send the both terminal outputs to get better insight.

Best regards,

Ales
Title: Re: Microblaze to PC data transfer problem using USB
Post by: umitcelik on September 19, 2011, 09:58:10 AM
Dear Ales,

I directly load the bitstream to fpga. I am not using bootloader at this step.
The reference design working properly. I tested it as you explained before. As you know it working with DMA.  I need to make custom design and make the USB transfer in microblaze. In the same project I achieved the data transfer microblaze to PC bu I could not achieve to send daha from PC to microblaze. In the past  you advised to me use "count = XPS_FX2_GetRXFIFOcount(XPAR_XPS_FX2_0_BASEADDR);" but when I send data from PC every times count is zero in microblaze.

I need simply filling a buffer in PC(it is enough just fill EP8) and capture the data in microblaze. I dont want to use DMA transfer.
I send my code block before. Could you please help me to solve this problem to continue my project.

regards..

-umit
Title: Re: Microblaze to PC data transfer problem using USB
Post by: Ales Gorkic on September 19, 2011, 10:03:42 AM
Hi Umit,

It seems like the DMA drains the FIFO. Did you disable DMA?
You can do it in HW (disconnect DMA busses from FX2) or comment in SW.

Best regards,

Ales