why uart if we have jtag?

Thread Starter

eswarkumarvarma

Joined Jan 25, 2019
9
uart and jtag both are used for debugging in hardware level only.Both can serve the same purpose na?
is it a good pratice to disable both uart and jtag? if we disable any disadvantages
 

rsjsouza

Joined Apr 21, 2014
214
In modern microprocessors, JTAG Debug mode has very tight control and visualization over the device and in several architectures it can do this with zero CPU intervention (ARM DAP is one example).

UART requires you (the software developer) or your RTOS of choice to use CPU cycles to collect, format and sent data via this channel.

JTAG usually requires a vendor-specific Debug Probe (ARM Ltd. CMSIS sort of circumvents that) while UART does not.

Depending on the implementation, the vendor-specific JTAG Debug Probe can reach much faster speeds than UART and can have additional features such as ITM/ETM/SWO Trace and other stuff. Obviously this is heavily dependent on the vendor and model of Debug Probe.

Obviously that, if you are releasing a product, you will want to reduce the chances that someone may hack into your product, thus you can remove all UART routines for debugging and, in certain devices, blow a fuse or protect the flash memory of the JTAG channel.

Once you do that, you are locked out of the device, therefore never use these alternatives during development.
 

Thread Starter

eswarkumarvarma

Joined Jan 25, 2019
9
In modern microprocessors, JTAG Debug mode has very tight control and visualization over the device and in several architectures it can do this with zero CPU intervention (ARM DAP is one example).
In modern microprocessors, JTAG Debug mode has very tight control and visualization over the device and in several architectures it can do this with zero CPU intervention (ARM DAP is one example).

UART requires you (the software developer) or your RTOS of choice to use CPU cycles to collect, format and sent data via this channel.

JTAG usually requires a vendor-specific Debug Probe (ARM Ltd. CMSIS sort of circumvents that) while UART does not.

Depending on the implementation, the vendor-specific JTAG Debug Probe can reach much faster speeds than UART and can have additional features such as ITM/ETM/SWO Trace and other stuff. Obviously this is heavily dependent on the vendor and model of Debug Probe.

Obviously that, if you are releasing a product, you will want to reduce the chances that someone may hack into your product, thus you can remove all UART routines for debugging and, in certain devices, blow a fuse or protect the flash memory of the JTAG channel.

Once you do that, you are locked out of the device, therefore never use these alternatives during development.

UART requires you (the software developer) or your RTOS of choice to use CPU cycles to collect, format and sent data via this channel.

JTAG usually requires a vendor-specific Debug Probe (ARM Ltd. CMSIS sort of circumvents that) while UART does not.

Depending on the implementation, the vendor-specific JTAG Debug Probe can reach much faster speeds than UART and can have additional features such as ITM/ETM/SWO Trace and other stuff. Obviously this is heavily dependent on the vendor and model of Debug Probe.

Obviously that, if you are releasing a product, you will want to reduce the chances that someone may hack into your product, thus you can remove all UART routines for debugging and, in certain devices, blow a fuse or protect the flash memory of the JTAG channel.

Once you do that, you are locked out of the device, therefore never use these alternatives during development.

thankyou but if we completely disabled jtag means ,if any crash happens we cant do anything at hardware level right?? am i correct??
so i think its better we eanble jtag ports but enabling read/write protection is a good option right? crct me if im wrong
 

rsjsouza

Joined Apr 21, 2014
214
thankyou but if we completely disabled jtag means ,if any crash happens we cant do anything at hardware level right?? am i correct??
so i think its better we eanble jtag ports but enabling read/write protection is a good option right? crct me if im wrong
Well, you can't do anything JTAG-related. You can still embed some test modes in your firmware that are enabled by specific combinations of keypresses, or perhaps a UART password that enables a serial terminal, or something else.

Some of the devices such as the MSP430 with FRAM have memory protection blocks that prevent read/write operations to parts of their internal memory, while still keeping the JTAG connection alive. In this case, it is a matter of choosing the appropriate microcontroller (I am not familiar with the Realtek part you mentioned).
 

Papabravo

Joined Feb 24, 2006
12,906
If you can get a serial port working, you can implement a lot of custom debugging features with it. After doing that, I never ran into a hardware problem I couldn't solve with a terminal emulator running on my development station. I cannot for the life of me understand why you think a JTAG dongle is so great. Every unit in the field or on the final assembly line has built in debugging capability -- priceless!
 
Top