Otherwise synchronization between tasks of same priority will be necessary.Īnd the valid range for thread priority of LwIP threads in CubeMX is not 0.6, but like -3.3.Įvaluating return value of HAL_ETH_TransmitFrame() in low_level_output() would be also helpful to avoid unsent packets. I think the default thread priorities for LwIP threads, assigned in CubeMX, has to be lower than osPriorityRealtime (ethernetif_input() must have higher priority than concurrent LwIP threads). This unsent ethernet frame causes a TCP retransmission with delay in communication (Wireshark). Unfortunately the return code of HAL_ETH_TransmitFrame() is not evaluated, so this failure is very hard to find. That fails because ethernet ressource is locked by the receiving function of other thread ethernet_input() in this moment (HAL_BUSY). Sometimes ethernetif_input() is interrupt in function HAL_ETH_GetReceivedFrame_IT() and OS is switching to tcpip_thread, that try to send a frame with function HAL_ETH_TransmitFrame() in low_level_output(). So these threads are in immediate concurrence with the ethernet input thread ethernetif_input() and causing synchronization problems in preemptive multitasking OS: But a value of 3 will be interpreted as osPriorityRealtime (= +3) and assigned to an absolute priority value of 6 (highest priority level)! By default there will be assigned a thread priority of 3 for LwIP threads (TCPIP_THREAD_PRIO, DEFAULT_THREAD_PRIO and SLIPIF_THREAD_PRIO). So the current sequence number must always be greater or equal to the previous number, and if Wireshark sees a retransmission the sequence number is 'old. Try changing other aspects of the connection, using other services, to narrow down what's wrong.I use a STM32F777 configuration with LwIP stack and multitasking FreeRTOS, generated with CubeMX. If packets are in the correct order, the TCP sequence is either the same (if the previous packet had no content) or greater than the sequence number in the previous packet. try to update drivers or boot from a linux live CD and see if the same thing happens.Is your friend running an exotic firewall that could be turned off? Does the ISP have some usage rules? there are protocol-aware firewalls which may take a little while to work out what you are doing before they decide to drop packets on a particular connection.Check by using another service at the same time and see if it's affected by the outage too.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |