<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Best practices to guarantee SWD debugger access? in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Best-practices-to-guarantee-SWD-debugger-access/m-p/2330943#M68269</link>
    <description>Hi Celeste,&lt;BR /&gt;&lt;BR /&gt;After some more investigation, it looks like the two MCUs that I couldn't recover at all may have been victims of a bootloader bug that improperly decrypted a new firmware image, so it's possible the flash security bits got scrambled in this case. RESET stability shouldn't be an issue; it's a straight shot of a couple of centimeters from the MCU to the SWD header, and the ribbon cable is short.&lt;BR /&gt;&lt;BR /&gt;I'm just getting started with my HIL lab rack and remote debugging setup but interestingly so far it seems like things have been more stable using a "GDB Hardware Debugging" debug configuration connecting to a Raspberry Pi running OpenOCD with an MCU-Link Pro than when I use LinkServer locally with the same hardware.&lt;BR /&gt;&lt;BR /&gt;A lot of my debugger frustrations lately have traced their origin back to bad documentation for the LPC55S69. Both P&amp;amp;E and NXP got the flash memory layout wrong (it's wrong in some places in the reference manual) and both have fixed it, but MCUXpresso projects created before the fix still carry the incorrect memory configuration and have to be manually fixed. That's not the issue this time with the K02 but it's certainly been making it feel like the debuggers are unreliable.&lt;BR /&gt;&lt;BR /&gt;Thanks for your response, and I'll keep a close eye on the MCU-Link behavior going forward to see if the problem comes back.&lt;BR /&gt;&lt;BR /&gt;Scott</description>
    <pubDate>Wed, 11 Mar 2026 23:45:36 GMT</pubDate>
    <dc:creator>scottm</dc:creator>
    <dc:date>2026-03-11T23:45:36Z</dc:date>
    <item>
      <title>Best practices to guarantee SWD debugger access?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Best-practices-to-guarantee-SWD-debugger-access/m-p/2325840#M68251</link>
      <description>&lt;P&gt;I seem to have a knack for getting devices into a state where I can't access them with a debug interface.&amp;nbsp;&lt;EM&gt;Usually&lt;/EM&gt; I'm able to do a mass erase with a P&amp;amp;E Cyclone, but today I've bricked two MK02FN64s to the point that I had to just replace them.&lt;/P&gt;&lt;P&gt;Whenever I've brought this up, support has told me that it must be because I'm changing pin or clock configurations too fast. The boards I'm having trouble with don't reuse any SWD pins so that leaves only the clock. On this particular board it switches at startup from the FRO to the PLL at 60 MHz.&lt;/P&gt;&lt;P&gt;To give the debugger time to connect, I added a simple loop before the clock and pin init functions. That made things worse; I think it must have gone into a watchdog reset loop, because that's when I bricked the second MCU.&lt;/P&gt;&lt;P&gt;What's the recommended way to guarantee that the SWD debugger is always able to connect on startup? The watchdog on this thing is set pretty slow, like maybe half a second, so I'm surprised that it takes the debugger longer than that.&lt;/P&gt;&lt;P&gt;I really miss the old, simple BDM debuggers where the debugger had control from the first clock cycle and it could&amp;nbsp;&lt;EM&gt;always&lt;/EM&gt; recover a chip.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2026 01:34:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Best-practices-to-guarantee-SWD-debugger-access/m-p/2325840#M68251</guid>
      <dc:creator>scottm</dc:creator>
      <dc:date>2026-03-04T01:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: Best practices to guarantee SWD debugger access?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Best-practices-to-guarantee-SWD-debugger-access/m-p/2325968#M68252</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/126981"&gt;@scottm&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;P&amp;amp;E has a utility which helped me in many cases:&amp;nbsp;&lt;A href="https://mcuoneclipse.com/2021/05/20/recovering-cortex-m-microcontroller-with-a-power-glitch/" target="_blank"&gt;https://mcuoneclipse.com/2021/05/20/recovering-cortex-m-microcontroller-with-a-power-glitch/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The other thing I recommend is to have the reset pin available on the debug header, and not muxing that pin for something else: that way the debug probe can perform a pin reset and can try to catch the device while it is starting.&lt;/P&gt;&lt;P&gt;The other recommendation I have: keep the debug traces/cables short.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Plus: have other debug probes available. I always have a J-Link, a PEMICRO and MCU-LInk at hand. I had many cases where two of them failed to catch a device, but one of the three was able to recover it. The reason is that they all have different capabilities and different timing or speed, making a difference.&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2026 06:37:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Best-practices-to-guarantee-SWD-debugger-access/m-p/2325968#M68252</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2026-03-04T06:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Best practices to guarantee SWD debugger access?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Best-practices-to-guarantee-SWD-debugger-access/m-p/2326557#M68253</link>
      <description>&lt;P&gt;Thanks, when I have time I'll put one of the bricked MCUs back on and see if that does it.&lt;/P&gt;&lt;P&gt;Looking at my logs from yesterday again, on the first attempt it's saying the reset pin state is 1 like it's got a bad connection or something. Not sure why that would be. I've tried multiple cables and verified continuity for NRESET. On the second attempt (and this is what I kept getting) it was giving me a flash driver startup failure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Executing flash operation 'Erase' (Erase flash) - Tue Mar 03 16:28:00 PST 2026&lt;BR /&gt;Checking MCU info...&lt;BR /&gt;Scanning for targets...&lt;BR /&gt;Executing flash action...&lt;BR /&gt;LinkServer RedlinkMulti Driver v25.12 (Dec 8 2025 18:34:00 - crt_emu_cm_redlink.exe build 1160)&lt;BR /&gt;( 0) Reading remote configuration&lt;BR /&gt;Wc(03). No cache support.&lt;BR /&gt;Found chip XML file in B:/home/ads-ws1/Debug\MK02FN64xxx10.xml&lt;BR /&gt;( 5) Remote configuration complete&lt;BR /&gt;Reconnected to existing LinkServer process.&lt;BR /&gt;Connecting to probe 1 core 0 (using server started externally) reports:&lt;BR /&gt;'Ee(42). Could not connect to core.'&lt;BR /&gt;Retrying...&lt;BR /&gt;Reconnected to existing LinkServer process.&lt;BR /&gt;Server OK but no connection to probe 1 core 0 (after 3 attempts) - Ee(42). Could not connect to core.&lt;BR /&gt;============= SCRIPT: kinetisconnect.scp =============&lt;BR /&gt;Kinetis Connect Script&lt;BR /&gt;Connecting to Probe Index = 1&lt;BR /&gt;Error: Probe not connected&lt;BR /&gt;Error: Wire Ack Fault - target connected?&lt;BR /&gt;Assert NRESET&lt;BR /&gt;Reset pin state: 01&lt;BR /&gt;Error: Wire not connected&lt;BR /&gt;Power up Debug&lt;BR /&gt;Error: Wire not connected&lt;BR /&gt;Error: Wire not connected&lt;BR /&gt;No Debug Power&lt;BR /&gt;============= END SCRIPT =============================&lt;BR /&gt;Failed on connect: Ee(42). Could not connect to core.&lt;BR /&gt;No connection to chip's debug port&lt;BR /&gt;(100) Target Operation Failed&lt;BR /&gt;Unable to perform operation!&lt;BR /&gt;Command failed with exit code 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Executing flash operation 'Erase' (Erase flash) - Tue Mar 03 18:08:14 PST 2026&lt;BR /&gt;Checking MCU info...&lt;BR /&gt;Scanning for targets...&lt;BR /&gt;Executing flash action...&lt;BR /&gt;LinkServer RedlinkMulti Driver v25.12 (Dec 8 2025 18:34:00 - crt_emu_cm_redlink.exe build 1160)&lt;BR /&gt;( 0) Reading remote configuration&lt;BR /&gt;Wc(03). No cache support.&lt;BR /&gt;Found chip XML file in B:/home/ads-ws1/Debug\MK02FN64xxx10.xml&lt;BR /&gt;( 5) Remote configuration complete&lt;BR /&gt;Reconnected to existing LinkServer process.&lt;BR /&gt;============= SCRIPT: kinetisconnect.scp =============&lt;BR /&gt;Kinetis Connect Script&lt;BR /&gt;Connecting to Probe Index = 1&lt;BR /&gt;This probe = 1&lt;BR /&gt;This TAP = 0&lt;BR /&gt;This core = 0&lt;BR /&gt;DpID = 2BA01477&lt;BR /&gt;Assert NRESET&lt;BR /&gt;Reset pin state: 00&lt;BR /&gt;Power up Debug&lt;BR /&gt;MDM-AP APID: 0x001C0000&lt;BR /&gt;MDM-AP System Reset/Hold Reset/Debug Request&lt;BR /&gt;MDM-AP Control: 0x0000001C&lt;BR /&gt;MDM-AP Status (Flash Ready) : 0x00000032&lt;BR /&gt;Part is not secured&lt;BR /&gt;MDM-AP Control: 0x00000014&lt;BR /&gt;Release NRESET&lt;BR /&gt;Reset pin state: 01&lt;BR /&gt;MDM-AP Control (Debug Request): 0x00000004&lt;BR /&gt;MDM-AP Status: 0x0001003A&lt;BR /&gt;MDM-AP Core Halted&lt;BR /&gt;============= END SCRIPT =============================&lt;BR /&gt;Probe Firmware: MCU-LINK (r0FB) CMSIS-DAP V3.167 (NXP Semiconductors)&lt;BR /&gt;Serial Number: IWUNAMQCTNCGT&lt;BR /&gt;VID:PID: 1FC9:0143&lt;BR /&gt;USB Path: 0002:002f:00&lt;BR /&gt;Using memory from core 0 after searching for a good core&lt;BR /&gt;( 30) Emulator Connected&lt;BR /&gt;( 40) Debug Halt&lt;BR /&gt;( 50) CPU ID&lt;BR /&gt;debug interface type = CoreSight DP (DAP DP ID 2BA01477) over SWD TAP 0&lt;BR /&gt;processor type = Cortex-M4 (CPU ID 00000C24) on DAP AP 0&lt;BR /&gt;number of h/w breakpoints = 6&lt;BR /&gt;number of flash patches = 2&lt;BR /&gt;number of h/w watchpoints = 4&lt;BR /&gt;Probe(0): Connected&amp;amp;Reset. DpID: 2BA01477. CpuID: 00000C24. Info: &amp;lt;None&amp;gt;&lt;BR /&gt;Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.&lt;BR /&gt;Content of CoreSight Debug ROM(s):&lt;BR /&gt;RBASE E00FF000: CID B105100D PID 04000BB4C4 ROM (type 0x1)&lt;BR /&gt;ROM 1 E000E000: CID B105E00D PID 04000BB00C Gen SCS (type 0x0)&lt;BR /&gt;ROM 1 E0001000: CID B105E00D PID 04003BB002 Gen DWT (type 0x0)&lt;BR /&gt;ROM 1 E0002000: CID B105E00D PID 04002BB003 Gen FPB (type 0x0)&lt;BR /&gt;ROM 1 E0000000: CID B105E00D PID 04003BB001 Gen ITM (type 0x0)&lt;BR /&gt;ROM 1 E0040000: CID B105900D PID 04000BB9A1 CSt TPIU type 0x11 Trace Sink - TPIU&lt;BR /&gt;NXP: MK02FN64xxx10&lt;BR /&gt;DAP stride is 4096 bytes (1024 words)&lt;BR /&gt;Inspected v.2 On chip Flash memory module FTFA_2K.cfx&lt;BR /&gt;Image 'SemiGeneric Dec 8 2025 17:18:55'&lt;BR /&gt;Opening flash driver FTFA_2K.cfx&lt;BR /&gt;Sending VECTRESET to run flash driver&lt;BR /&gt;AFTER driver startup timeout (302 5ms retries)&lt;BR /&gt;Driver Addresses&lt;BR /&gt;Start: 20000000&lt;BR /&gt;Entry: 2000009D&lt;BR /&gt;End: 200006D8&lt;BR /&gt;Stack: 200007D8&lt;BR /&gt;Mailbox:200017D8&lt;BR /&gt;Driver Register State&lt;BR /&gt;R0: 00000000&lt;BR /&gt;R1: 00000000&lt;BR /&gt;R2: 1FFFFA1F&lt;BR /&gt;R3: 00000001&lt;BR /&gt;R4: 00000000&lt;BR /&gt;R5: 00000100&lt;BR /&gt;R6: 00001343&lt;BR /&gt;R7: 0008FB3B&lt;BR /&gt;R8: 00000000&lt;BR /&gt;R9: 00000000&lt;BR /&gt;R10: 00000000&lt;BR /&gt;R11: 00000000&lt;BR /&gt;R12: 0000000A&lt;BR /&gt;SP: 20001F98&lt;BR /&gt;LR: 0000464F&lt;BR /&gt;PC: 0000464E&lt;BR /&gt;xPSR: 01000000&lt;BR /&gt;MSP: 20001F98&lt;BR /&gt;PSP: 00000000&lt;BR /&gt;CFBP: 04000001 (CONTROL=0x4, FAULTMASK=0x0, BASEPRI=0x0, PRIMASK=0x1)&lt;BR /&gt;Flash Driver V.2 startup failed - rc Ef(34): Timed-out initializing flash.&lt;BR /&gt;chip initialization failed - Ef(34): Timed-out initializing flash.&lt;BR /&gt;failed to initialize flash driver FTFA_2K.cfx&lt;BR /&gt;( 65) Chip Setup Complete&lt;BR /&gt;(100) Target Operation Failed&lt;BR /&gt;Unable to perform operation!&lt;BR /&gt;Command failed with exit code 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2026 18:54:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Best-practices-to-guarantee-SWD-debugger-access/m-p/2326557#M68253</guid>
      <dc:creator>scottm</dc:creator>
      <dc:date>2026-03-04T18:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Best practices to guarantee SWD debugger access?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Best-practices-to-guarantee-SWD-debugger-access/m-p/2329643#M68263</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/126981"&gt;@scottm&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thanks for sharing the detailed logs.&lt;/P&gt;
