NetBurner’s NBEclipse: Top 10 Tips and Tricks

title

Introduction

Hello, fellow NetBurnians! As many of you know, one of the many tools that we provide to our users is a fully customized and Eclipse-based integrated development environment, or IDE for short. Whether you’re knee-deep in IoT development with the MODM7AE70 or writing the guts of an autonomous vehicle with the NANO54415, our IDE is a great way to write, debug, and deploy your applications. We’ve affectionately dubbed this little gem NBEclipse, and have a host of information for it in our official online documentation, here. It covers everything from project setup to debugging and is a great place to start getting your feet wet.

IoT Dev Kit Featured in this Article

Netburner ARM Cortex M7 embedded Development Kit for IoT product development and industrial automation.

Or, learn more about NetBurner IoT.

That said, there’s always a few little tips and tricks that don’t quite make it into the official guides. Today, we’re going to share some of our favorites with you. Please note that these tips apply to our latest tools, NNDK 3.x. Several of these tips come directly from an updated version of Eclipse that we are using with our newest toolset, which is Eclipse 2018-12.

Okay, enough with the delays. Let’s jump in.

Our Top 10 List

1) Dark Theme

Selecting dark mode from the preferences windows.

We’ve all been begging for it (at least, I have), and now we have it. NBEcplise now natively supports a dark theme. To enable it, from the top toolbar, go to “Window → Preferences”. In the preferences window that opens, select “General → Appearance” and choose the desired theme from the drop-down that appears on the right.

Showing off dark mode in all it's beauty.
Dark Mode!!!

2) Change the Eclipse CDT Build Console Text Color

Changing the build console color.

If you jumped on the first tip and changed your NBEclipse to use a dark theme, you might notice that the build console text is exceptionally challenging to read. This is because, unfortunately, the theme does not change the Eclipse CDT (C/C++ Development Tooling) console text color, which remains black.

Since we like to see what our build messages are trying to tell us, we’re going to want to fix that. To do so, once again open up the preferences window by clicking on “Window → Preferences” from the top toolbar. From here, click on “C/C++ → Build → Console” and change the “Output text color” value on the window on the right.

3) Show Line Numbers

There are few things as annoying as seeing an error message popup in your build window with an associated line number and not being able to tell at a glance where that line is in your code. To remedy this, pop open the NBEclipse preferences by navigating to “Window → Preferences”. In the preferences window, head to “General → Editors → Text Editors”. This option will open a long list of available options that you can customize on the right side. About halfway down the screen, as of this writing, is the option, “Show line numbers”. Checking this box will add line numbers down the left side of your text editor window.

Enabling line numbers from preferences.
Enabling Line Numbers

Pro tip: You can also choose to insert spaces for tabs from this window. Another popular choice by many a developer.

4) Open discover.netburner.com from inside NBEclipse

Many of you are familiar with our service to locate local NetBurner devices running applications built with NNDK 3.x. For those of you that might not be aware, you can open a browser, go to discover.netburner.com, and see all of the devices on your network. This behavior is, of course, configurable, but it is the default mode of operation for MODM7AE70s when they are shipped and for any module when initially upgraded to 3.x.

This service is convenient when you’re trying to figure out what the IP address of your device is after it initially boots up. To open discover.netburner.com from NBEclipse, navigate to the “Help” button on the top toolbar. Then choose “Discover NetBurner Devices” from the available options.

Discovering local NetBurner devices from NBEclipse.
Discover Local Devices

5) Add or Change a Hotkey

For many that come from other IDEs, not having your favorite hotkey can be an infuriating experience. It is infuriating, don’t deny it. Anyway, to add your own set of hotkeys, head back to the preferences window by selecting, “Window → Preferences”. In the window that opens, select, “General → Keys”.

Customize your hotkeys in the preferences window.
Customize Your Hotkeys

On the right side of the window, you can set your custom key bindings by typing the general function of what you are trying to do in the text bar at the top. For example, “Open file”. With luck, this will filter down the available options enough for you to find what you are looking for.

