I have implemented a TCP connection between a XMC4800 and a server. The XMC is my client. I can see in Wireshark, that the Controller receives packages because an Ack-Flag is sent afterwards to the server. Sending TCP Packages works fine, but I need to save the response from the server in a buffer, in order to work with the data.
Unfortunately, I co not want to unable the poll opportunity because in my further project, I need to work with an ethercat bus. Does anybody have an idea, why my code doesn't work?
tcp_recv(pcb_recv, client_recv); //ocb_recv is an empty pcb
err_t client_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
memcpy(recv_buffer, p->payload, p->tot_len);
/* @brief main() */
uint32_t timer_systimer_lwip, timer_systimer_counter;
int buff_length = strlen(recv_buffer);
bool send = false;
status = DAVE_Init(); /* Initialization of DAVE APPs */
if(status != DAVE_STATUS_SUCCESS)
/* Placeholder for error handler code.
* The while loop below can be replaced with an user error handler. */
XMC_DEBUG("DAVE APPs initialization failed\n");
/* Initialize and start lwip system timer */
timer_systimer_lwip = SYSTIMER_CreateTimer(100000,
/* Initialize and start client state counter timer */
timer_systimer_counter = SYSTIMER_CreateTimer (5000000,
/* Check if client state counter was incremented */
/* Connection already/still active? */
send = true;
send = false;
Thanks for your help 🙂
The thread was locked due to inactivity for a long time, you can continue the discussion on the topic by opening a new thread with reference to the locked one. The continuous discussion in an inactive thread may mostly be unattended by community users.
Thanks and Regards,