Skip navigation.
Home
The QNX Community Portal

View topic - CPU usage high with serial port drivers

CPU usage high with serial port drivers

For discussion of realtime and/or embedded programming.

CPU usage high with serial port drivers

Postby Ericxx » Thu Aug 20, 2015 5:05 pm

Hello all,

We have an OMAP3530 based QNX6.5.0 system. With the BSP image, after boot up, the serial driver CPU usage quite high as 20% as shown in the attached figure. We have set the baud rate of the serial port the same as the peripherals. However, after unplugging the serial peripherals, the serial driver CPU usage drops to around 1% only. Can I say that the serial peripherals have been receiving more data than it can consume and cause high CPU usage? In addition, the SD card driver seems to be called either by kernel logger because of the serial driver problem, as I didn't start any user application yet. As sloginfo prints out the following error message of the serial port. Can please help suggest on this? Thanks.

Time Sev Major Minor Args
Jan 01 00:13:33 3 6 0 io-char: S/W buffer Overrun error on /dev/ser3
Jan 01 00:13:33 3 6 0 io-char: Framing error on /dev/ser3
Jan 01 00:13:33 3 6 0 io-char: S/W buffer Overrun error on /dev/ser3
Jan 01 00:13:33 3 6 0 io-char: Framing error on /dev/ser3
Jan 01 00:13:33 3 6 0 io-char: S/W buffer Overrun error on /dev/ser3
Jan 01 00:13:33 3 6 0 io-char: Framing error on /dev/ser3
Jan 01 00:13:33 3 6 0 io-char: S/W buffer Overrun error on /dev/ser3
Jan 01 00:13:33 3 6 0 io-char: Framing error on /dev/ser3
Jan 01 00:13:33 3 6 0 io-char: S/W buffer Overrun error on /dev/ser3
Jan 01 00:13:33 3 6 0 io-char: Framing error on /dev/ser3
Jan 01 00:13:33 3 6 0 io-char: S/W buffer Overrun error on /dev/ser3
Jan 01 00:13:33 3 6 0 io-char: Framing error on /dev/ser2
Jan 01 00:13:33 3 6 0 io-char: S/W buffer Overrun error on /dev/ser2
Jan 01 00:13:33 3 6 0 io-char: Framing error on /dev/ser3
Jan 01 00:13:33 3 6 0 io-char: Framing error on /dev/ser2
Jan 01 00:13:33 3 6 0 io-char: S/W buffer Overrun error on /dev/ser3


Best regards,
Eric
Attachments
qnx_processesInfo.png
(55.8 KiB) Not downloaded yet
qnx_usage.png
(50.94 KiB) Not downloaded yet
Ericxx
Senior Member
 
Posts: 158
Joined: Mon Jun 09, 2008 1:38 pm

Re: CPU usage high with serial port drivers

Postby Tim » Thu Aug 20, 2015 6:07 pm

Eric,

Can I ask you an obvious question. Is your telnet session coming in over the serial port? If it is, then it's obviously affecting your serial driver CPU usage!

How many serial devices do you have attached and at what rates are they sending serial data?

Tim
Tim
Senior Member
 
Posts: 1388
Joined: Wed Mar 10, 2004 12:28 am

Re: CPU usage high with serial port drivers

Postby Ericxx » Fri Aug 21, 2015 6:48 am

Hello Tim,

The telnet session is connected via WiFi instead of serial port. Two peripheral serial devices keep sending data to the QNX system, one with a baud rate of 115200 at 100 Hz, the other one with a baud rate of 230400 at 50 Hz. Another phenomenon is when I launch my application, the CPU usage is about only 10%. So the devc-seromap should be able to consume all the data received from the serial devices. The problem seems that after QNX boot up, the devc-seromap driver cannot handle the received data properly. What might be the reason? Thanks.

Best regards,
Eric
Ericxx
Senior Member
 
Posts: 158
Joined: Mon Jun 09, 2008 1:38 pm

Re: CPU usage high with serial port drivers

Postby Tim » Fri Aug 21, 2015 1:31 pm

Eric,

When I look back at your original screen shot the devc-seromap driver appears to be only monitoring at 38400 and 115200. I don't see a 230400. If that's before your application runs and sets the serial port rate it's possible the error messages you see in sloginfo are because the port rate was set wrong at that time (ie are you seeing new error messages once you set the baud rate correctly?).

Also the send rate of 100 MHz and 50 Mhz doesn't tell the whole story. That's just the transmission rate. How much data is being transmitted at each interval. More importantly, how do you know the driver isn't handling the received data properly?

