K32L2A SWD pins - MCU fails to run properly unless debugger is attached

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

K32L2A SWD pins - MCU fails to run properly unless debugger is attached

Jump to solution
1,276 Views
jmullen_condose
Contributor III

I have a new design using the K32L2A, ungraded design from old Coldfirev1 MCF51QE32 part. With the prototype PCB, software runs as expected with a PEMicro Cyclone connected, even when not using the device for debug, just powering things up and the MCU runs our software as expected. 

However, when the Cyclone is disconnected from the board, the MCU seems to start very briefly then go off on it's own (does not run our software as expected, unsure if it simply stops, or what, since I cannot attached the Cyclone to debug, as that immediately fixes it!). Our design has no external resistors on the SWDIO/SWCLK lines, as the datasheet mentioned these are provided internally by the K32L2A (MCF51QE had 10K pullups on the PCB for these). 

Things tried:
- Adding 10K pullup to both these lines - problem remains
- Putting a wire off the PCB so I could touch the lead to the pins DOES FIX IT, that is, it I pinch the lead connected to the SWDIO pin between my fingers and power up the board, the MCU starts correctly and our software runs. It continues to run until I remove my fingers. This worked with either SWD pin. Capacitance? I dunno!?! 

Putting a small cap on these lines seems like a hack, clearly I am overlooking something.

No external Resistor on the Reset line either (an oversight) but this didn't seem to be the problem, as the MCU runs with me holding either one of the SWD pins, and fails as soon as I left go of the one pin.

Thoughts, hope or asperations? All are welcome
Cheers!

0 Kudos
Reply
1 Solution
1,220 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

As you know that the K32L2 has flash configuration area, after the chip starts up, the core will copy the data in flash configuration area to the FTFA_FOPT register automatically.

The PTA4 is multiplexed with PTA4, pls connect PTA4 to a pull-up resistor.

Secondly, pls clear NMI_DIS bit in the FTFA_FOPT register. In the case, NMI_b pin will not fire interrupt.

 

xiangjun_rong_0-1730166269066.png

Hope it can help you

BR

XiangJun Rong

View solution in original post

0 Kudos
Reply
2 Replies
1,233 Views
bobpaddock
Senior Contributor III
"Adding 10K pullup to both these lines - problem remains"

SWD_DIO has internal Pull-Up. SWD_CLK has internal Pull-Down.

Pulling both up at reset probably looks like a debugger clock pulse as a guess. Fingers and such would pull down long enough.

The internal resisters are rather high-Z and vary with temperature (20k to 50k).
I usually add my own of lower-Z.

From the electrical data sheet for the K32L2A:

"While pull-up or pull-down resistors are not required
(SWD_DIO has an internal pull-up and SWD_CLK has an internal pull-down), external 10 kΩ pull resistors are recommended for system robustness. The
RESET_b pin recommendations mentioned above must also be considered."
0 Kudos
Reply
1,221 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

As you know that the K32L2 has flash configuration area, after the chip starts up, the core will copy the data in flash configuration area to the FTFA_FOPT register automatically.

The PTA4 is multiplexed with PTA4, pls connect PTA4 to a pull-up resistor.

Secondly, pls clear NMI_DIS bit in the FTFA_FOPT register. In the case, NMI_b pin will not fire interrupt.

 

xiangjun_rong_0-1730166269066.png

Hope it can help you

BR

XiangJun Rong

0 Kudos
Reply