<?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: LPC546XX: SWD Locked? in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1474043#M49167</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;"You also can try to connect the SWD pins to LPCxpresso54628 EVK board, then connect debugger with EVK board, to debug your own chip to test."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Do you mean using the embedded debugger in EVK to debug an external MCU? Yes, I already tried. I moved JP2 to ext position and mounted JP1. I put a pin to pin cable between P1 of EVK and SWD header port of my custom board.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;-&amp;gt;&amp;gt; NO, I meaning replace the LPC54628 SWD pins with your own chip lpc54606, want to use all the hardware of lpcxpresso54628-EVK. while it seems hardly. For example connect SWDIO to EVK board.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;Because as you described, chip can update firmware with ISP mode, and image can works well. Also have not program OTP. So, the most likely cause is the SWD hardware. And BTW, do you config the SWD pins to other functions in your application code?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;BR&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;Alice&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jun 2022 03:43:44 GMT</pubDate>
    <dc:creator>Alice_Yang</dc:creator>
    <dc:date>2022-06-15T03:43:44Z</dc:date>
    <item>
      <title>LPC546XX: SWD Locked?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1454331#M48684</link>
      <description>&lt;P&gt;I have a custom board with LPC546XX that was working well with a J-Link debug probe over SWD.&lt;/P&gt;&lt;P&gt;Now it doesn't work anymore, JLink says it wasn't able to connect to the device.&lt;/P&gt;&lt;P&gt;I tried to power up the device with ISP0 connected to GND and it enters correctly into ISP mode over UART. Indeed I can sends commands over UART and the device replies correctly.&lt;/P&gt;&lt;P&gt;Even if I let the my application run (leaving ISP0 floating at startup), the MCU seems working well, but JLink isn't able to connect.&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 16:46:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1454331#M48684</guid>
      <dc:creator>giusloq</dc:creator>
      <dc:date>2022-05-06T16:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546XX: SWD Locked?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1454432#M48685</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;A id="link_12" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://community.nxp.com/t5/user/viewprofilepage/user-id/160419" target="_self" aria-label="View Profile of giusloq"&gt;&lt;SPAN class=""&gt;giusloq&lt;/SPAN&gt;&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;How about erase all after enter isp mode, than try again?&lt;/P&gt;