To set the key binding, click inside the box labeled “Binding” and then type in the key combination you want to use. Any conflicts will be brought politely to your attention in the little window on the bottom right labeled, “Conflicts”. When you’re satisfied, hit “Apply and Close”, and give those new hotkeys a spin!

6) Change IP Associated with Project

When you’re in the throes of embedded development, there will undoubtedly be a time when you will need to switch out modules. Other times, you might need to change the type of device you are using altogether. When this is the case, you will still want to keep that “program and debug your device at the push of a button” functionality that we’re famous for. Fortunately, with NBEclipse, this is easy to do.

Changing NetBurner project properties.

To change the IP address or type of module associated with your project, right-click on the project name in the project explorer window from the main application and select “Properties”. From the project properties window that shows up, select “NetBurner Options” on the right side. From here, you will be able to choose the platform you want to build the project for and associate a new IP address. You can try to locate a specific device by selecting the “Search…” button. If you choose one of the modules that are listed, its IP address will automatically populate the field for you.

7) Overload System Files

Occasionally you will want to make changes to your system files for a specific project that you don’t want to apply to any of your other projects. With the newest version of NBEclipse, it’s easy to let each project have its particular version of the system libraries. To take advantage of this feature, simply drop the modified versions of the system files into the “overload” directory with the same directory structure the corresponding system files have from the install directory.

Example of overloading system files.

For example, if you wanted to modify “predef.h”, a common requirement, you would copy that file into “overload → nbrtos → include → predef.h”. The “overload” directory is created automatically for every NetBurner project. For more information, see the “README.txt” file found in the “overload” directory.

8) Auto-Format

Few things can rankle the ire of developers or instigate inhouse battles faster than issues of code formatting and whitespace. Now, you might be fortunate enough to have a coding standard that individuals actually adhere to. Even then, you may run into situations where you’re trying to import or go through code that just doesn’t fit with the way you like to see your digital world. NBEclipse is here to help.

Not only will it format code as you’re writing it, but it can also apply it retroactively to a file. The most helpful feature here is that you can define the formatting guidelines yourself, or import a predefined formatting style as a “.xml” file.

Changing code formatting inside the preferences window.
Changing Formatting Options

For example, if you were a big fan of Google’s coding style for C++, you would go to their style guide GitHub repo and download “eclipse-cpp-google-style.xml”. Then, from NBEclipse, you would go to “Window-Preferences”. From the preferences window, you would go to, “C/C++ → Code Style → Formatter”. On the right side of the window, select the “Import” button, locate your saved “.xml” file, and hit “Open”. In the main preferences window, hit “Apply” or “Apply and Close”, and your new formatting settings will be ready to roll.

To format a file that is already open, select “Source” from the top toolbar in NBEclipse, and then select “Format”. It will ask you if you want to apply formatting to the entire open file, or just to the current line of code your cursor is on. Make your choice, hit “OK”, and watch the magic before your eyes.

9) Change (and Reset) Perspective

NBEclipse has the nice feature of having multiple perspectives, or window layouts, that you are free to use, depending on the task at hand. We provide a default that is helpful when doing everyday development work. It includes a build console window, NBFind, a project explorer, an outline window, and of course, the text editor. When you start to debug an application, you have the option of switching into a Debug perspective. This perspective allows you to monitor the tasks running on your device, set and modify breakpoints, as well as a host of other handy functions.

There is also the option of customizing any given perspective. You can move and resize windows, open new ones, close them (in my case, usually on accident and at the worst possible moment), pull them out of the main application window, etc. The options and flexibility are pretty impressive.

Opening a new perspective in NBEclipse.

While the perspectives themselves are incredibly beneficial, switching between them or resetting them back to their original state isn’t always obvious. To do this, select “Window → Perspective” from the top toolbar. This will open a small submenu that will let you reset or save the perspective you are currently using, or change to a new one altogether.

The options are fairly obvious, except for picking a new perspective that isn’t already listed. To do this choose “Open perspective → Other…” from the submenu described above. It will show a list of available perspectives. What you see will depend on what plugins you have installed, but you should always have the NetBurner and Debug perspectives available.

