Increase priority of network threads for STM32 targets #1965
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Motivation and Context
The TCP/IP and the LWIP threads have the same priority as the CLR thread. If the CLR is busy, it's possible that the network communication is interrupted. This leads to a lot of tcp retransmissions and timeout problems.
How Has This Been Tested?
We have tested this on a custom STM32F427 based target with network capabilities, running an application with a modbus over TCP implementation. If the CLR is busy (e.g. during SD-card write or similar), we can see that the low_level_input function is no longer called regularly, which makes that the read function runs into a timeout.
After increasing the priorities, this problem does no longer occur.
We also verified with a stress test, that no problems occur if the data is not read out immediately and the receive buffer is going to be full. The window update mechanism works very well.
Types of changes
Checklist: