This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TM4C123BH6PZ: JTAG Error -1170 & -1063

Part Number: TM4C123BH6PZ
Other Parts Discussed in Thread: UNIFLASH

Tool/software: Code Composer Studio

In setting up the scenario the specified controller is used on a custom board. The debugger is a Blackhawk USB-560M (cTI 20-pin header). Utilizing CCS v6.1 with TivaWare 2.1.4.178. A CCS project has been set-up to initially set-up the SSI peripheral to test communication to another device. The target configuration was left defaulted without any modifications. Upon connecting to the CORTEX_M4 through the debugger it was seen to be able to break at main(). Upon stepping through two functions the console reached a point shortly after attempting to step through or perhaps during the second function the Error -1170 Unable to access the DAP was seen. The following code segment shows the two instructions step through at the top of main()

ROM_FPULazyStackingEnable(); // Step through function 1
ROM_SysCtlClockSet(SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_SYSDIV_2_5); // Step through function 2

Upon resetting the board through a power cycle and attempting to the CORTEX_M4 the Error -1170 continually appears before even being able to load a program. After launching the configuration and showing all cores an attempt has been made to connect to the CS_DAP which has been repeatable to successfully connect "(Unconnected)" text is no longer present. Upon attempting to disconnect the CS_DAP and connecting to the CORTEX_M4 the Error -1170 appears again. Once an Error -1170 error has occurred the error is seen again on any attempt to connect to the CS_DAP. Only upon a power cycle will the CS_DAP connection be successful. On occasion, the Error -10363 has been seen on both CS_DAP and CORTEX_M4 connection attempts.

Various TI documentation sources have been examined for possible implementation error on this board:
SPMA075 "Using TM4C12x Devices Over JTAG Interface"
SPRU655I "Emulation and Trace Headers"
Along with the controller datasheet

With the above information the following things have been reexamined:

Trying slower TCK clock speeds of 100KHz, 1.0Mhz

  • Running the "Test Connection" for the IR and DR integrity-scan test has returned successful results with no failures. This has been run multiple times and no has error has ever been seen.
  • The 20-pin cTI connector header connections have been reexamined to match those specified in SPMA075 along with extra guidelines on TDO and TCK trace length and impedance. The TCK/RTCK are implemented with the 22-ohm series resistance.
  • The VDD, VDDA, VDDC voltages have been examined and found with no issue.
  • OSC0 was originally unconnected as the internal 16 MHz oscillator is being utilized, but this pin has since been tied to GND.
  • The external reset pin is controlled via an FPGA with LVTTL logic levels and has an internal weak pull-up being utilized rather than an external pull-up. Once the FPGA is configured the controller is allowed to be brought out of reset. This has been examined to adhere to the minimum 250 ns active-low timing needed before bring logic level back high