&lt;P&gt;Or change to another debugger to have a try?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Alice&lt;/P&gt;</description>
      <pubDate>Sat, 07 May 2022 02:39:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1454432#M48685</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2022-05-07T02:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546XX: SWD Locked?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1455794#M48719</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;How about erase all after enter isp mode, than try again?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;I just tried and this is the result:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Synchronized&lt;BR /&gt;Synchronized&lt;BR /&gt;OK&lt;BR /&gt;U 23130&lt;BR /&gt;OK&lt;BR /&gt;P 0 15&lt;BR /&gt;0&lt;BR /&gt;E 0 15&lt;BR /&gt;15&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;It seems the MCU answers with error 15 to erase sectors command. It should be&amp;nbsp;ERR_ISP_CMD_LOCKED.&lt;/P&gt;&lt;P&gt;What does it mean? Is it related to CRP or ECRP or OTP? I never used any of those features.&lt;/P&gt;&lt;P&gt;Indeed, word at 0x24 address is 0x000000 (Legacy Image):&lt;/P&gt;&lt;PRE&gt;R 36 4&lt;BR /&gt;0&lt;BR /&gt;00 00 00 00   &amp;lt;- in binary&lt;/PRE&gt;&lt;P&gt;I don't know if it is possible to read OTP memory by ISP.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Or change to another debugger to have a try?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;I tried the contrary. With the same debugger I tried to connect to a LPCXpresso54628 EVB and it works.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now I'm mounting a second prototype of custom board and it works on this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So the question is: what happened to the MCU of the first board and how to avoid the same behaviour on the second bootloader?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It seems all works perfectly, except SWD lines, even when entering NXP ROM bootloader.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 15:36:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1455794#M48719</guid>
      <dc:creator>giusloq</dc:creator>
      <dc:date>2022-05-10T15:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546XX: SWD Locked?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1456203#M48730</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;The offset address of ECRP is0x20:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Alice_Yang_0-1652254825669.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/179464iCE1F2894BD12C211/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Alice_Yang_0-1652254825669.png" alt="Alice_Yang_0-1652254825669.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the returned value of ERASE command, I think you configure the ECRP or OTP .About ECRP, config it in image at offset 0x20. OTP, there is OTP API, detail you can refer to "Chapter 46: LPC546xx One-Time Programmable (OTP)".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Alice&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 07:53:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1456203#M48730</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2022-05-11T07:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546XX: SWD Locked?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1456505#M48735</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;The offset address of ECRP is 0x20:&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Even ECRP word at address 0x20 is 0:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;R 32 4&lt;BR /&gt;0&lt;BR /&gt;00 00 00 00   &amp;lt;- binary&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;I never wrote to OTP memory (at least intentionally), so if I understood well, CRP_ALLOW_ZERO bit is 0, so ECRP=0 is interpreted as:&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;All protections enabled by ECRP field will be set to lowest protection level. So, flash ECRP value is interpreted as SWD, ISP&amp;nbsp;entry, IAP entry, write and erase of all flash sectors are allowed.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So SWD should be enabled.&lt;/P&gt;&lt;P&gt;I don't think I wrote OTP memory unintentionally, because I should had used OTP API, so I should had called otpInit() and other similar functions. There isn't any of this in my code.&lt;/P&gt;&lt;P&gt;Is there any way to read OTP memory with UART ISP?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 14:31:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1456505#M48735</guid>
      <dc:creator>giusloq</dc:creator>
      <dc:date>2022-05-11T14:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546XX: SWD Locked?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1457041#M48744</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Try to read the&amp;nbsp;address 0x4001 5030.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 07:25:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1457041#M48744</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2022-05-12T07:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546XX: SWD Locked?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1457313#M48750</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Try to read the&amp;nbsp;address 0x4001 5030.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Here it is&lt;/P&gt;&lt;PRE&gt;R 1073827888 4&lt;BR /&gt;14&lt;/PRE&gt;&lt;P&gt;The error 14 should be&amp;nbsp;ERR_ISP_ADDR_NOT_MAPPED:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Address is not mapped in the memory map. Count value is taken into&lt;BR /&gt;consideration where applicable.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It seems it isn't possible to read OTP memory from ISP UART commands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, how OTP could be written if I never used OTP API in my code? Is there another way to write OPT memory?&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 14:14:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1457313#M48750</guid>
      <dc:creator>giusloq</dc:creator>
      <dc:date>2022-05-12T14:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546XX: SWD Locked?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1458976#M48783</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Do you use blhost program image, or other programmer?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe write the OTP part by mistake ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Alice&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 04:04:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1458976#M48783</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2022-05-17T04:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546XX: SWD Locked?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1459215#M48790</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Do you use blhost program image, or other programmer?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;I never used blhost application, sincerely I don't know what is it. As programmer I use JLink.&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Maybe write the OTP part by mistake ?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;How that is possible? I never tried to access OTP memory. I'm worried because if it happened one time in the past, it could happen again in the future.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 08:56:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1459215#M48790</guid>
      <dc:creator>giusloq</dc:creator>
      <dc:date>2022-05-17T08:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546XX: SWD Locked?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1461399#M48843</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;After confirm with design team with internal, they said&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Normally only OTP API can be used.&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 07:57:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1461399#M48843</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2022-05-20T07:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546XX: SWD Locked?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1464604#M48936</link>
      <description>&lt;P&gt;Again on another board with a different MCU from the same family: &lt;STRONG&gt;LPC54606J512BD100&lt;/STRONG&gt;!!!&lt;/P&gt;&lt;P&gt;I was developing a firmware on a custom board that mounts one LPC54606J512BD100. After some weeks working on it, now the probe (Segger J-Link) isn't able to detect the MCU. It seems SWD pins are locked.&lt;/P&gt;&lt;P&gt;The MCU seems ok, the last programmed firmware starts and the Boot ROM runs if I keep some ISP pins low at reset.&lt;/P&gt;&lt;P&gt;Two different LPC546xx MCUs (LPC54606J512BD100 and LPC54616J512BD208) on different custom boards. It can't be just a case, there's something that brings these MCUs to be a nice brick.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 08:37:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1464604#M48936</guid>
      <dc:creator>giusloq</dc:creator>
      <dc:date>2022-05-26T08:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546XX: SWD Locked?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1465917#M48955</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Do you have any demo board about lpc546xx, for example lpcxpresso54628 or lpcxpresso54608,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how about run your project on demo board?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Alice&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 03:16:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1465917#M48955</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2022-05-30T03:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546XX: SWD Locked?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1466090#M48962</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;Do you have any demo board about lpc546xx, for example lpcxpresso54628 or lpcxpresso54608,&amp;nbsp;&lt;/P&gt;&lt;P&gt;how about run your project on demo board?&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yes, I have LPCXpresso54628 EVB and I tested some code on it without problems.&lt;/P&gt;&lt;P&gt;However I don't think this issue is related to the application code in Flash. The effect is that debug probe (J-Link) isn't able to connect to the MCU through SWD pins and SWD mode is enabled by default on related pins.&lt;/P&gt;&lt;P&gt;I know the application code could disable SWD mode on the pins, but I tested this entering Bootloader in ROM (UART) pulling down ISP pins at reset.&lt;BR /&gt;ROM Bootloder doesn't disable SWD function, but my J-Link can't connect to these two MCUs even when ROM Bootloader started.&lt;/P&gt;&lt;P&gt;I think of two things:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;OTP memory was written by error and now SWD functions is disabled. However I don't have any code and I never tried to access OTP memory. Could the OTP memory be written by other means on a custom board?&lt;/LI&gt;&lt;LI&gt;SWD pins are broken, for example for ESD. On my custom boards I don't have any ESD protection. However I have other boards based on LPC17xx without ESD protections on SWD pins and I neved had these kind of problems.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Another thing. I noticed that VBAT pin was left floating on my custom board. Now I fixed the problem connecting it to VDD, but the problem is still there. Could it be the cause of SWD lock?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 07:59:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1466090#M48962</guid>
      <dc:creator>giusloq</dc:creator>
      <dc:date>2022-05-30T07:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546XX: SWD Locked?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1466359#M48969</link>
      <description>&lt;P&gt;I made some other tests.&lt;/P&gt;&lt;P&gt;I downloaded FlashMagic and I can write new firmware through UART entering ROM Bootloader by ISP pins. The application that I download works well.&lt;/P&gt;&lt;P&gt;I created an application that re-configures SWD pins as GPIO and toggles them every 1 second: it works. So it seems SWD pins aren't broken.&lt;/P&gt;&lt;P&gt;Starting from SDK example, I created an application that reads OTP memory content, specifically Bank 3 Word 0 that should be the word used for ECRP. Here it is the code I used:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    ret = OTP_Init();
    if (ret == kStatus_Success) {
        PRINTF("OTP_Init() success\r\n");

        if (OTP_EnableBankReadLock(3, kOTP_Word0, 0, kOTP_LockDontLock) != kStatus_Success) {
        	PRINTF("OTP_EnableBankReadLock() error\r\n");
        }

    	uint32_t ecrp = OTPC-&amp;gt;ECRP;
    	uint32_t user0 = OTPC-&amp;gt;USER0;
    	uint32_t user1 = OTPC-&amp;gt;USER1;
        PRINTF("ECRP: 0x%x\r\n\r\n", ecrp);
        PRINTF("USER0: 0x%x\r\n\r\n", user0);
        PRINTF("USER1: 0x%x\r\n\r\n", user1);
    } else {
        PRINTF("OTP_Init() error: %d\r\n\r\n", ret);
    }&lt;/LI-CODE&gt;&lt;P&gt;This is what I receive from UART:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;OTP ROM API driver version: 0x101
