Forum Discussion
Altera_Forum
Honored Contributor
16 years agoThe communication fails after a while, but it seems to fail at a certian point. I have a Matlab function which transmits 1400 bytes. I'm able to transmit these bytes correctly two times, but something always goes wrong when I try to send these bytes a third time. My sss_exec_command function is as follows:
void sss_exec_command(SSSConn* conn)
{
int free_rx_space;
int bytes_to_process = conn->rx_wr_pos - conn->rx_rd_pos;
while(bytes_to_process--)
{
IOWR_32DIRECT(DDR2_SDRAM_BASE, sdram_addr, *(conn->rx_rd_pos));
sdram_addr++;
conn->rx_rd_pos = conn->rx_rd_pos + 2;
bytes_to_process--;
}
free_rx_space = SSS_RX_BUF_SIZE-(conn->rx_wr_pos-conn->rx_buffer);
counter = counter + 1;
if (teller >= 255)
{
printf("Free buffer space: %d \n", free_rx_space);
counter = 0;
}
return;
}
I don't send back anything, and as you can see from the code above I tried to look at the free buffer space. It printed out the same number every time, 218. I also tried your echo test and it worked fine. Did you have to make changes in other methods than the sss_exec_command() and the sss_handle_recieve() ?