Affordable JTAG debugger for iMX SoCs? - Page 1
Forum section: electronics / general

author: asmi
author_rank: Super Contributor
timestamp: October 18, 2023, 04:19:37 pm
content: I have a project coming up which is going to involve an iMX SoC (probably 6, but not sure yet). I never had to deal with them before, and looking at the market, the only JTAG debuggers I found are Segger J-Link and some Olimex one, both are well north of 500$, which is frankly ridiculous in this day and age, especially since the abovementioned project is going to be non-commercial so I can't just include this cost into the contract and call it a day, like I usually do for commercial ones. I know there are folks over here who work with those devices, so please let me know if there are any affordable options for debugging these things.

author: girishji
author_rank: Contributor
timestamp: October 18, 2023, 10:06:50 pm
content: There is Segger Edu Mini if it works for you. It retails for ~25USD. I got mine from pihut since I am in Europe.

author: asmi
author_rank: Super Contributor
timestamp: October 18, 2023, 10:28:44 pm
content: Quote from: girishji on October 18, 2023, 10:06:50 pmIt's been almost two decades since I've been a student, so I don't think that option would work for me, but thanks for response anyway!

author: Smokey
author_rank: Super Contributor
timestamp: October 18, 2023, 10:40:53 pm
content: Quote from: asmi on October 18, 2023, 10:28:44 pmWe are all lifelong students, really....It's actually a fully featured unit. It just nags you once a day to make sure you really really promise not to use it for commercial purposes...

author: asmi
author_rank: Super Contributor
timestamp: October 18, 2023, 10:43:06 pm
content: Quote from: Smokey on October 18, 2023, 10:40:53 pmApparently not as far as the vendor is concernedQuote from: Smokey on October 18, 2023, 10:40:53 pmThat's good to know, since this project is non-commercial, I think I can live with that.

author: nctnico
author_rank: Super Contributor
timestamp: October 18, 2023, 10:56:32 pm
content: I'm wondering why you'd need a debugger. Unless you are going to program the SoC bare metal. I've done quite a few projects with various members of the iMX series SoCs and never needed a JTAG debugger. Up to the point that I don't even bother bringing the JTAG pins out in my designs. U-boot and the Linux kernel provided by NXP just work (and the kernel can be debugged over the serial port if you want to).It looks like OpenOCD has support for the various iMX SoCs and thus a wide variety of JTAG dongles should work but you'll need an initialisation sequence to get the DDR memory and some clocks going. The page seems to have some useful pointers:https://fatalfeel.blogspot.com/2015/12/openocd-with-eclipse-debug-kernel-of.html

author: Smokey
author_rank: Super Contributor
timestamp: October 18, 2023, 11:32:17 pm
content: Make sure whatever IDE you are using is compatible with whatever debugger you are using.

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 18, 2023, 11:33:56 pm
content: If you manage to set up OpenOCD, then you have in turn support for remote gdb.

author: asmi
author_rank: Super Contributor
timestamp: October 19, 2023, 12:00:44 am
content: Quote from: nctnico on October 18, 2023, 10:56:32 pmWhenever I begin to work with the new SoC or FPGA, I always design a dev board first for myself, so for it I would like to keep as many options open as possible, which includes JTAG. Besides, since iMX support RTOSes as well as Linux, I see no problems with developing a bare-metal or almost-bare-metal code (the latter is what RTOS essentially is).

author: mwb1100
author_rank: Frequent Contributor
timestamp: October 19, 2023, 01:47:20 am
content: This article explains someone's experience debugging Linux running on an iMX6 with anOlimex ARM-USB-OCD-H JTAG debugger:-Debugging Linux Kernel on i.MX6 with JTAG and Visual StudioThe Olimex ARM-USB-OCD-H is 55 EUR and uses OpenOCD.Here's an article explaining how to use The BusBlaster JTAG debugger ($35) with OpenOCD on an iMX6solo to debug u-boot:-Inexpensive JTAG on the imx6 solo: U-Boot Launch and DebugI have never used any of the tools mentioned, so be sure to perform due diligence.

author: girishji
author_rank: Contributor
timestamp: October 19, 2023, 06:51:49 am
content: If you end up using -segger edu mini- and developing your own dev board, the one useful feature it lacks is a 5v pin to power the target. You have to power your MCU independent of segger device.

author: tellurium
author_rank: Frequent Contributor
timestamp: October 19, 2023, 10:00:27 am
content: A black magic probe might suit:https://black-magic.org/They make and sell their own probe, which costs about 70EUR,https://www.adafruit.com/product/3839Their software, however, could be built and flashed to a various of 3rd party devices, e.g. STM32 BlackPill, STM32 Mini F401 (https://stm32-base.org/boards/STM32F401CCU6-STM32-Mini-F401) - those you can get on Ali for a couple of bucks.I am not affiliated with that project, but I think it is great.