OSDev.org
https://forum.osdev.org/

Using JTAG adapters/breakouts for system software debugging?
https://forum.osdev.org/viewtopic.php?f=11&t=33266
Page 1 of 1

Author:  Schol-R-LEA [ Wed Oct 24, 2018 10:22 am ]
Post subject:  Using JTAG adapters/breakouts for system software debugging?

I mentioned this in a recent thread on the OS Dev forum, but I felt this was a general enough question to ask, and felt it might not fit exactly on that forum. I am going to go look on this myself, but I am asking less for general information, and more personal experiences with it - hence why I put this in General Ramblings.

I have heard of using ICEs (yes, I know most of them aren't emulators, but the term is a historical one) for debugging software as well as hardware, including certain JTAG adapter modules. It is my understanding that this is a fairly common practice for both professional embedded systems development and maker-grade development projects. However, I have no experience with such, and I am wondering what the different options for this were.

I know that some JTAG modules are fairly simple, often with two or three part 7S display. Others I have seen connect to a small TFT display, and IIUC, the most expensive models have micro-USB connectors to connect them to a PC workstation, either for SSH or connecting to a (usually proprietary) IDE/Debugging application. Does anyone here know much about this?

I am specifically wondering if the Arduino IDE is connected via JTAG, or if they use a proprietary (or at least Arduino-specific) adapter system. I do mean to look that up myself, though, but if anyone can comment on it, please do.

EDIT: After some quick searches, I did find these, which I will post for anyone who (like myself) isn't really familiar with these topics.

Apparently, Arduinos don't use a JTAG itself for connectin g to the PC, but instead a USB connector on the Arduino device. Duh, I should have guessed that, I suppose.

There seems to be a fair bit about using various Arduinos as JTAG adapters, though, including this article on connecting a non-Arduino board through an Arduino to the Arduino IDE, and this one about a library of JTAG debugging scripts. This also discusses the topic.

Author:  nullplan [ Wed Oct 24, 2018 2:06 pm ]
Post subject:  Re: Using JTAG adapters/breakouts for system software debugg

Arduinos come preprogrammed with a bootloader that runs a serial program that connects to the IDE. If the boot loader is overwritten (AFAIK the IDE can do that) the program becomes pretty permanent, at least in the absence of an AVR Dragon or something.

Author:  Octacone [ Wed Oct 24, 2018 2:48 pm ]
Post subject:  Re: Using JTAG adapters/breakouts for system software debugg

nullplan wrote:
Arduinos come preprogrammed with a bootloader that runs a serial program that connects to the IDE. If the boot loader is overwritten (AFAIK the IDE can do that) the program becomes pretty permanent, at least in the absence of an AVR Dragon or something.


AFAIK when it comes to Arduino you can re-burn the bootloader as many times as you want.

Author:  Velko [ Thu Oct 25, 2018 1:36 am ]
Post subject:  Re: Using JTAG adapters/breakouts for system software debugg

Octacone wrote:
AFAIK when it comes to Arduino you can re-burn the bootloader as many times as you want.

True. But if the current bootloader on the chip is damaged, you have to connect external hardware to Arduino's ISP header, to do it. Might be a problem, if you have none.

The simplest (codenamed "bsd") programmer involves connecting ISP pins to computer's LPT port using few resistors. But LPT ports are a rarity nowadays. Then there are lots of DIY or pre-built programming boards available. I am using self-built USBasp.

You probably need to switch from Arduino IDE to generic AVR tools - like AVRDUDE.

Personally, I've never bothered with Arduino IDE, library or bootloader. Straight Avr-gcc + avr- libc gives you way more control (and makes more sense in OSDev community :D). Sure, you have to consult chip's datasheet from time to time, but I do not see a problem with that.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/