Serial overrun error

Discussion to talk about software related topics only.
dnishimura
Posts: 19
Joined: Fri Dec 19, 2014 3:07 pm

Serial overrun error

Post by dnishimura »

Periodically when reading off the UART1 using ReadWithTimeout, I get a overrun error as reported from GetUartErrorReg. There's no way the buffer is being overrun by the small amount of data that is being received. Are there any other conditions that would cause this error? I used both NNDK 2.7.1 and NNDK 2.7.0 on SB70LC.
User avatar
pbreed
Posts: 1091
Joined: Thu Apr 24, 2008 3:58 pm

Re: Serial overrun error

Post by pbreed »

You opened the serial port with openserial, not just leaving the polled normal startup in place?

What other code do you have running that might cause interrupts to turn off?
dnishimura
Posts: 19
Joined: Fri Dec 19, 2014 3:07 pm

Re: Serial overrun error

Post by dnishimura »

Yes I closed the serial port and reopened the port with openserial before reading from the port.

I am reading from the serial port in one task and sending data out on the IP network in another task. Would anything there cause interrupts to turn off?
User avatar
pbreed
Posts: 1091
Joined: Thu Apr 24, 2008 3:58 pm

Re: Serial overrun error

Post by pbreed »

Can you post your reading code?

Also what exact value are you getting for

GetUartErrorReg.
dnishimura
Posts: 19
Joined: Fri Dec 19, 2014 3:07 pm

Re: Serial overrun error

Post by dnishimura »

I emailed you the code. The error code that's returned is 1.
User avatar
pbreed
Posts: 1091
Joined: Thu Apr 24, 2008 3:58 pm

Re: Serial overrun error

Post by pbreed »

Don't see anything obviously wrong....

What baud rate are you running.... (IE is it a non-standard baud rate)
What do all of your log functions do time wise?

What sort of data are you receiving and at what rate?

Show me the details of opening the serial port ie what does
reset_serial(); do exactly.

What other tasks are running....
User avatar
pbreed
Posts: 1091
Joined: Thu Apr 24, 2008 3:58 pm

Re: Serial overrun error

Post by pbreed »

Also is this in release or debug?

If its in debug and you are stopped in the debugger the serial interrup cant fire and you will get overflows...
dnishimura
Posts: 19
Joined: Fri Dec 19, 2014 3:07 pm

Re: Serial overrun error

Post by dnishimura »

Happens in both debug and release without any breakpoints.
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: Serial overrun error

Post by rnixon »

I think you missed the majority of his questions. He'll probably need those answers to help you.
dnishimura
Posts: 19
Joined: Fri Dec 19, 2014 3:07 pm

Re: Serial overrun error

Post by dnishimura »

Ah yes sorry...overlooked the first set of questions:

1) baudrate: 115200, stopbits: 1, databits: 8, no parity
2) We are receiving just ascii data in packets of 24 to 49 characters. On average we get about 1 packet per second.
3) log functions are just a wrapper around iprintf with some additional info added in.
4) reset_serial() code here:

Code: Select all

int reset_serial()
{
    int gateway;
    SerialClose(1);
    gateway = OpenSerial(1, 115200, 1, 8, eParityNone);
    writestring(gateway, "!Gateway\r\n");
    return gateway;
}

5) The other task that's running is a task that sends data the data read from the serial port to a webserver using the SSL library (SSL_connect). There are no shared data between the tasks besides data that's passed between the tasks using OS_FIFO.
Post Reply