Low Level JTAG debugging of the NXP i.MX 8M evaluation kit (MCIMX8M-EVK)

A follow-on from our Open Source JTAG Debugging tutorial. In this one we were asked to show a team how one would go about using an IDE to develop and debug board-level code. As you might know, we here at BLS are very committed to featuring Open Source Technologies in what we do. Because of that I thought it would be good to also highlight u-boot as our board-level example.  I’ll let you know now that this how-to is not stand-alone and if you haven’t yet gotten your JTAG setup with OpenOCD you should go back and look at that now (just click the link above).

Install Eclipse

Starting with our VM from earlier we download and install Java!

465MB later…

Time to get Eclipse installed (I’m using the Eclipse 2018-09 R Package Eclipse IDE for C/C++ Developers)

I just take the default setting in the startup:
Everything looks great!

Let’s add the needed plugins.

Click on the menu Help->Eclipse Marketplace…

Type “GNU MCU” into the search box and hit return to begin search.  Select to ‘Install’ GNU MCU Eclipse.
Click “Confirm >”, review and accept license.

I got a warning screen… sigh.  I just installed anyway since it is on a VM

NOTE: Please make sure that any plugins you write work without warnings.

Lastly, I restarted Eclipse.

Setup u-boot build environment for the MCIMX8M-EVK board

Next, I need to get u-boot over and map it into our project. For this I get the vendor’s u-boot from their git and check out the branch for our board:

Ok, so this needs to build and we need some tools. As you may know I have an affinity for my good friends over at Linaro. So, it is off to their site to get the needed compiler.
Hah another 110MB! Remember that we needed to make this VM with plenty of disk space.
Finally let’s add the last prerequisites.

Test build u-boot

Time to test our build! I like doing this from the command line to isolate any issues that might come up.  It would be more difficult later to debug this from Eclipse. Since we are cross-building we need to set up our environment.


Setup u-boot project in Eclipse

It works on the command line, so now it is time for us to get it into Eclipse so we can take advantage of all the features that it has.

Setup OpenOCD JTAG in Eclipse

Ok, u-boot is imported into Eclipse, now we need to setup JTAG debugging.  First thing we should do is setup the udev rule so that when the JTAG is connected we don’t need to use sudo to connect.  I would never recommend running Eclipse as root.  One small mistake can make a quite a mess!

To create the udev rule use your favorite editor to add the file /etc/udev/rules.d/10-openocd.rules

In this file add the line:
This will tell udev to set the mode and the group.  By default, Ubuntu 18.04 put my user in the plugdev group.  If you are not in this group add yourself now. Remember you need to log out and back in for user modifications to take place.

Test this by seeing if you can connect to the JTAG from the command line without sudo:


Let’s finish up in Eclipse!

As always, I hope you enjoyed.  Your feedback is appreciated, so send me a note dagriego@biglakesoftware.com

Pin It on Pinterest

Share This