Hmmm.. yes you are right.. I use triple speed ethernet example and adds some module for my purpose.
And yes, I have debugged it.. I use mSGDMA MM-ST to check streaming data in Signal Tap, and works fine. But not in TCP IP
Yes, I have ISR Callback
/*
* ISR Function when mSGDMA Interrupt happens
*/
static void msgdma_rx_complete_isr(void *context) {
// IOWR_ALTERA_AVALON_PIO_DATA(PERIPHERAL_SUBSYSTEM_LED_PIO_BASE, 0xfd);
stop_dispatcher(MSGDMA_RX_CSR_BASE);
while(read_stopped(MSGDMA_RX_CSR_BASE) == 0);
reset_dispatcher(MSGDMA_RX_CSR_BASE);
enable_global_interrupt_mask(MSGDMA_RX_CSR_BASE);
msgdma_int_rx = 2;
}
Thanks for your additional info..
In the latest, there are some things that I have changed. And it worked for me...
Before: Memory Altmemphy DDR
After: double Onchip Memory for successive Nios and mSGDMA
Before: In MM to TCP IP Task
do {
read_ptr = (read_ptr + 1) % 2;
OSSemPend(Semaphore, 2, &err);
} while(err == OS_ERR_TIMEOUT);
// printf("------------------------------------------\n%d\n------------------------------------------\n", sizeof(iNetworkRadarData.data));
// printf("Send package 1\n");
length = sizeof(SGDMAMemory)/2;
error_code = send(conns->fd, (char*) &length, sizeof(length), 0);
error_code = send(conns->fd, (char*) &SGDMAMemory, length, 0);
// printf("Send package 2\n");
error_code = send(conns->fd, (char*) &length, sizeof(length), 0);
error_code = send(conns->fd, (char*) &SGDMAMemory + length, length, 0);
construct_standard_mm_to_st_descriptor(desc_tx_ptr, SGDMAMemory, 4*512,
DESCRIPTOR_CONTROL_GENERATE_SOP_MASK | DESCRIPTOR_CONTROL_GENERATE_EOP_MASK);
write_standard_descriptor(MSGDMA_TX_CSR_BASE,
MSGDMA_TX_DESCRIPTOR_SLAVE_BASE,
desc_tx_ptr);
// memset(SGDMAMemory, 0, sizeof(SGDMAMemory));
err = OSSemPost(Semaphore);
OSTimeDlyHMSM(0,0,0,5);
After: In MM to TCP IP Task
do {
read_ptr = (read_ptr + 1) % 2;
OSSemPend(Semaphore, 2, &err);
} while(err == OS_ERR_TIMEOUT);
// length = sizeof(SGDMAMemory)/2;
alt_u32 memory;
for(i = 0; i < 512; i++) {
if(read_ptr == 0)
memory = IORD_32DIRECT(SGDMA_MEM_0_BASE + i*sizeof(alt_u32), sizeof(alt_u32));
else
memory = IORD_32DIRECT(SGDMA_MEM_1_BASE + i*sizeof(alt_u32), sizeof(alt_u32));
}
length = 4*1024/8;
for(i = 0; i <4; i++) {
error_code = send(conns->fd, (char*) &length, sizeof(length), 0);
error_code = send(conns->fd, (char*) memory + i*length, length, 0);
}
err = OSSemPost(Semaphore);
OSTimeDlyHMSM(0,0,0,5);