OTP_Init() success
ECRP: 0x80000001
USER0: 0x0
USER1: 0x0
&lt;/LI-CODE&gt;&lt;P&gt;I tried on a working LPCXpresso54628 EVB and I receive exactly the same info.&lt;/P&gt;&lt;P&gt;Except from a couple of reserved bits (the least and the most significant bits), all other bits are zero, so SWD should be enabled.&lt;/P&gt;&lt;P&gt;So, if OTP doesn't restrict SWD access and SWD pins work well when configured as GPIO, the question remains: why J-Link can't connect to the MCU?&lt;/P&gt;&lt;P&gt;Note that the same J-Link and cable works great with the EVB.&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 16:17:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1466359#M48969</guid>
      <dc:creator>giusloq</dc:creator>
      <dc:date>2022-05-30T16:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546XX: SWD Locked?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1468095#M49011</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;If the same image can work well on EVK board, while there is issue with custom board, I think&amp;nbsp;&lt;/P&gt;
&lt;P&gt;maybe it is the hardware board issue, please refer to SCH of EVK board to check.&lt;/P&gt;
&lt;P&gt;Also check your SWD design refer to:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Design-Considerations-for-Debug/m-p/469565" target="_blank"&gt;https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Design-Considerations-for-Debug/m-p/469565&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Alice&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 08:19:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1468095#M49011</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2022-06-02T08:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546XX: SWD Locked?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1469012#M49034</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;If the same image can work well on EVK board, while there is issue with custom board, I think&amp;nbsp;maybe it is the hardware board issue, please refer to SCH of EVK board to check.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;My schematic is very similar to the one of EVB. Moreover, initially the board worked well and I was able to program and debug through SWD and J-Link. This means there aren't critical issues with my custom board.&lt;/P&gt;&lt;P&gt;The problem arised during development after some days. I don't know what happened, the last solution is that SWD port broke for some reason (ESD?), but only for the SWD functionality, because SWD pins work well when configured as GPIO.&lt;/P&gt;&lt;P&gt;Is this possible? The strange thing is that this happened two times for two completely different custom boards and two different MCUs from LPC546XX series.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Also check your SWD design refer to:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Design-Considerations-for-Debug/m-p/469565" target="_blank" rel="noopener"&gt;https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Design-Considerations-for-Debug/m-p/469565&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;I checked it many times, there's no problem with that.&lt;/P&gt;&lt;P&gt;Here it is my schematic related to SWD.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxp1.png" style="width: 584px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/182255i6BEED1C742A121A6/image-size/large?v=v2&amp;amp;px=999" role="button" title="nxp1.png" alt="nxp1.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxp2.png" style="width: 813px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/182256iA9D3036881D1330A/image-size/large?v=v2&amp;amp;px=999" role="button" title="nxp2.png" alt="nxp2.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxp3.png" style="width: 428px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/182257iF12D2DB9C264E54E/image-size/large?v=v2&amp;amp;px=999" role="button" title="nxp3.png" alt="nxp3.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jun 2022 21:27:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1469012#M49034</guid>
      <dc:creator>giusloq</dc:creator>
      <dc:date>2022-06-05T21:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546XX: SWD Locked?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1469115#M49038</link>
      <description>&lt;P&gt;Hello ,&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;I downloaded FlashMagic and I can write new firmware through UART entering ROM Bootloader by ISP pins.&lt;/SPAN&gt;"&lt;/P&gt;
