CPU usage high with serial port drivers

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

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

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

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

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

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

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

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.

Thanks for the explanation.

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

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