Using Serial Terminal and COM Support in Eclipse Oxygen and Neon

Most of the time I’m using a dedicated terminal program like Termite or PuTTY to connect to a board using virtual or non-virtual COM port. Another way is to use the Eclipse built-in Terminal view: that way no extra program is needed to communicate with a real or virtual COM port to my target device:

Terminal Command Output

Terminal Command Output

Traditionally, adding Serial Terminal support to Eclipse seems to be an endless source of pain (see links at the end of this article). Mostly because of the underlying Java connection to the serial ports. The good news is that with Eclipse Oxygen things can work out-of-the box. For other Eclipse version some extra plugins might be necessary.

Installation

With Eclipse Oxygen (4.7.0, I’m using the 64-bit version), no extra plugins need to be installed :-).

Eclipse Oxygen Version

Eclipse Oxygen Version

Other Eclipse distributions need extra plugins installed, if they do not have the Terminal view included, e.g. the NXP MCUXpresso IDE 10.0.2 (MCUXpresso IDE v10.0.2 [Build 411] [2017-07-11]) which is Eclipse Neon (4.6) based.

For Eclipse Neon, use the menu Help > Install New Software and enter

http://download.eclipse.org/releases/neon

as update site.

If getting an error loke this:

Unable to read repository at http://download.eclipse.org/releases/neon.
Unable to read repository at http://download.eclipse.org/releases/neon.
Unable to read repository at http://download.eclipse.org/releases/neon/201703141400.
Input is not in the XZ format
Unable to read repository

Unable to read repository

Then the following fix worked for me:

  1. Close Eclipse
  2. Delete the following folder: <eclipse installation folder>\p2\org.eclipse.equinox.p2.core\cache
  3. Delete the following folder: <eclipse installation folder>\p2\org.eclipse.equinox.p2.repository\cache
  4. Start Eclipse

Then install the ‘TM Terminal’ plugin:

TM Terminal Plugin Installation

TM Terminal Plugin Installation

To have the COM ports showing up, I have to install as well the RxTx plugins from

http://rxtx.qbang.org/eclipse/
rxtx runtime

rxtx runtime

Restart Eclipse, and this completes the installation.

Usage

Use the menu Window > Show View > Terminal to open a Terminal view:

Show View Terminal

Show View Terminal

In the Terminal view, use the ‘Open a Terminal’ button:

Open a terminal

Open a terminal

In the dialog, select ‘Serial Terminal’ and configure the serial port with baud rate.

Launch Terminal

Launch Terminal

Press OK, and it opens a connection.

I recommend to use the ‘Toggle Command Input’ button which adds an edit box to enter text:

Toggle Command Input

Toggle Command Input

The field has a ‘history’ function: using cursor-up or down I can go through the previous commands:

Terminal Command Output

Terminal Command Output

Use the close connection button to close a connection:

Summary

With Eclipse Oxygen a serial terminal connection using a COM port works out of the box. For earlier Eclipse versions I have to install extra plugins plus the RxTx plugin. With this, I’m able to use a terminal connection to my boards within Eclipse without the need for an extra terminal program.

Happy COMmunicating 🙂

Links

 

13 thoughts on “Using Serial Terminal and COM Support in Eclipse Oxygen and Neon

  1. I used this for a while, but eventually found I liked using PuTTY better. Not that PuTTY is my favorite – SecureCRT has a nicer interface IMO but my old copy can’t handle 250,000 baud. A while back I started using ANSI color codes in my debug output, too, and I don’t think the build-in terminal does color.

    Like

    • Yes, other terminal programs have more features and this built-in one in Eclipse is a rather basic one. For example it does not support the ANSI colors or other fancy features. Using PuTTY/etc has the other advantage that they can be used outside of Eclipse (e.g. if I’m not developing with it). But for smaller things the build-in comes handy.

      Like

  2. I’m using Eclipse Oxygen R 32 bit (don’t ask) and when I install TM Terminal + RXTX, restart and create a TM Terminal view the only options are Local, SSH and Telnet – no serial option. Any ideas? Thanks.

    Like

      • Thanks Erich. Turns out that the problem is that somewhere along the line …\eclipse\configuration\org.eclipse.osgi\104\0\.cp\os\win32\x86\serial.dll is loaded and it has a dependency on the MinGW/MSYS libgcc_s_dw2-1.dll but this DLL is not bundled with the eclipse stuff. The eclipse log helped to pinpoint this as the problem.

        If I download that DLL from here http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/gcc-4.7.2-1/libgcc-4.7.2-1-mingw32-dll-1.tar.lzma/download and drop the DLL into my eclipse folder and try again it works. This is with TM Terminal and TM Terminal Serial Connector Extension only installed (no RXTX). This is an off the shelf eclipse oxygen R 32 bit (i.e. I’m not building it myself or anything) so it’s a bug/omission. I think that there may be an issue open against it already which I will annotate if I can find it.

        Like

      • BTW – RXTX was working fine for me in Eclipse Luna 32 bit but it looks like it’s not longer needed once this missing runtime DLL dependency is satisfied.

        Like

  3. Do you know if there is a way to select a custom Baud Rate? The default baud rates only go up to 115200. I need to use a baud rate higher than this for one of my targets but can’t see anyway to manually enter this. In older versions of Eclipse I could input my own custom baud rate rather than a drop down box. Its a pain having to use a putty terminal outside of Eclipse just for one specific target.

    Like

    • I contrib’ed a couple of months ago additional baud rates since we were in the same boat. Those should make it to the O2 release. Otherwise we had some odd non-standard baud rates so I have a new contrib (pending) that will allow you to enter. So providing the underlying drivers support it, you should be fine.

      Like

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.