Tim
Tim
Senior Member
 
Posts: 1388
Joined: Wed Mar 10, 2004 12:28 am

Re: CPU usage high with serial port drivers

Postby Ericxx » Tue Aug 25, 2015 10:08 am

Dear Tim, sorry for the late reply.

Yes, the serial port configuration was an old one. The current serial setting was the same one as I mentioned. The current phenomenon is that the high CPU usage of devc-seromap happened only when I did not launch my application. After launching the application, the CPU usage was just about 10%. After stopping the application, the CPU usage increased high again. So I am guessing the serial port after system boot up is not handing the received data properly without launching my application. Should I continue trying with the serial configurations in the build script file? Thanks.

Best regards,
Eric
Ericxx
Senior Member
 
Posts: 158
Joined: Mon Jun 09, 2008 1:38 pm

Re: CPU usage high with serial port drivers

Postby Tim » Tue Aug 25, 2015 1:54 pm

Eric,

I don't know why the CPU rate drops when your app is running because that makes no sense to me. Unless it's your app that's setting / unsetting the serial port rate correctly in code rather than at driver startup time.

The real question is do you care what's happening when your app isn't running? Unless you do I don't see why you'd spend a lot of time on this issue as long as your app is working and reading data from the serial ports.

Tim
Tim
Senior Member
 
Posts: 1388
Joined: Wed Mar 10, 2004 12:28 am

Re: CPU usage high with serial port drivers

Postby Ericxx » Tue Aug 25, 2015 2:18 pm

Thanks, Tim.
As when the CPU usage is high, it somehow takes 2 or 3 seconds to launch my application. Think I will try with different devc-seromap settings and see the effects.

Best regards,
Eric
Ericxx
Senior Member
 
Posts: 158
Joined: Mon Jun 09, 2008 1:38 pm

Re: CPU usage high with serial port drivers

Postby denkelly » Wed Sep 02, 2015 12:06 pm

>>>Two peripheral serial devices keep sending data to the QNX system, one with a baud rate of 115200 at 100 Hz,
This is a very low data rate and should barely show up as cpu utilization.

>>>Time Sev Major Minor Args
>>>Jan 01 00:13:33 3 6 0 io-char: S/W buffer Overrun error on /dev/ser3
>>>Jan 01 00:13:33 3 6 0 io-char: Framing error on /dev/ser3
>>>Jan 01 00:13:33 3 6 0 io-char: S/W buffer Overrun error on /dev/ser3
>>>Jan 01 00:13:33 3 6 0 io-char: Framing error on /dev/ser3

These messages are telling you that there is a mismatch with the incoming datastream. QNX serial is completely interrupt-driven, so each error is triggering an interrrupt. I would venture to say that when you run "hogs" in this condition, most of the 20% is consumed by the kernel (procnto) - handling the framing interrupts. (Use of the system profiler would also show this.)

You need to hook up a simple terminal - not the "data source" - and make sure you can send and receive single characters correctly - before you attach you data source.
denkelly
Senior Member
 
Posts: 160
Joined: Sat Aug 02, 2008 3:27 pm

Re: CPU usage high with serial port drivers

Postby Ericxx » Wed Sep 02, 2015 4:31 pm

Thanks for the explanation.
You need to hook up a simple terminal - not the "data source" - and make sure you can send and receive single characters correctly - before you attach you data source.

What do you mean by hooking up a simple terminal? In other words, this has nothing to do with the serial port configuration?

Regards,
Eric
Ericxx
Senior Member
 
Posts: 158
Joined: Mon Jun 09, 2008 1:38 pm

Re: CPU usage high with serial port drivers

Postby Tim » Wed Sep 02, 2015 4:54 pm

Eric,

I think Dennis was suggesting that you confirm that the physical serial port on your board is OK by hooking up another computer over port using a serial cable and then using a terminal program like Hyperterminal to confirm you can send/receive characters without problems (low CPU usage, no errors reported, both sides can send/receive characters).

His comment that 115200 at 100 Hz is a low data rate though doesn't make sense. It's a low *send* rate (100 Hz = 10x a second) but if each send packet from the data source is 10000 bytes in size it will definitely consume plenty of CPU! On the other hand if the source only sends 10 bytes at 10x a second it's a very very low rate.

Tim
Tim
Senior Member
 
Posts: 1388
Joined: Wed Mar 10, 2004 12:28 am


Return to Realtime and Embedded

Who is online

Users browsing this forum: No registered users and 0 guests