Configure debugging environment for ARM in Ubuntu with Eclipse

Next article is how to configure SEGGER’s J-Link debugger to debug the NuttX OS from Eclipse.  Here I’m going to describe the it using The J-Link hardware debugging Eclipse plug-in. I nevver tried the other options so I don’t pretend this is the best but it works for so far. The configuration is done in Linux 14.04 environment.

You can check first these articles:

Install and configure NuttX ARM build environment in Linux

Building NuttX in Eclipse (Ubuntu)

1. Install the GDB for ARM

sudo apt-get -o Dpkg::Options::="--force-overwrite" install gdb-arm-none-eabi

Force is needed if you have a GDB for x86 installed.

For Windows users you need to install the GDB from the MinGW:

2. Install the J-Link hardware debugging Eclipse plug-in.

So you need to go to Help -> Install New Software… and will see the dialog as shown below.

Click on the Add button to open the Add Repository dialog.

Here for Name you can enterwhatever you want. I used GNU ARM Eclipse Plug-ins.

For Location enter

 Click OK. Then select the repository that just created and select to install all of the components that you need. I installed all of them.

Install SEGGER J-Link GDB server software.

Here is the official page from Segger:

And here is their download page:

Open the Debug configurations.

You can do this from the menu Run -> Debug Configurations…. Click on the GDB SEGGER J-Link Debugging and after that click on the New icon and a multi-tab configuration window will be displayed.

 First tab is Main and here you can configure the application and the project. For me the project was alredy filled so I had to add just the applicaion. Put there nuttx since that is the .elf file even it is without the extension.

Second tab is the Debugger. Here we configure the device first. In my case it is ATSAM4E16C. Also selected the Initial speed to be Auto but you can keep it to fixed if you prefer. Very important in my configuration was to change the Executable from ${cross_prefix}gdb${cross_suffix} to ${cross_prefix}arm-none-eabi-gdb${cross_suffix}.  Now it is using the correct gdb version.

In the Executablefield you can see that there are some variables used. If you don’t have them configured you need to do this. On my machine they were with correct values.

jlink_path = /usr/bin

jlink_gdb_server = JLinkGDBServer

You can keep your initial Low speed speed to what it is. I changed mine to 1000 kHz.

Also wanted to have a console for the GDB client so checked this check box too.

Source tab is unchanged.

And finally the Common tab.

Here you need to select Shared file.

After all of the steps are done you need to click on Apply button to save them. You can click now on debug to start the debugging.