Nearly all of my projects have built-in command line support: using a serial connection, I can send commands or inspect the system status. For this I have my command line Shell which works over serial-to-Bluetooth, serial-to-USB, USB CDC or with a physical serial (COM) port. But what I need on the host system is a Terminal program: I can use either an external program. There are many ones available (Tera Term, PuTTY, …) where Termite is my favorite one. But it is possible to extend Eclipse so it has its own Terminal view too :-).
Host Support, and a Warning
A note of warning here: It looks like Serial Terminal support in Eclipse can be challenging! I’m using Windows 7 64bit, but I was not able to get it working with the 64bit Eclipse Kepler. It worked (with some UI issues) in 32bit Eclipse on Windows 7 64bit. It seems that only the 32bit Eclipse on a 32bit Windows platform works smoothly with the Terminal view. Even Linux is not free of problems: if you want to use the Terminal view in Linux, please check out this post by Karibe: http://karibe.co.ke/2014/03/eclipse-kepler-terminal-plugin-serial-port-console-in-linux/
Installation
Use the menu Help > Install New Software and enter
http://download.eclipse.org/releases/kepler
as update site. Under ‘Mobile and Device Development’, select ‘Target Management Terminal’:
Then go through the installation process, and at the end you are asked to restart Eclipse.
There is a second download needed to have the Terminal working with serial ports.
http://rxtx.qbang.org/eclipse
Because recently that site has been often down, I have put a mirror on Sourceforge:
https://sourceforge.net/projects/mcuoneclipse/files/Eclipse%20Plugins/RxTx/
💡 This mirror has a .zip file so you can download install it from your local machine.
Alternatively, this Eclipse Update Site can be used:
archive.eclipse.org/tm/updates/rxtx/
Then go through the installation process, with a restart of Eclipse at the end.
Using the Terminal View
To open/add the new Terminal view, use the menu Window > Show View > Other. Select the Terminal view under the Terminal group:
❗ Don’t select the ‘Terminals’ (with ‘s’) view: that’s something different.
This opens a Terminal view:
💡 You can open as many views as you want.
To configure the connection, click on the Settings button:
Change the settings to use a Serial connection:
Then you can configure your connection settings:
❗ I have several seconds delay on Windows 7 64bit (with 32bit Eclipse) until the dialog shows up. The other thing I think is problematic are high COM port numbers (I things like COM80): using lower COM port numbers (below 20?) seems to cause less issues.
There is a button to toggle the command input field. Alternatively I can (blindly) type text into the view and hit enter:
❗ Under 64bit somehow the command input field was not showing up at the bottom of the view, but on the right side instead?
Summary
Having a terminal view inside Eclipse is a very useful thing, so no other terminal program is needed. On the other end, you might find specialized external terminals still valuable, as they offer different sets of options and features. As the Terminal view is not working for me inside the 64bit Eclipse version, I continue to use an external terminal for my serial connections. But for 32bit users the built-in one in Eclipse can be a good alternative.
Happy Terminaling 🙂
Slightly off topic, but not completely off topic: it would be very convenient (next time you visit the shell code) to add a feature such that the tab key repeated the previous command… to save typing, of course.
LikeLike
Hi Charles,
I think this is not a feature of the target (the Shell component running on the microprocessor), but a feature of the terminal on the host? For example my Termite Terminal program already does this.
LikeLike
Hi Erich
I have just downloaded Termite, and see it has a good command replay feature. I will play with it.
I have used Tera Term for a long time. It does not have this feature, AFAIK, but other features I would be reluctant to do without. So I am not convinced that a basic “repeat last line” feature would not be a useful addition to Shell…
Regards – Charles
LikeLike
Hi Erich,
I am not able to download the S/W from the first website, Can you help me out with the problem
I am getting an error saying that
Cannot complete the install because of a conflicting dependency.
Software being installed: Target Management Terminal 3.3.100.201308290741 (org.eclipse.tm.terminal.sdk.feature.group 3.3.100.201308290741)
Software currently installed: Remote System Explorer End-User Runtime 3.3.1.FSL_b22_4085-A1 (org.eclipse.rse.feature.group 3.3.1.FSL_b22_4085-A1)
LikeLike
Hi Nikhil,
are you using Kepler? I suggest to have the source files deselected, probably there is a missing dependency somewhere. I did not see that problem on my end.
LikeLike
Hi Erich,
CW is throwing me an Error saying
Some sites could not be found. See the error log for more detail.
Unknown Host: rxtx.qbang.org/eclipse/content.xml
rxtx.qbang.org
No repository found at github.com/ErichStyger/mcuoneclipse/tree/master/EclipsePlugins/RxTx.
Help me in deselecting the Source files.
LikeLike
Please try archive.eclipse.org/tm/updates/rxtx/ instead. The qbang site is still down 😦
LikeLike
I have a question. Can we add 74880 baudrate on the terminal? How?
LikeLike
Yes, on the microcontroller side you can use any baudrate, as long it is in the +/- 1.5% accuracy, and your microcontroller clock is fast enough. So for the KL25Z, make sure that you run with miximum clock speed (48 MHz).
On the host side, make sure that you have a terminal program which allows to use such a unusual baud rate, e.g. putty.
I hope this helps,
Erich
LikeLike
I am using esp8266 and default bootloader baud is 74880. I tried change setting in terminal plugin settings but it hasn’t 74880. Can we add this anyway?
LikeLike
Which ‘terminal plugin’? PuTTY? It should accept any baud settings.
LikeLike
i am using target management terminal as your topic.
LikeLike
The Eclipse Terminal view is not a fully fledged Terminal program. I suggest that you use an external (outside of Eclipse) terminal program like Termite (www.compuphase.com) or puTTY.
LikeLike
Hi. This looks interesting. Have you tried this with KDS 2?
LikeLike
No, I have not tried it with KDS. As KDS is Eclipse Kepler, I believe it will have the same problems, so I have not tried it.
LikeLike
Hi. My basic problem is I need a interrupt driven serial communications in KDS with PE but NOT using KSDK. Is it possible to modify ConsoleIO to use interrupts? I have installed the 03-FEB-2015 version of your PE components. Any suggestions on adding interrupt based communications?
Thanks
LikeLike
Hi dale,
I’m using the AsynchroSerial component, and this one offers interrupt capability. Basically the application sends data to to a buffer, and then this buffer is sent with interrupts, and data is received with interrupts. Make sure you allocate a buffer large enough for your application needs. You might look at my ‘Shell’ example projects on GitHub which is using that.
LikeLike
thanks. I will look at the shell example.
LikeLike
When trying to add the Terminal view I don’t have the Terminal group available. Any help?
LikeLike
As noted in the article, in my view the Terminal view is broken in Eclipse Kepler. I recommend that you use an external terminal client instead 😦
LikeLike
I’m using Eclipse Luna. I was able to add the Terminal view on both of my WinXP machines, but not on my WindowsServer2008 machine.
LikeLike
Haven’t tested it yet, but I seem to have it available under Show View -> Target Explorer Views -> Terminals.
LikeLike
I tested it. “Terminals” under “Target Explorer Views” works as a serial terminal.
LikeLike
This is what I’m using now. Works with my WinServer2008.
LikeLike
Pingback: Serial Terminal View in Eclipse Luna | MCU on Eclipse
This also worked on Luna (Windows) for me but the Luna repository (http://download.eclipse.org/releases/luna) lists under Mobile and Device Development:
Target Management Terminal (Core SDK)
Target Management Terminal (Deprecated)
and I could only get it to work with the latter – the Deprecated version.
When I chose the Core SDK version and installed RXTX no Terminal node appeared in the Show View treeview.
I wonder if/when it might work with the non deprecated/Core SDK version because I presume that the deprecated version will disappear at some stage…?
LikeLike
Doh! Just saw this after posting…. Sorry! 🙂
https://mcuoneclipse.com/2015/04/20/serial-terminal-view-in-eclipse-luna/
LikeLike
Dear Erich
As always, we were very delighted to be in your presentation in the FTF
Now we are trying to reproduce all you teach to us, with our students, and I have some questions
I am using TASK LIST freertos, but I can’t see the runtime column, its blank.
Do I need to do something extra?
What are the steps to change the USB_MOUSE example to the FRDM K64 Board ?
Thanks and regards from CD MEX
RAUL
LikeLike
Hi Raul,
in order to see the runtime statistics, you need to enable configUSE_TRACE_FACILITY plus configGENERATE_RUN_TIME_STATS.
In my example I’m using the SysTick as the performance counter with
#define configGENERATE_RUN_TIME_STATS_USE_TICKS 1 /* 1: Use the RTOS tick counter as runtime counter. 0: use extra timer */
#define configGENERATE_RUN_TIME_STATS 1 /* 1: generate runtime statistics; 0: no runtime statistics */
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() /* nothing */ /* default: use Tick counter as runtime counter */
unsigned int ulMainGetRunTimeCounterValue(void); /* prototype */
#define portGET_RUN_TIME_COUNTER_VALUE() ulMainGetRunTimeCounterValue() /* default: use Tick counter as runtime counter */
and
void vMainConfigureTimerForRunTimeStats(void) {
}
unsigned int ulMainGetRunTimeCounterValue(void) {
return xTaskGetTickCountFromISR();
}
As for a USB example for the K64F board: I plan to write an article about this, but have not found the time yet.
Erich
LikeLike
Hi,
thanks for the post.
This bug: “Under 64bit somehow the command input field was not showing up at the bottom of the view, but on the right side instead?” seems to still exists, like two years later?
I’m running a 4.5.0.v20150603 org.eclipse.platform…
…
-arch
x86_64
…
Maybe it’s supposed to look like that.
Kind regards
LikeLike
It is still broken for me. Maybe just bad luck. I ended up to use terminal programs outside of Eclipse.
LikeLike
Pingback: Using Serial Terminal and COM Support in Eclipse Oxygen and Neon | MCU on Eclipse