Lesson 08: Troubleshooting
Problem 1: Driver Error
If you get an error message when you download the program code to the target board, or you TI Tiva board does not appear on the debug setting window as shown as the following figures. That mean that you need to install the driver for the debug interface.
Solution:
- Download the TI Stellaris ICDI Drive (SW-ICDI-DRIVERS - Current): http://www.ti.com/tool/STELLARIS_ICDI_DRIVERS , and then unzip it into a folder
- Launch your windows Device Manager
- Looking for "In-Circuit Debug Interface" (there may have 2 or 3 of them)
- Right-click on these devices, and select update driver
- Click "Browse my computer for driver software", and then click Browse... button and navigate to the driver's folder
- It should find and install the correct driver
- Repeat for all other devices
Problem 2: 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 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 LM Flash Programmer iconto 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 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 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. 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 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 board level, then I suggest you get a new Tiva LaunchPad.
Problem 3: Keil Real-Board Debugging Issue
If the system is not working as expected, you must use real-board debugging to track the code. Keil supports hardware debugger by selecting hardware debug from Options for Target ➤ Debug as shown in Figure 1.
Figure 1: Selecting Hardware Debug
Next, you have to build the code. If there are no error, then click the debug button to start the debug and click it again to exit the debug.
When trying to enter hardware debugging mode on Keil μVision, the debugger immediately exits upon entering. Keil can still download object code, but will not run the debugger. Usually, this problem occurs after a while when the Keil debugger is working properly.
The following steps can fix the error:
- Open windows registry:
Open Command Prompt window. On the screen type regedit.exe to open Registry Editor. The contents should look similar to the image below: - In the Registry Editor, search for the directory:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers - If there is a similar entry to the following items below (the name will depend on the version and the folder you installed Keil), and select the entry
C:\Keil_v5\UV4\UV4.exe REG_SZ $ IgnoreFreeLibrary <lmidk-agdi.dll>
then remove it. - Reboot the computer and then try again.