&lt;P&gt;-&amp;gt;&amp;gt; It can download new image from ISP, so it must can erase all.&amp;nbsp; Try to erase , then debug again.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a thread about "&lt;FONT size="4"&gt;&lt;SPAN class="lia-link-navigation lia-link-disabled"&gt;Regaining debug access to target MCU&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;"&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Regaining-debug-access-to-target-MCU/m-p/473923" target="_blank"&gt;https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Regaining-debug-access-to-target-MCU/m-p/473923&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Alice&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 04:33:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1469115#M49038</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2022-06-06T04:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546XX: SWD Locked?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1472170#M49127</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Try to erase , then debug again.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Yes, I already tried. FlashMagic is able to erase, write and read internal MCU Flash memory without problems. After erasing all sectors (and checking with Blank Check option), I tried to connect by J-Link without success. Even after a power cycle.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 09:45:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1472170#M49127</guid>
      <dc:creator>giusloq</dc:creator>
      <dc:date>2022-06-10T09:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546XX: SWD Locked?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1472174#M49128</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;There is a thread about "&lt;FONT size="4"&gt;&lt;SPAN class=""&gt;Regaining debug access to target MCU&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;"&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Regaining-debug-access-to-target-MCU/m-p/473923" target="_blank" rel="noopener"&gt;https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Regaining-debug-access-to-target-MCU/m-p/473923&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I followed exactly what that post suggests. I can enter ISP UART mode without any problem, but the debugger can't see the MCU on SWD bus.&lt;/P&gt;&lt;P&gt;Moreover i couldn't find any "Vector catch" option in the debug launch configuration.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 09:51:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1472174#M49128</guid>
      <dc:creator>giusloq</dc:creator>
      <dc:date>2022-06-10T09:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: LPC546XX: SWD Locked?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1472604#M49136</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;After the above analysis, I think the issue should be hardware, how about try do not add external pull-up resistor, because this is internal pull-up:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Alice_Yang_1-1655094281790.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/183069iDD9B4BC6ABCB8E6C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Alice_Yang_1-1655094281790.png" alt="Alice_Yang_1-1655094281790.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Alice_Yang_0-1655094121769.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/183068i282135F42FEF0036/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Alice_Yang_0-1655094121769.png" alt="Alice_Yang_0-1655094121769.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You also can try to connect the SWD pins to LPCxpresso54628 EVK board, then connect debugger with EVK board, to debug your own chip to test.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Alice&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 04:27:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC546XX-SWD-Locked/m-p/1472604#M49136</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2022-06-13T04:27:10Z</dc:date>
    </item>
  </channel>
</rss>

