KB 02: JTAG functionality has been locked / JTAG Communication Failures
When you attempt to download the program code to the TI Tiva board, a popup window appears with the following error.
"Stellaris ICDI Error: Could not initialize target device! Please power cycle the board and try again."
After you hit accept and another popup window appears with the following error:
"Error: Flash Download failed - Target DLL has been canceled"
Solution:
It is possible to run program code on a Tiva C Series device that causes the device to lose JTAG communication. The two most common causes:
- Changed the system clock speed to something that the target system does not support.
- Changed the function of the Port C[3:0], which are muxed with the JTAG pins.
If you accidentally do either of these things, you can restore communication with your target device by running the Debug Port Unlock utility in LM Flash Programmer as shown below.
- Before using the LM Flash Programmer tool, the Stellaris ICDI driver must be installed at your computer. Connect the Tiva LaunchPad to the computer and check the driver at the Device Manager.
- Download and install LM Flash Programmer onto your computer: http://www.ti.com/tool/lmflashprogrammer
- Run the LM Flash Programmer
Make sure that the TI Code Composer Studio and/or Keil μVision are closed. Otherwise, the IDEs and the LM Flash Programmer will "fight" for control of the board.
Click the LM Flash Programmer icon to launch the Flash Programmer
For TM4C123GXL LaunchPad
- Select your board
Select TM4C123G LaunchPad from the Quick Set pull-down menu under the Configuration tab. - Click on the Other Utilities tab. For the Tiva devices, select the Fury, DustDevil, TM4C123 and TM4C1294 Classes option from Debug Port Unlock utility. Then click Unlock button.
- A message pops up to warn you that the unlock operation will erase all the register values, including Ethernet MAC address. Click Yes to continue.
- An information message pops up:
Unplug or power off the Tiva board, press and hold the reset button, and plug or turn on the power. Then click OK button. - After a while, you will see a message as shown below picture, then you can release reset button and click OK button.
- If there are no error occurred, the system will ask you to power off and on on the board in order to complete the last unlocked procedure. After power cycle the board, click OK button and close the LM Flash Programmer.
- The JTAG port is unlocked now. Find all incorrect configurations and fix it, before you reprogram the code to the board.
TM4C1294XL LaunchPad
- Select your board
Select TM4C1294XL LaunchPad from the Quick Set pull-down menu under the Configuration tab. - Click on the Other Utilities tab. Click MAC Address Mode option from the User Register Programming utility. Then click Get Current MAC Address button to read the MAC address from the board.
On the TM4C1294 devices, the Ethernet MAC address will be erased by the Debug Port Unlock utility, so be sure to write down the number before running the utility. - For the Tiva devices, select the Fury, DustDevil, TM4C123 and TM4C1294 Classes option from the Debug Port Unlock utility. Then click Unlock button.
- A message pops up to warn you that the unlock operation will erase all the register values, including the Ethernet MAC address.
If you already write down the MAC address, then you can click Yes to continue. - An information message pops up:
Unplug the Tiva board, press and hold the reset button, and plug the board to the computer, then click OK button. - After a while, you will see a message as shown below picture, then you can release reset button and click OK button.
- If there is no error occurred, the system will ask you to power off and on on the board in order to complete the last unlocked procedure. Then click OK.
- The JTAG port is unlocked now. The last step is to write the Ethernet MAC address back to the board. Make sure the value in the MAC Address field is correct, then click the Program MAC Address button to write it back.
Then you can close the LM Flash Programmer tool. - Find all incorrect configurations and fix it, before you reprogram the code to the board.
If by using the Debug Port Unlock Utility several times, you are unable to recover your board, then it is possible that there is something damaged at the board. If you don't have the capacity to debug the problem at the board level, then I suggest you get a new Tiva LaunchPad.