<?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 MK20DX128 refusing to program? in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK20DX128-refusing-to-program/m-p/1040760#M56779</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, we're having this issue trying to program MK20 for OpenSDA;&lt;/P&gt;&lt;P&gt;After programming the reset pin is outputing pulses which according to various other posts here means the chip did not program correctly but the J-Flash&amp;nbsp;Lite and J-Link Commander seem to report otherwise.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another think to poing out is that J-Flash lite wrote the message of the MCU being protected and that I needed to do a full chip erase which was the case every time I tried to program it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Here's the schematic:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_4.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112705i9A816E280F3E98DF/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_4.png" alt="pastedImage_4.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Here's the reset pin:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.bmp"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112706i870537C0A0623A50/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.bmp" alt="pastedImage_1.bmp" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;And here's the J-Link commander text:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SEGGER J-Link Commander V6.80b (Compiled Jun 5 2020 17:41:24)&lt;BR /&gt;DLL version V6.80b, compiled Jun 5 2020 17:40:22&lt;/P&gt;&lt;P&gt;Connecting to J-Link via USB...O.K.&lt;BR /&gt;Firmware: J-Link Lite-Cortex-M V8 compiled Sep 15 2016 12:05:01&lt;BR /&gt;Hardware version: V8.00&lt;BR /&gt;S/N: 518109715&lt;BR /&gt;License(s): GDB&lt;BR /&gt;VTref=3.313V&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Type "connect" to establish a target connection, '?' for help&lt;BR /&gt;J-Link&amp;gt;connect&lt;BR /&gt;Please specify device / core. &amp;lt;Default&amp;gt;: MK20DX128XXX5&lt;BR /&gt;Type '?' for selection dialog&lt;BR /&gt;Device&amp;gt;MK20DX128XXX5&lt;BR /&gt;Please specify target interface:&lt;BR /&gt; J) JTAG (Default)&lt;BR /&gt; S) SWD&lt;BR /&gt; T) cJTAG&lt;BR /&gt;TIF&amp;gt;S&lt;BR /&gt;Specify target interface speed [kHz]. &amp;lt;Default&amp;gt;: 4000 kHz&lt;BR /&gt;Speed&amp;gt;100&lt;BR /&gt;Device "MK20DX128XXX5" selected.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Connecting to target via SWD&lt;BR /&gt;InitTarget()&lt;BR /&gt;Found SW-DP with ID 0x2BA01477&lt;BR /&gt;Unknown DP version. Assuming DPv0&lt;BR /&gt;Scanning AP map to find all available APs&lt;BR /&gt;AP[2]: Stopped AP scan as end of AP map has been reached&lt;BR /&gt;AP[0]: AHB-AP (IDR: 0x24770011)&lt;BR /&gt;AP[1]: JTAG-AP (IDR: 0x001C0000)&lt;BR /&gt;Iterating through AP map to find AHB-AP to use&lt;BR /&gt;AP[0]: Core found&lt;BR /&gt;AP[0]: AHB-AP ROM base: 0xE00FF000&lt;BR /&gt;CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)&lt;BR /&gt;Found Cortex-M4 r0p1, Little endian.&lt;BR /&gt;FPUnit: 6 code (BP) slots and 2 literal slots&lt;BR /&gt;CoreSight components:&lt;BR /&gt;ROMTbl[0] @ E00FF000&lt;BR /&gt;ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB000 SCS&lt;BR /&gt;ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT&lt;BR /&gt;ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB&lt;BR /&gt;ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM&lt;BR /&gt;ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU&lt;BR /&gt;Cortex-M4 identified.&lt;BR /&gt;J-Link&amp;gt;unlock kinetis&lt;BR /&gt;Found SWD-DP with ID 0x2BA01477&lt;BR /&gt;Unlocking device...O.K.&lt;BR /&gt;J-Link&amp;gt;erase&lt;/P&gt;&lt;P&gt;**************************&lt;BR /&gt;WARNING: CPU could not be halted&lt;BR /&gt;**************************&lt;/P&gt;&lt;P&gt;Erasing device...&lt;/P&gt;&lt;P&gt;**************************&lt;BR /&gt;WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1.&lt;BR /&gt;**************************&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;****** Error: Failed to download RAMCode.&lt;BR /&gt;Failed to prepare for programming.&lt;BR /&gt;Failed to download RAMCode!&lt;BR /&gt;ERROR: Erase returned with error code -1.&lt;BR /&gt;J-Link&amp;gt;r&lt;BR /&gt;Reset delay: 0 ms&lt;BR /&gt;Reset type NORMAL: Resets core &amp;amp; peripherals via SYSRESETREQ &amp;amp; VECTRESET bit.&lt;BR /&gt;Reset: Halt core after reset via DEMCR.VC_CORERESET.&lt;BR /&gt;Reset: Reset device via AIRCR.SYSRESETREQ.&lt;BR /&gt;AfterResetTarget()&lt;BR /&gt;J-Link&amp;gt;erase&lt;BR /&gt;Erasing device...&lt;BR /&gt;J-Link: Flash download: Total time needed: 4.053s (Prepare: 1.254s, Compare: 0.000s, Erase: 1.991s, Program: 0.000s, Verify: 0.000s, Restore: 0.806s)&lt;BR /&gt;J-Link: Flash download: Total time needed: 2.082s (Prepare: 0.962s, Compare: 0.000s, Erase: 0.561s, Program: 0.000s, Verify: 0.000s, Restore: 0.558s)&lt;BR /&gt;Erasing done.&lt;BR /&gt;J-Link&amp;gt;loadbin C:\Users\xyz\Downloads\k20dx_mimxrt1020_evk_qspi_if_crc20180312.bin&lt;BR /&gt;Syntax: loadbin &amp;lt;filename&amp;gt;, &amp;lt;addr&amp;gt;&lt;BR /&gt;J-Link&amp;gt;loadbin C:\Users\xyz\Downloads\k20dx_mimxrt1020_evk_qspi_if_crc20180312.bin,0x0&lt;BR /&gt;Downloading file [C:\Users\xyz\Downloads\k20dx_mimxrt1020_evk_qspi_if_crc20180312.bin]...&lt;BR /&gt;J-Link: Flash download: Bank 0 @ 0x00000000: 2 ranges affected (65536 bytes)&lt;BR /&gt;J-Link: Flash download: Total: 11.138s (Prepare: 1.198s, Compare: 0.329s, Erase: 0.026s, Program &amp;amp; Verify: 8.780s, Restore: 0.803s)&lt;BR /&gt;J-Link: Flash download: Program &amp;amp; Verify speed: 7 KB/s&lt;BR /&gt;O.K.&lt;BR /&gt;J-Link&amp;gt;r&lt;BR /&gt;Reset delay: 0 ms&lt;BR /&gt;Reset type NORMAL: Resets core &amp;amp; peripherals via SYSRESETREQ &amp;amp; VECTRESET bit.&lt;BR /&gt;Reset: Halt core after reset via DEMCR.VC_CORERESET.&lt;BR /&gt;Reset: Reset device via AIRCR.SYSRESETREQ.&lt;BR /&gt;AfterResetTarget()&lt;BR /&gt;J-Link&amp;gt;g&lt;BR /&gt;J-Link&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Jun 2020 13:40:39 GMT</pubDate>
    <dc:creator>joogoosa</dc:creator>
    <dc:date>2020-06-12T13:40:39Z</dc:date>
    <item>
      <title>MK20DX128 refusing to program?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK20DX128-refusing-to-program/m-p/1040760#M56779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, we're having this issue trying to program MK20 for OpenSDA;&lt;/P&gt;&lt;P&gt;After programming the reset pin is outputing pulses which according to various other posts here means the chip did not program correctly but the J-Flash&amp;nbsp;Lite and J-Link Commander seem to report otherwise.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another think to poing out is that J-Flash lite wrote the message of the MCU being protected and that I needed to do a full chip erase which was the case every time I tried to program it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Here's the schematic:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_4.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112705i9A816E280F3E98DF/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_4.png" alt="pastedImage_4.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Here's the reset pin:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.bmp"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112706i870537C0A0623A50/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.bmp" alt="pastedImage_1.bmp" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;And here's the J-Link commander text:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SEGGER J-Link Commander V6.80b (Compiled Jun 5 2020 17:41:24)&lt;BR /&gt;DLL version V6.80b, compiled Jun 5 2020 17:40:22&lt;/P&gt;&lt;P&gt;Connecting to J-Link via USB...O.K.&lt;BR /&gt;Firmware: J-Link Lite-Cortex-M V8 compiled Sep 15 2016 12:05:01&lt;BR /&gt;Hardware version: V8.00&lt;BR /&gt;S/N: 518109715&lt;BR /&gt;License(s): GDB&lt;BR /&gt;VTref=3.313V&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Type "connect" to establish a target connection, '?' for help&lt;BR /&gt;J-Link&amp;gt;connect&lt;BR /&gt;Please specify device / core. &amp;lt;Default&amp;gt;: MK20DX128XXX5&lt;BR /&gt;Type '?' for selection dialog&lt;BR /&gt;Device&amp;gt;MK20DX128XXX5&lt;BR /&gt;Please specify target interface:&lt;BR /&gt; J) JTAG (Default)&lt;BR /&gt; S) SWD&lt;BR /&gt; T) cJTAG&lt;BR /&gt;TIF&amp;gt;S&lt;BR /&gt;Specify target interface speed [kHz]. &amp;lt;Default&amp;gt;: 4000 kHz&lt;BR /&gt;Speed&amp;gt;100&lt;BR /&gt;Device "MK20DX128XXX5" selected.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Connecting to target via SWD&lt;BR /&gt;InitTarget()&lt;BR /&gt;Found SW-DP with ID 0x2BA01477&lt;BR /&gt;Unknown DP version. Assuming DPv0&lt;BR /&gt;Scanning AP map to find all available APs&lt;BR /&gt;AP[2]: Stopped AP scan as end of AP map has been reached&lt;BR /&gt;AP[0]: AHB-AP (IDR: 0x24770011)&lt;BR /&gt;AP[1]: JTAG-AP (IDR: 0x001C0000)&lt;BR /&gt;Iterating through AP map to find AHB-AP to use&lt;BR /&gt;AP[0]: Core found&lt;BR /&gt;AP[0]: AHB-AP ROM base: 0xE00FF000&lt;BR /&gt;CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)&lt;BR /&gt;Found Cortex-M4 r0p1, Little endian.&lt;BR /&gt;FPUnit: 6 code (BP) slots and 2 literal slots&lt;BR /&gt;CoreSight components:&lt;BR /&gt;ROMTbl[0] @ E00FF000&lt;BR /&gt;ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB000 SCS&lt;BR /&gt;ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT&lt;BR /&gt;ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB&lt;BR /&gt;ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM&lt;BR /&gt;ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU&lt;BR /&gt;Cortex-M4 identified.&lt;BR /&gt;J-Link&amp;gt;unlock kinetis&lt;BR /&gt;Found SWD-DP with ID 0x2BA01477&lt;BR /&gt;Unlocking device...O.K.&lt;BR /&gt;J-Link&amp;gt;erase&lt;/P&gt;&lt;P&gt;**************************&lt;BR /&gt;WARNING: CPU could not be halted&lt;BR /&gt;**************************&lt;/P&gt;&lt;P&gt;Erasing device...&lt;/P&gt;&lt;P&gt;**************************&lt;BR /&gt;WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1.&lt;BR /&gt;**************************&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;****** Error: Failed to download RAMCode.&lt;BR /&gt;Failed to prepare for programming.&lt;BR /&gt;Failed to download RAMCode!&lt;BR /&gt;ERROR: Erase returned with error code -1.&lt;BR /&gt;J-Link&amp;gt;r&lt;BR /&gt;Reset delay: 0 ms&lt;BR /&gt;Reset type NORMAL: Resets core &amp;amp; peripherals via SYSRESETREQ &amp;amp; VECTRESET bit.&lt;BR /&gt;Reset: Halt core after reset via DEMCR.VC_CORERESET.&lt;BR /&gt;Reset: Reset device via AIRCR.SYSRESETREQ.&lt;BR /&gt;AfterResetTarget()&lt;BR /&gt;J-Link&amp;gt;erase&lt;BR /&gt;Erasing device...&lt;BR /&gt;J-Link: Flash download: Total time needed: 4.053s (Prepare: 1.254s, Compare: 0.000s, Erase: 1.991s, Program: 0.000s, Verify: 0.000s, Restore: 0.806s)&lt;BR /&gt;J-Link: Flash download: Total time needed: 2.082s (Prepare: 0.962s, Compare: 0.000s, Erase: 0.561s, Program: 0.000s, Verify: 0.000s, Restore: 0.558s)&lt;BR /&gt;Erasing done.&lt;BR /&gt;J-Link&amp;gt;loadbin C:\Users\xyz\Downloads\k20dx_mimxrt1020_evk_qspi_if_crc20180312.bin&lt;BR /&gt;Syntax: loadbin &amp;lt;filename&amp;gt;, &amp;lt;addr&amp;gt;&lt;BR /&gt;J-Link&amp;gt;loadbin C:\Users\xyz\Downloads\k20dx_mimxrt1020_evk_qspi_if_crc20180312.bin,0x0&lt;BR /&gt;Downloading file [C:\Users\xyz\Downloads\k20dx_mimxrt1020_evk_qspi_if_crc20180312.bin]...&lt;BR /&gt;J-Link: Flash download: Bank 0 @ 0x00000000: 2 ranges affected (65536 bytes)&lt;BR /&gt;J-Link: Flash download: Total: 11.138s (Prepare: 1.198s, Compare: 0.329s, Erase: 0.026s, Program &amp;amp; Verify: 8.780s, Restore: 0.803s)&lt;BR /&gt;J-Link: Flash download: Program &amp;amp; Verify speed: 7 KB/s&lt;BR /&gt;O.K.&lt;BR /&gt;J-Link&amp;gt;r&lt;BR /&gt;Reset delay: 0 ms&lt;BR /&gt;Reset type NORMAL: Resets core &amp;amp; peripherals via SYSRESETREQ &amp;amp; VECTRESET bit.&lt;BR /&gt;Reset: Halt core after reset via DEMCR.VC_CORERESET.&lt;BR /&gt;Reset: Reset device via AIRCR.SYSRESETREQ.&lt;BR /&gt;AfterResetTarget()&lt;BR /&gt;J-Link&amp;gt;g&lt;BR /&gt;J-Link&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2020 13:40:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK20DX128-refusing-to-program/m-p/1040760#M56779</guid>
      <dc:creator>joogoosa</dc:creator>
      <dc:date>2020-06-12T13:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: MK20DX128 refusing to program?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK20DX128-refusing-to-program/m-p/1040761#M56780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;Hope you are doing well.&lt;/P&gt;&lt;P&gt;From your log it looks to me that you are downloading the firmware on address 0. However, this is where the bootloader should be. You need to first download the first binary located on the &lt;A href="https://www.nxp.com/design/microcontrollers-developer-resources/ides-for-kinetis-mcus/opensda-serial-and-debug-adapter:OPENSDA#MIMXRT1020-EVK"&gt;OPENSDA page&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112816i59C3F4B8E272F8BD/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This will be in address 0. Once that is downloaded you will be able to drag and drop the firmware as described in the page as well, then consequently be able to work with your board.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Sabina&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2020 15:41:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK20DX128-refusing-to-program/m-p/1040761#M56780</guid>
      <dc:creator>Sabina_Bruce</dc:creator>
      <dc:date>2020-06-15T15:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: MK20DX128 refusing to program?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK20DX128-refusing-to-program/m-p/1040762#M56781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;THank you very much, that helped!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2020 07:21:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK20DX128-refusing-to-program/m-p/1040762#M56781</guid>
      <dc:creator>joogoosa</dc:creator>
      <dc:date>2020-06-16T07:21:22Z</dc:date>
    </item>
  </channel>
</rss>

