<?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: locking / unlocking SWD debug on LPC550x in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/locking-unlocking-SWD-debug-on-LPC550x/m-p/1457052#M48745</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Could you please tell me where the function come from? SDK driver?&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, 12 May 2022 07:45:02 GMT</pubDate>
    <dc:creator>Alice_Yang</dc:creator>
    <dc:date>2022-05-12T07:45:02Z</dc:date>
    <item>
      <title>locking / unlocking SWD debug on LPC550x</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/locking-unlocking-SWD-debug-on-LPC550x/m-p/1451796#M48624</link>
      <description>&lt;P&gt;I found some conflicting info on how to enable/disable ISP and SWD. After some trial and error, the below appears to lock a part, but unlocking after results in a bricked device (LPC5502);&lt;/P&gt;&lt;LI-CODE lang="c"&gt;static status_t set_locked_state(cmpa_context *ctx, cmpa_cfg_info_t *buffer, bool locked) {
  // UM11424 pg. 136, table 184. ISP download mode based on DEFAULT_ISP_MODE bits (6:4, word 0 in CMPA)
  const uint32_t kISPbits = 0x70;
  // Do not follow UM11424 pg. 965, table 1000 - 1003. Debug access restriction levels
  // See AN13037 3.2.3, PIN should be 1, DFLT 0 to "debug access always disabled (pinned)"
  // Also see https://community.nxp.com/t5/LPC-Microcontrollers/CC-SOCU-DLFT-in-CMPA/m-p/1043919
  const uint32_t kDBGbitsPin = 0xFF2000DF;
  const uint32_t kDBGbitsDisable = 0xFFFF0000;
  const uint32_t kDBGbitsEnable = 0x0000FFFF;

  status_t ret = FFR_GetCustomerData(&amp;amp;ctx-&amp;gt;flash_instance, (uint8_t*)buffer, 0, CMPA_PAGE_SIZE);
  if(ret != kStatus_Success) {
    return ret;
  }

  // Always pin (no debug auth)
  buffer-&amp;gt;dcfgPin = kDBGbitsPin;

  if(locked) {
    buffer-&amp;gt;bootCfg |= kISPbits;
    buffer-&amp;gt;dcfgDflt = kDBGbitsDisable;
  } else {
    buffer-&amp;gt;bootCfg &amp;amp;= ~kISPbits;
    buffer-&amp;gt;dcfgDflt = kDBGbitsEnable;
  }
  // Don't seal
  return FFR_CustFactoryPageWrite(&amp;amp;ctx-&amp;gt;flash_instance, (uint8_t*)buffer, false);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What values should I be using instead?&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 11:36:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/locking-unlocking-SWD-debug-on-LPC550x/m-p/1451796#M48624</guid>
      <dc:creator>mmvm</dc:creator>
      <dc:date>2022-05-02T11:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: locking / unlocking SWD debug on LPC550x</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/locking-unlocking-SWD-debug-on-LPC550x/m-p/1457052#M48745</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Could you please tell me where the function come from? SDK driver?&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, 12 May 2022 07:45:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/locking-unlocking-SWD-debug-on-LPC550x/m-p/1457052#M48745</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2022-05-12T07:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: locking / unlocking SWD debug on LPC550x</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/locking-unlocking-SWD-debug-on-LPC550x/m-p/1462199#M48862</link>
      <description>&lt;P&gt;Hi Alice,&lt;/P&gt;&lt;P&gt;Apologies, I was unavailable for a bit. What function do you mean? The snippet is my code, FFR_GetCustomerData is in fsl_iap_ffr.h.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 07:03:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/locking-unlocking-SWD-debug-on-LPC550x/m-p/1462199#M48862</guid>
      <dc:creator>mmvm</dc:creator>
      <dc:date>2022-05-23T07:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: locking / unlocking SWD debug on LPC550x</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/locking-unlocking-SWD-debug-on-LPC550x/m-p/1462356#M48873</link>
      <description>&lt;P&gt;Hello ,&lt;/P&gt;
&lt;P&gt;About disable ISP and SWD, you can refer to attachment, this is from SE team.&lt;/P&gt;
&lt;P&gt;About unlock, it seems need erase CMPA if can enter ISP mode.&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, 23 May 2022 09:59:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/locking-unlocking-SWD-debug-on-LPC550x/m-p/1462356#M48873</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2022-05-23T09:59:59Z</dc:date>
    </item>
  </channel>
</rss>

