I’ve been wrestling with a problem for a while now and some input would be appreciated. My current project makes use of both the .NetMF Ethernet UDP stack and a couple of UARTs (Com1 and Com2).
The problem I am encountering is that when I have a reasonable amount of data going through the Ethernet (both TX and RX) I start getting SerialError.Overrun events. If I suspend all Ethernet traffic no overruns occur. (Baud rate is a lowly 19200 on Com1 and 115200 on Com2). I have tried using the Data_Received event, polled at 20Hz, 50Hz and as fast as the Processor can do it all with the same result. As the issue seems to be the hardware character buffer nothing I can do other than stopping the ethernet transmission seems to make a difference (which makes sense).
Over Ethernet I am sending roughly 78 bytes a second and receiving 238 bytes a second. The tx consists of roughly 11 packets a second and the rx is 14 packets a second (Therefore the main overhead will probably be the stack constructing the packet & crc).
I can choose to route the same data over Com2 (A backup link). In this scenario no error events are raised.
Reading through the documentation this error event is raised when bytes are lost because the USART low-level character buffer is full and does not get serviced in time.
I have performed some process profiling and the Ethernet stack is taking up even more time than my graphics library. (I’ve also tried disabling everything except the UART and Ethernet Stack with the same results).
I have tried to raise the priority of the USART using the Register function with no joy (I’m obviously missing a step somewhere but can’t find any documentation on the issue).
If anyone could shed some light on this it would be great,