&lt;P&gt;From the first attempt, it looks like the RESET and SWD signals are not stable. It may be worth checking the SWD cable length, grounding quality, and whether there are strong pull‑ups or large RC components on the RESET line.&lt;/P&gt;
&lt;P&gt;In the second attempt, the timeout during flash driver startup usually indicates that the MCU is stuck in an invalid clock configuration, or that a reset occurred in the middle of a flash operation.&lt;/P&gt;
&lt;DIV&gt;
&lt;P&gt;Common causes are:&lt;/P&gt;
&lt;P&gt;The PLL failing to lock or using an invalid clock source&lt;/P&gt;
&lt;P&gt;The clock running out of spec, causing the flash driver (executing from RAM) to fail&lt;/P&gt;
&lt;P&gt;A previous watchdog reset during flash programming&lt;/P&gt;
&lt;P&gt;Please try&amp;nbsp;connect under reset, timed reset, or power‑glitch recovery as Erich suggested.&lt;/P&gt;
&lt;P&gt;Have a nice day!&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Celeste&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 10 Mar 2026 09:43:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Best-practices-to-guarantee-SWD-debugger-access/m-p/2329643#M68263</guid>
      <dc:creator>Celeste_Liu</dc:creator>
      <dc:date>2026-03-10T09:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: Best practices to guarantee SWD debugger access?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Best-practices-to-guarantee-SWD-debugger-access/m-p/2330943#M68269</link>
      <description>Hi Celeste,&lt;BR /&gt;&lt;BR /&gt;After some more investigation, it looks like the two MCUs that I couldn't recover at all may have been victims of a bootloader bug that improperly decrypted a new firmware image, so it's possible the flash security bits got scrambled in this case. RESET stability shouldn't be an issue; it's a straight shot of a couple of centimeters from the MCU to the SWD header, and the ribbon cable is short.&lt;BR /&gt;&lt;BR /&gt;I'm just getting started with my HIL lab rack and remote debugging setup but interestingly so far it seems like things have been more stable using a "GDB Hardware Debugging" debug configuration connecting to a Raspberry Pi running OpenOCD with an MCU-Link Pro than when I use LinkServer locally with the same hardware.&lt;BR /&gt;&lt;BR /&gt;A lot of my debugger frustrations lately have traced their origin back to bad documentation for the LPC55S69. Both P&amp;amp;E and NXP got the flash memory layout wrong (it's wrong in some places in the reference manual) and both have fixed it, but MCUXpresso projects created before the fix still carry the incorrect memory configuration and have to be manually fixed. That's not the issue this time with the K02 but it's certainly been making it feel like the debuggers are unreliable.&lt;BR /&gt;&lt;BR /&gt;Thanks for your response, and I'll keep a close eye on the MCU-Link behavior going forward to see if the problem comes back.&lt;BR /&gt;&lt;BR /&gt;Scott</description>
      <pubDate>Wed, 11 Mar 2026 23:45:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Best-practices-to-guarantee-SWD-debugger-access/m-p/2330943#M68269</guid>
      <dc:creator>scottm</dc:creator>
      <dc:date>2026-03-11T23:45:36Z</dc:date>
    </item>
  </channel>
</rss>

