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.

TM4C129ENCPDT: Custom Board Debugging Problem

Part Number: TM4C129ENCPDT
Other Parts Discussed in Thread: UNIFLASH

Hello,

I have a problem with my custom designed Tiva TM4C129ENCPDT MCU. When I embed the code with CCS6.1.0, I get ''Error Connecting to the target" error

I have 5 of my custom boards. The awkward situation is that the code can be debugged, I can reach the MCU for the first debug operation. Then for the rest of the trials for debugging, CCS gives the "Error Connecting to the target" error. I use the code below.

#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/rom.h"
#include "driverlib/rom_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"

int main(void)
	{
	// Sistem Clock: 120 Mhz
	MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);

	MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOK);
	MAP_GPIOPinTypeGPIOOutput(GPIO_PORTK_BASE, GPIO_PIN_0);
	MAP_GPIOPinWrite(GPIO_PORTK_BASE, GPIO_PIN_0, 0x00);

	MAP_GPIOPinWrite(GPIO_PORTK_BASE, GPIO_PIN_0, GPIO_PIN_0);

	while(1);
}

If I remove the "MAP_SysCtlClockFreqSet" function, the problem is gone. I can debug multiple time instead of one time. 

Do you know any common problem like in this circumstance?

If I don't configure the system clock, there is no problem. When I configure the clock, the code can be debugged for one time, then I cannot reach the MCU again. 

It is not much related but I would like to ask a question. When I do not configure the System clock, what happens? What is the default setting for the system clock?

Thanks

  • Hi Okan,

     Which TivaWare version are you using? Can you update to the latest version and see if it makes a difference?

      Can you also try with SysCtlClockFreqSet() instead of MAP_SysCtlClockFreqSet()? I want to know if you are hitting the known errata, SYSCTL#22 or SYSCTL#23. 

  • Hi Charles,

    I'm using TivaWare_C_Series-2.1.0.12573

    When I changed the function name, the problem repeats. Because, I cannot reach the target. Thereby, the code cannot be embedded.

    I think the problem is the 25Mhz crystal used on my board. Because, the target becomes unavailable after first debugging. So, I think I'm changing the deafult oscillator to 25 Mhz external crystal after first time embedding.

    Do you know how to return to use default internal oscillator to reach the MCU again? I cannot change it with debugging with different code since the crystal is changed to external one in the first attempt and I cannot return back. I think the board is in hardware brick. Do you have any solution.

    I think, I have to go back to deafult settting somehow. But I do not know how.

    Thanks
  • Hi Okan,
    Please refer to section 5.3 of this app note to unlock your device www.ti.com/.../spma075.pdf. Once unlocked, please use the latest TivaWare version which is 2.1.4.178.
  • Hi Charles - welcome back.

    Should not there appear some "PLL_DIVIDE" w/in poster's function:

    MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);

    Firm/I do not use 129 - yet I believe such a divide is needed there - just as it (always) has been required by LM3S, LX4F and 4C123!
  • Hi cb1,
    Thanks for the greeting.

    The SysCtlClockFreqSet API will do the PLL divide based VCO output (480Mhz as inferred) and the specified System clock (120Mhz).
  • Whoops - surely the "difference" between that NEW "FreqSet" and the old "standby" (ClockSet) must have yielded (some) interesting discussion...
  • Hello Charles,

    Sorry for late response. The unlock method you mentioned is right. But I couldn't do it with link you sent which uses LM Flash Programmer steps. It didn't work.

    I tried the CCS Uniflash and choose "Tempest and Firestorm classes" instead of the "Fury, DustDevil..." in options and proceed the steps. It worked however it does not work for the first trial of unlock operation when the MCU is locked. When I tried to unlock 2 or 3 times repeatedly, it worked. Eventually, I can unlock the MCU.

    I think my problem is because of the External Oscillator. When I search about external crystal problem, I see that some people also have the same issue.

    I use 25 Mhz external oscillator like on Tiva Connected Launhpad but it does not work.

    Do you know any common problem like this and solution on the problem?

    Thanks
  • The fact that you've (already) verified this thread may "reduce the odds" of Charles seeing and/or responding. (vendor reps are bombarded w/requests - less priority is granted to those (already) Verified!) (you should be able to "remove the Verify" - and gain higher priority.)
  • Hi Okan,

     Do you have the 4.7k RBIAS resistor connected per the below errata?

    Hi Cb1,

     Thank you for the reminder!

  • Hi Charles - my pleasure to have served - so MANY "miss" that 4K7 resistor - again "far better Highlighting" is necessary!

    That "fix" should appear as an amendment to the MCU Manual - and at least in all (existing) code examples - otherwise the suffering of so many - drags on & on - never good.   (blind eye to such "Known Issue" is clearly recognized - and not well received by user-clients...  ... and surely not your doing...)      

    Correcting such "unexpected behaviors" should not rely (solely - as done now) w/in the Errata!      (clearly this poster - and many, many of his fellows - have MISSED that  proven, "woefully ineffective" warning!)

  • Hi cb1,
    Thanks. I acknowledge your concern. The datasheets and code examples are in a state that will remain un-updated in the near term. So I will have some discussion internally how to address this issue (RBIAS resistor) in a most effective way.
  • Hi Charles,

    Again - you are in no way responsible - yet the apparent "Lack of effective effort" rings, "Loudly" - and proves a "pattern" - when over-layed with the (equally) unaddressed R9/R10 and PF0/PD7.

    The endless arrival of posters - each having toppled from such "well known" (yet ineffectively marked) cliffs - somehow does not convey great, "client care/concern!"

  • Hi Charles,

    Yes, we have connected the 4.7k RBIAS resistor.