Hello Forum Members,
The Post intends to highlight some of the common problems that you may encounter during product development. More will be Added...
ISSUE#1: GPIO Port C0-3, D7 and F0/E7 Not Working
SOLUTION: The Port Pins C0-3, D7 and F0/E7 are locked pins for specific functionality of JTAG, NMI and NMI respectively. To use them in GPIO or any other function they need to be unlocked and commit register be set. The following example function shows how to unlock and commit the Pins "before" calling any GPIO Pin Configuration Function. Do not forget to include the header files
#include "inc/hw_types.h"
#include "inc/hw_gpio.h"
#include "inc/hw_memmap.h"
TM4C123 Devices Port-C
HWREG(GPIO_PORTC_BASE+GPIO_O_LOCK) = GPIO_LOCK_KEY;
HWREG(GPIO_PORTC_BASE+GPIO_O_CR) |= (GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
TM4C123 Devices Port-D
HWREG(GPIO_PORTD_BASE+GPIO_O_LOCK) = GPIO_LOCK_KEY;
HWREG(GPIO_PORTD_BASE+GPIO_O_CR) |= GPIO_PIN_7;
TM4C123 Devices Port-F
HWREG(GPIO_PORTF_BASE+GPIO_O_LOCK) = GPIO_LOCK_KEY;
HWREG(GPIO_PORTF_BASE+GPIO_O_CR) |= GPIO_PIN_0;
TM4C129 Devices Port-C
HWREG(GPIO_PORTC_AHB_BASE+GPIO_O_LOCK) = GPIO_LOCK_KEY;
HWREG(GPIO_PORTC_AHB_BASE+GPIO_O_CR) |= (GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
TM4C129 Devices Port-D
HWREG(GPIO_PORTD_AHB_BASE+GPIO_O_LOCK) = GPIO_LOCK_KEY;
HWREG(GPIO_PORTD_AHB_BASE+GPIO_O_CR) |= GPIO_PIN_7;
TM4C129 Devices Port-E
HWREG(GPIO_PORTE_AHB_BASE+GPIO_O_LOCK) = GPIO_LOCK_KEY;
HWREG(GPIO_PORTE_AHB_BASE+GPIO_O_CR) |= GPIO_PIN_7;
NOTE: Changing Port C Pins "will" cause loss of debug as the JTAG Function will be lost
ISSUE#2: After Enabling the Peripheral, the program goes into FaultISR
SOLUTION: The Enable Function writes to the SYSCTL.RCGCxxx Register for the xxx Peripheral. It takes 5 System Clock Cycles after which the peripheral will be addressable. It is advised to put a delay or even better get the Status of Ready from the Peripheral. The following code shows you how to use the better approach...
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C2);
while(!(SysCtlPeripheralReady(SYSCTL_PERIPH_I2C2)));
ISSUE#3: Spurious Interrupt when the program is restarted.
When the CCS program is restarted using CPU reset, the peripherals are not reset causing them to generate spurious interrupt when the Interrupt is enabled. There are two solutions to this
1. Always use System Reset instead of CPU Reset
2. Add the following lines that will make sure that the peripheral is reset before enabling the clocks. As an example we are showing I2C2 but all peripherals can be coded using the given lines of code
SysCtlPeripheralDisable(SYSCTL_PERIPH_I2C2);
SysCtlPeripheralReset(SYSCTL_PERIPH_I2C2);
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C2);
while(!(SysCtlPeripheralReady(SYSCTL_PERIPH_I2C2)));
ISSUE#4: JTAG does not connect on my custom board with a Fresh TM4C Part...
More information on this topic is available in the following application note.
ISSUE#5: USB DFU gets detected but does not download.
1. For a TM4C129 with Ethernet PHY enabled and a crystal other than 24-25Mhz, the USB DFU will show up in the device manager but not download. To correct the same add a resistor of 4.89K between RBIAS and GND pin for the ROM Boot Loader to work with the USB DFU
2. Other than above for a TM4C129 and TM4C123 which has the same issue, if the CCSv6 has been installed then the drivers for the USB DFU may have been overwritten. To revert the driver, in the device manager uninstall the USB DFU driver and replace it with the stellaris_icdi_drivers from http://www.ti.com/tool/stellaris_icdi_drivers
ISSUE#6: JTAG connects, the program loads but on RUN JTAG connection breaks..
CAUSE: When a working program stops after making some changes there can be the following issues
1. The System Clock is less than 10 times the JTAG TCK Clock. As an example if the System Clock is 10MHz, the JTAG TCK Clock Frequency must not be more than 1MHz.
2. When porting code between TM4C123 and TM4C129 be careful about configuring the System Clock. The API SysCtlClockSet is meant for TM4C123 only and SysCtlClockFreqSet is meant for TM4C129 only. Even the arguments are different.
3. The JTAG Port Pins may have configured to a non-JTAG Port Select
REMEDY: You would have to run the Device Unlock Sequence using LMFlashProgrammer or UNIFLASH. Please follow the given steps
1. Unpower the board and press reset
2. Power the board but do not release the reset
3. Run the unlock sequence by the "dialog box"
4. Power Cycle the board and then do a Flash Erase Check
The following post will give more details on LMFlashProgrammer Unlock Device View for TM4C123 and TM4C129 Products
ISSUE#7: Code goes to FaultISR..
CAUSE: Fault ISR means that the CPU has hit a condition either internally or externally (w.r.t peripherals) that it cannot resolve
1. The Registers that need to be checked to begin analysis are the NVIC_FAULTSTAT and NVIC_FAULTADDR registers at absolute address 0xE000ED28 and 0xE000ED38.
2. Precise Bus Fault in NVIC_FAULTSTAT would mean that the address of Faulting location is captured in NVIC_FAULTADDR
3. Similarly every fault type mentioned has a cause associated to it, some being easy to diagnose and some being difficult to diagnose.
Refer to the following document to understand Fault Types Better...
http://www.ti.com/lit/pdf/spma043
TIP#1: Make your post informative rather than just going with the issue. Solution tends to arrive faster when a problem statement is formulated with data
1. Give the Full Part Number and Revision of the device
2. Which TivaWare release and IDE/Tools are you using
3. What are the emulators/debugger hardware being used
4. Is it a EK, DK or a Custom Board. If it is a custom board that you have an issue on, then attach the schematics
5. Crystal Frequency being used is sometimes the key...
TIP#2: Avoid Direct Register Access Macro's
TM4C devices support Direct Register Access Macro's which can be seen in inc/tm4c12xxxxx.h file when TivaWare is installed. It works for sure, but one should remember
1. It is easy developing simple codes but when the code grows and the device stops working for some reason, it can be difficult for forum members to debug
2. The code is not readily portable between TM4C123 and TM4C129 as register definition may have changed.
SUGGESTION: Use TivaWare Instead...
TIP#3: Using EK-TM4C123GXL as a Programmer
The EK-TM4C123GXL can be used as a programmer for custom boards containing TM4C12x devices. More info in the following application note
INFO#1: Reduce Issues due to IO Configuration
TM4C supports TI Pin Mux Tool. This tool can be used to correctly generate the IO Configuration Function so that application development does not require debug of user created IO Configuration that may not be working correctly.
INFO#2: USB VID:PID Use
TI allows reuse of TI's USB Vendor Identification Number (VID) and use of TI's assigned USB Product Identification Numbers (PID) under specific conditions. More details can be found in the post below
INFO#3: Using XDS100v2 and XDS200 for executing Device Unlock
In CCSv6.1.1, if the TI Emulator Version is at least 6.0.83.0 then you can use XDS100v2 or XDS200 to unlock the device. The following application notes gives the command line utility and steps to perform device unlock using XDS100v2 and XDS200.
INFO#4: ICDI Drivers for Win10
The Win 10 ICDI drivers have been uploaded to TI website and can be accessed using the details in the following forum post
More to be Added.....