Reputation: 11
I am using LWIP TCP/IP Stack on SAME70 without RTOS. Microcontroller hangs and stops responding after few seconds.
Following is my while loop.
` while (1) {
ethernet_task();
//********* WRITE PACKET BYTES
memcpy(&value_f, data_rx+4, 4);
value_w=(uint16_t)(value_f/0.01);
buffer[2]= (uint8_t)value_w;
buffer[3]= (uint8_t)(value_w>>8);
memcpy(&value_w, data_rx+8, 2);
value_w=(uint16_t)((value_w-65288)%65536);
buffer[4]= (uint8_t)value_w;
buffer[5]= (uint8_t)(value_w>>8);
memcpy(&value_f, data_rx+10, 4);
value_w=(int16_t)((value_f-32)/0.018);
buffer[8]= (uint8_t)value_w;
buffer[9]= (uint8_t)(value_w>>8);
tx_buffer(); //Transmits buffer on serial
}`
If I leave only ethernet_task(); in While loop UDP Echo and Ping work fine. I want to execute calculations and serial transmission in While loop without losing UDP response.
Upvotes: 0
Views: 135