Board level debugging of the NXP i.MX 8M evaluation kit (MCIMX8M-EVK)

Recently we were asked to suggest what we would use to do board level debugging in a project. I’m a full-fledged Linux kernel hacker and I’ve spent most of my working life developing and porting device drivers. So, when it comes to board level debug I’ve done my fair-share. I cut my teeth using a BDI2000 JTAG. In those days the company I worked for had a partnership with Abatron (the maker of the BDI) so we had a lot of them sitting around.  They were very friendly with Linux and U-Boot so I never questioned if it was the best choice or not. Fast forward a few years to today and you’ll see that the JTAG picture is not so clear.  Also, I would say that my desire to leverage the most out of the Open Source community has increased. At this point I had made up my mind.  I’m going to do a demo using as much Open Technology as possible, but I only have a few days to get everything together.

First, we needed to decide on the board. I wanted to use a 96boards board because of the support they give and get from my friends over at Linaro. Bad news right off the bat from the customer, they want a quad ARM® Cortex®-A53 board and using an ARM big.LITTLE will not be a good replacement for them.  They give us a few choices with the NXP being the top of the list.  Great news this time, they have the MCIMX8M-EVK over at Arrow (I love the free overnight shipping). Ouch it’s $449… I continue to wish that I could use a 96Boards board. Oh well.

Next, need to find a JTAG. It has been a while since I’ve looked and let me tell you the landscape has changed quite a bit. So, what to use? After looking around I decided that I would use the Open Source Bus Blaster JTAG from Dangerous Prototypes. Great! An Open JTAG! This one turned into a mixed bag though. The JTAG needs to be ordered from Seedstudio, and they ship out of China.  I put the order in and hold my breath. If it isn’t delayed, and setup doesn’t take too long, and everything goes smoothly I’ll have a good demo. Since I have other things the customer wants demoed I’ll have some stuff to do to fill in the time gap anyway (more on those things in a different blog).

Ok, time flies by and quicker than I expected (and quicker than Seeedstudio expected) and the JTAG arrives. So now it is time to put together all the parts and try and wow the customer with a great demo!

Hardware Setup

Here is the list of hardware I needed to create the demo:

  • NXP i.MX 8M evaluation kit (MCIMX8M-EVK)
  • Dangerous Prototypes Bus Blaster v4 (probably could have used v3)
  • Olimex ARM-JTAG-20-10 ARM Micro JTAG adapter (micro ribbon cable included)
  • Bag of 6in male to female jumper wires (22AWG, UL1007, mates with 0.025in pin)

Time to wire things up:

This part was a bit tricky since I really wanted just to use the larger ribbon cable between the JTAG and the adapter. Actually, I had hoped that the adapter would plug into the JTAG directly, but it wasn’t the right size.  Because of this I ended up using the jumper wires. Anyhow this turned into a happy accident because connecting the reset pin kept the JTAG from working. So, using the jumper wires was a good thing. Here is the final wiring diagram between the JTAG and the adapter:
The connection between the adapter and the i.MX eval board uses the ribbon cable. Be sure that the #1 pin of the ribbon cable (red wire) matches the #1 pin of the JTAG header on the board (marked with a ‘1’ on the silk screen).

Software

As with most new things I start out by creating a VM with my favorite Linux distro, Ubuntu. I know, I know… let the rants begin (I hear Tim screaming at me about the wonders of Fedora). I also use vim, so let’s get that out of the way too. Anyhow, I setup an Ubuntu 18.04.01 VM with 4 CPUs, 2GB of RAM, lots of disk space, and USB (for the JTAG).

OS all setup and ready to start:

The version of OpenOCD included with Ubuntu does not support our board, so we need to build from source.  First thing to do is clone the git:

Prerequisite time!
Build OpenOCD
All done, time to try things out. I’ve connected the JTAG to my VM and I stopped the i.MX 8M at the u-boot command prompt. (if you let Linux boot it will change the i.MX clocks and will keep the JTAG from connecting… More on that when I write on debugging the Linux kernel with this JTAG in a later post).
Ok, time to verify we have connected.
On a different terminal we will try a telnet to the OpenOCD

Well that is it!  JTAG connected and running! Demo complete and customer happy! I think in the next howto I’ll cover setting up a u-boot build environment with Eclipse (hint, I’ve already done it). I hope you’ve enjoyed, if so please share with others. Your feedback is also appreciated, so send me a note dagriego@biglakesoftware.com

Pin It on Pinterest

Share This