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.

TM4C123GH6PM: my MCU get halted when enable the external crystal

Part Number: TM4C123GH6PM

Hi

We have made our costume PCB and when we try to use the code 

SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);

the MCU #TM4C123GH6PM get halted so we had to clear the EEPROM using LM flash programmer, but when we use the internal oscillator every thing works fine,

I'm attaching the PCB & Schematic to advice if there any mistake regarding the design point of view.

  • Hi,

      You configure the SYSCLK to run at 200Mhz which is out of spec. The VCO output is 200Mhz and your output divider is 1. 

      Suppose you want to run at 80MHz you should use:

      SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);

  • Hi Charles

    My code working fine on the EK-TM4C123XL demo kit and also I tried your suggestion but get the same error

    CORTEX_M4_0: Trouble Halting Target CPU

    We have checked the crystal & capacitor hardware component and they works

    Appreciate your support.

    Hani

  • Hi,

      I suppose you change the code like I said to SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ) for 80Mhz operation. Is that correct? 

      Can you answer a few questions:

      - Which debug probe do you use on your custom board? The LaunchPad uses an on-board ICDI debug probe. If you are using a different debug probe on your custom board, can you try a different debug probe?

      - How many custom boards do you have? Do you see the same problem on all the boards or only one or some of them?

      - What code did you have in the flash? Sometime, a program issue such as putting the device into sleep or hibernate without a mechanism to wake up the device can lead to unable to connect problem. Since the device is in sleep then there is no clock. Without clock, the debugger can't connect to it. 

      - Can you try to unlock the device again using LM flash programmer? Will you be able to connect again?

      - Can you check if you have proper 3.3V supply to the VDD pins? Can you also check if you measure 1.2V on the VDDC pins?

      - Finally, to really find out if there is board level problem, can you do a ABA swap test. Swap in the good MCU on the LaunchPad to your custom board? Will the good MCU continue to work? If it doesn't work then it is probably the board level problem. If it is working then it is probably the MCU on that custom board that we need to investigate.