Speaking of plugins (you caught that, right?)…

10) Install Plugins

Sometimes it’s nice to save the best for last, and today that’s exactly what we’ve done. In NBEclipse 3.x, it’s possible to install other Eclipse plugins. Now, we can’t go so far as to guarantee that every plugin will work as intended. NBEcplise is heavily modified, after all. However, of the few we’ve tested so far, the results have been good. The only way to know for sure is to give it a go and install one of your favorites. 

We’ll show you how to do this with two of ours:

a) An Integrated Git Plugin
b) A Terminal Plugin

We use Git here at NetBurner for both our public repositories as well for managing our internal codebase. Being able to look at file histories and check-ins from inside NBEclipse is a feature that brought a tear to at least one developer’s eye. Well, it didn’t go quite that far, but needless to say, we were quite thrilled.

The terminal plugin is incredibly useful for sending and receiving serial data to your NetBurner module or initiating an SSH or Telnet session to your device. It can also act as a command terminal for your local computer, or as a Git bash terminal. We should mention that it isn’t entirely a full MTTTY replacement. We have yet to find another serial terminal that lets you upload a file over a serial port. That said, it’s an incredibly useful extension that we’re sure will find its way into many an NBEclipse environment over the months to come.

How to Install

To incorporate these little rays of sunshine into your own development experience, head to “Help → Install New Software…” from the top toolbar in the main application window. This option will bring up the install window. From here, we need to add the location where the plugins can be found on the web.

We will be using: http://download.eclipse.org/releases/2018-12

Adding a new plugin to NBEclipse.
Installing a Plugin
Adding a descriptive name to the plugin repository.

Note that this link is specific to the version of Eclipse we are using, which is Eclipse 2018-12. Add the above URL to the text field labeled “Work with:” and hit “Add”, then supply a reference name for the URL in the dialogue box that pops up. We are going to choose “Official Eclipse” and then hit the button labeled “Add”. After a minute or two, you will see that the center area in the install window populates with a list of different items.

A fully populated plugin list from download.ecplise.org/releases/2018-12.
All the Plugins!!

To find the Git plugin, open the entry titled “Collaboration”, and select the option listed as “Git integration for Eclipse”. For the terminal plugin, open “General Purpose Tools”, and then select “TM Terminal” and “TM Terminal Serial Connector Extensions”. It will ask you to accept a license agreement and then a certificate. After you agree to these (you pretty much have to if you want to use the plugins), it will proceed to install the plugins and prompt you for a restart.

Git Integration for Eclipse Plugin

We’ll dive more deeply into the Git plugin in a future article. However, to get you started, you will want to switch to the Git perspective. From here, you can set up a new repo or add an existing one. If you’re not entirely sure how to get to the Git perspective, see item 9 above. Once the repo is ready to go, you will be able to access Git options, such as file history, from any perspective by left-clicking on your projects and resources.

The Git perspective in NBEclipse.
The Git Perspective

TM Terminal Plugin

The terminal icon in NBEclipse.

To open a terminal, select the little blue terminal icon at the top of the NBEclipse window, just below the toolbar. A small window will pop up, asking you to choose your terminal type. Once you do, select, “OK”. Depending on the type chosen, you’ll need to specify a few other options. For example, in the image below you can see the serial choices available.

Serial terminal settings in the NBEclipse plugin.
Serial Settings for the Terminal Plugin

That’s a Wrap

Thanks for hanging in there with us and checking out our NBEclipse top 10 tips and tricks list. Hopefully, you will find these both helpful in your development and enjoyable to use. If you have any tips or tricks of your own that you like to use, or have other plugins that you’ve been able to incorporate with NBEclipse, please let us know in the comments below!

Share this post

Subscribe to our Newsletter

Get monthly updates from our Learn Blog with the latest in IoT and Embedded technology news, trends, tutorial and best practices. Or just opt in for product change notifications.

Leave a Reply
Click to access the login or register cheese