In the end, the Error -1170 has is a reoccurring roadblock. After revising the JTAG hardware and controller pin set-up I cannot find anything else to examine with the hardware itself nor am I sure of other aspects to examine that might have been related to the program due to those two instructions. A suspected idea might be a "locked" controller. However, with the given information I am not certain how that might have occurred. In any case, the SPMA075 document refers to the XDS560 not supporting the unlock feature. 

  • Hi Erik,

      The CCS6.1 is quite old. Can you migrate to the latest CCS version?

      Can you provide a little more information?

      1.  I assume your existing code in the MCU is something related to the SSI peripheral. Does this board ever have other code running before that was working with the 560M debug probe? Or this SSI code is the first time the customer board is programmed?

      2. Are you able to load and run another code (i.e. any TivaWare examples)?

      3. Is this the only board or do you have another board that exhibit the same problem?

      4. Do you have another 560M debug probe that you can repeat the problem?

      5. Do you have another non-560M debug probe (i.e. XDS560, XDS200, XDS100 and etc) that you can repeat the problem?

      6. Can you try the latest CCS version and can you repeat the problem? You don't have to unintall your current version. 

      7. Do you have pull up resistors on the nRESET, TCK and TMS?

    1. The situation described in the first post was the first time programming a fresh MCU on this custom board. No other program or code had been loaded onto this piece at all. 
    2. No other code could be loaded after the first program load failed. As stated previously, the two code snippets are the first user loaded adjustments. The GEL file has no set-up beyond the CCS provided one.
    3. A second board has now been examined. With an empty main() communication to the processor was able to establish. In loading a program with only "printf" functions the program was able to run and excecute. However, after attempting to run through the first two code snippets as previously mentioned the Error -1170 was seen again after trying to step over "ROM_SysCtlClockSet(SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_SYSDIV_2_5);". At this point a slower TCK clock rate had been used for the target configuration of 1.0MHz before loading the program. After this the earlier symptoms of the Error -1170, Error -1063, and the ability to connect to the CS_DAP was possible. No issue on the IR and DR chain tests.
    4. Yes. The same 560M probe had been used on both boards. A secondary one had been attempted after the second board was not communicating. 
    5. Not at this time. I believe we will attempt to get another probe which will allow us to unlock the device before testing any other boards as it seems to be related at the ROM_SysCtlClockSet function call after testing two separate boards. Which hopefully the unlock feature is what is needed.
    6. The project has not been updated at all at this time to a newer CCS version.
    7. Pull-ups are in place on both boards for the /RST, TCK, and TMS with a value of 10K.

    -Erik

  • Hi Erik,

    If you don't call the FPULazyStackingEnable will you get the error with only the ROM_SysCtlClockSet()?
  • We had not tested this step. Instead, we were able to obtain the XDS100v2 to be able to utilizing Uniflash to unlock the device. Upon more inspection of the SysCtlClockSet it had the wrong argument setting. The code had been leveraged on a TI eval board which had a 16 MHz external oscillator and we had intended to utilize the internal oscillator and therefore did not have an external oscilllator. Upon changing the argument no issues have since been incurred on the 2 custom boards.

    The only puzzling thing is how does improper system clock settings manage to lock the Debug Access Port. There have been some improper clock settings seen on the forums locking the MCU, but not much explanation that I could find on the mechanism for it locking out the debug access port. 

    Thank you for the suggestions.

  • Glad your problem is solved. Without the crystal connected, the device will have no clock (the clock is basically flat as you might have tied off the OSCIN input) after executing the line ROM_SysCtlClockSet(). If you are quick enough and with some luck, the debugger might be able to connect to the target before the ROM_SysCtlClockSet() is called. In the past for a different MCU, we normally will try to connect while holding the reset active. As soon as the reset is released the debugger will connect to the target. If the connection is made before the ROM_SysCtlClockSet is called you can halt the CPU and erase the code. You will have to try many times. But this is not a guaranteed success.
  • Charles Tsai said:
    You will have to try many times. But this is not a guaranteed success.

    And - a small, highly effective piece of  "defensive code"  (gpio-jtag.c)  has long been provided - which "solves the frustration of  "many attempts - yet few (wins.)"    (as the code will, "Stick in a loop - providing plenty of time for the debugger to "attach.")    Our firm uses such method (always)...

    Such code can be employed early on (i.e. development) when the program is most unstable - and bypassed and/or deleted - when "all proves well."

  • Hi cb1,
    Yes, that is a good suggestion. I personally tried that before in a different MCU during code development. Another method I have tried is to change the reset vector to branch itself. You will need to use the debugger to move the PC to the next line of code. After the s/w development, the real reset vector is then restored.
  • Hi Charles,

    Yours too - is a fine suggestion. Some users note the (potential) "Loss of a GPIO" via "gpio-jtag.c" - but that GPIO may be "recovered downstream" - so that proves (not) a major weakness - nor loss. It is also possible to "Invoke a Timer immediately post Reset" - saving the GPIO (hoarding them, really) and such method also provides "time for the debugger to attach."

    Prevention - most always - proves far better than (any) cure!