Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
785 Views

ethernet example in cyclone V GT kits, can't drive the TSE , help!!

I use the ethernet example which is in the cyclone V GT installation package( cycloneVGT_5cgtfd9ef35_fpga\examples\board_update_ portal ) 

 

I download the c5gt_fpga_bup.sof into cyclone V GT Development board,and then debug my simple TSE driver ,I found some problem. 

 

1: i set the TSE into loop mode, RX_SGDMA's ISR is printing the received loopback data. 

 

the follow datas are received loopback data,i found a problem 

 

in first RX interrupt ,the datas are correct, but in the followed RX interrupts ,the datas are always zero ??? why???( It Looks like the SGDMA can't write correct data to receive memory) 

 

 

RX descriptor reported OK 

0 0 ff ff ff ff ff ff 0 1c 23 17 4a cb 8 6 0 1 8 0 6 4 0 1 0 1c 23 17 4a cb c0 a8 1 2 0 0 0 0 0 0 c0 a8 1 72 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc 0 0  

RX descriptor reported OK 

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  

RX descriptor reported OK 

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  

RX descriptor reported OK 

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  

RX descriptor reported OK 

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  

RX descriptor reported OK 

 

my simple drivers: 

 

ethernet_init(); 

sgdma_tx_dev = alt_avalon_sgdma_open("/dev/sgdma_tx"); 

sgdma_rx_dev = alt_avalon_sgdma_open("/dev/sgdma_rx"); 

alt_avalon_sgdma_register_callback( 

sgdma_rx_dev, 

(alt_avalon_sgdma_callback) &sgdma_rx_isr, 

//ALTERA_AVALON_SGDMA_CONTROL_IE_DESC_COMPLETED_MSK |  

ALTERA_AVALON_SGDMA_CONTROL_IE_CHAIN_COMPLETED_MSK | 

ALTERA_AVALON_SGDMA_CONTROL_IE_GLOBAL_MSK  

0); 

while(1){ 

usleep(1000000); 

alt_avalon_sgdma_construct_stream_to_mem_desc( 

&desc[10],// 

&desc[11],// 

rx_payload,// 

0,// 

0);//write_fixed 

 

 

alt_avalon_sgdma_construct_mem_to_stream_desc( 

&desc[2], 

&desc[3], 

buf, 

66, 

0, 

1,//SOP 

1,//EOP 

0); 

sgdma_rx和sgdma_tx 

alt_avalon_sgdma_do_async_transfer(sgdma_rx_dev, &desc[10]); 

usleep(100); 

alt_avalon_sgdma_do_sync_transfer (sgdma_tx_dev, &desc[2]); 

 

 

 

 

void sgdma_rx_isr(void * context, u_long intnum) 

int i=0; 

printf("RX descriptor reported OK\n"); 

for(i=0; i<68; i++){ 

printf("%x ",rx_payload); 

rx_payload=0x00; 

printf("\n"); 

}
0 Kudos
0 Replies
Reply