2017-03-25 01:09 PM
Hi,
Something is driving me crazy.
Actually I have written a program that
it:
receive 100chars each 60ms from USART1 and 2 with RXNE interrupt(baudrate 57600)
receive100chars each 100ms from Ethernet with PHY and after processing it sends to USARTs port with TXNE interrupt
sends 120 chars to PC via Ethernet each 100ms with Timer.
it works fine when I connect my board via st-link in debug mode but when I get off out of debug mode it works for 1-2 hours and suddenly hangs and disables Ethernet communication.In this states I can't realize what my problem is.
what is your idea about this strange states? why it works fine in debug mode?
Thanks in advance
2017-05-01 04:32 AM
Hi,
Thanks for your response and sorry for my long delay.
I have found something interesting with my communication, according to dear Clive one,Avatar and KIC8462852 EPIC204278916 I check different parts of my code and I see this error in my PC with wireshark program.
It shows me that my device (IP 150) 's TCP window has been zero however I clear TCP windows each time That I receive any new data.
uint32_t tcp_cb_func (int32_t socket, netTCP_Event event,const NET_ADDR *addr, const uint8_t *buf, uint32_t len) {
switch (event) { case netTCP_EventConnect:Ether.DataAvailable=0;return (1); case netTCP_EventData:Ether.DataAvailable=1;Ether.Len=len;memcpy(PCSTR, buf,len);netTCP_ResetReceiveWindow(Socket);break; } return (0);}But why it becomes zero?