<?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>LPC Microcontrollers中的主题 Re: LPC552x: How to write CMPA to disable debug subdomains from application?</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Re-LPC552x-How-to-write-CMPA-to-disable-debug-subdomains-from/m-p/1280460#M45114</link>
    <description>&lt;P&gt;------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;Comment moved on behalf of&amp;nbsp;&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/97802"&gt;@andrewfisher&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This comment was a follow up with questions regarding this post:&amp;nbsp;&lt;FONT size="3"&gt;&lt;A href="https://community.nxp.com/t5/LPC-Microcontrollers/LPC552x-How-to-write-CMPA-to-disable-debug-subdomains-from/m-p/1248237" target="_self"&gt;&lt;STRONG&gt;LPC552x: How to write CMPA to disable debug subdomains from application?&lt;/STRONG&gt;&lt;/A&gt;&amp;nbsp; The authors of this post shared the code that they used&amp;nbsp; to disable debug subdomains.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;---------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;There seems to be something wrong in this example.&lt;/P&gt;
&lt;P&gt;The disable protection (full access) code simply writes 0x00000000 into the CMPA DCFG_CC_SOCU_PIN register and DCFG_CC_SOCU_DFLT registers. As far as I can see from the UM11126.pdf (pg 1135) The top 16 bits should always be the inverse of the bottom 16. I guess this may work (as it seems to be the way the chip is shipped) but is not as documented.&lt;/P&gt;
&lt;P&gt;The enable protection code places 0xffff0000 into both registers which as far as I can see selects the option to enable debug if authentication has taken place. It is not a full full enabling of protection.&lt;/P&gt;
&lt;P&gt;So it looks to me (based on pg1134/5 in the user manual) that these should be the values (though what to do with reserved bits is unclear)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;// Ful disable (top 16 bits = inverse of bottom 16 bits)
DCFG_CC_SOCU_PIN  = 0xfd0002ff;
DCFG_CC_SOCU_DFLT = 0xfd0002ff;

// Authenticated access only (top 16 bits = inverse of bottom 16 bits)
DCFG_CC_SOCU_PIN  = 0xffff0000;
DCFG_CC_SOCU_DFLT = 0xffff0000;

// Full access (top 16 bits = inverse of bottom 16 bits)
DCFG_CC_SOCU_PIN  = 0xfd0002ff;
DCFG_CC_SOCU_DFLT = 0xffff0000;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In addition to this I can't find anywhere that actually explains HOW to use the debugger to authenticate when in this mode. Where do the certificates go in the MCUXpresso IDE etc?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is all very worrying when the documentation is not completely clear (there are quite a few fields in the CMPA and CFPA with no documentation I can find) and one wrong step can brick the device.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 24 May 2021 18:26:09 GMT</pubDate>
    <dc:creator>andrewfisher</dc:creator>
    <dc:date>2021-05-24T18:26:09Z</dc:date>
    <item>
      <title>Re: LPC552x: How to write CMPA to disable debug subdomains from application?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Re-LPC552x-How-to-write-CMPA-to-disable-debug-subdomains-from/m-p/1280460#M45114</link>
      <description>&lt;P&gt;------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;Comment moved on behalf of&amp;nbsp;&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/97802"&gt;@andrewfisher&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This comment was a follow up with questions regarding this post:&amp;nbsp;&lt;FONT size="3"&gt;&lt;A href="https://community.nxp.com/t5/LPC-Microcontrollers/LPC552x-How-to-write-CMPA-to-disable-debug-subdomains-from/m-p/1248237" target="_self"&gt;&lt;STRONG&gt;LPC552x: How to write CMPA to disable debug subdomains from application?&lt;/STRONG&gt;&lt;/A&gt;&amp;nbsp; The authors of this post shared the code that they used&amp;nbsp; to disable debug subdomains.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;---------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;There seems to be something wrong in this example.&lt;/P&gt;
&lt;P&gt;The disable protection (full access) code simply writes 0x00000000 into the CMPA DCFG_CC_SOCU_PIN register and DCFG_CC_SOCU_DFLT registers. As far as I can see from the UM11126.pdf (pg 1135) The top 16 bits should always be the inverse of the bottom 16. I guess this may work (as it seems to be the way the chip is shipped) but is not as documented.&lt;/P&gt;
&lt;P&gt;The enable protection code places 0xffff0000 into both registers which as far as I can see selects the option to enable debug if authentication has taken place. It is not a full full enabling of protection.&lt;/P&gt;
&lt;P&gt;So it looks to me (based on pg1134/5 in the user manual) that these should be the values (though what to do with reserved bits is unclear)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;// Ful disable (top 16 bits = inverse of bottom 16 bits)
DCFG_CC_SOCU_PIN  = 0xfd0002ff;
DCFG_CC_SOCU_DFLT = 0xfd0002ff;

// Authenticated access only (top 16 bits = inverse of bottom 16 bits)
DCFG_CC_SOCU_PIN  = 0xffff0000;
DCFG_CC_SOCU_DFLT = 0xffff0000;

// Full access (top 16 bits = inverse of bottom 16 bits)
DCFG_CC_SOCU_PIN  = 0xfd0002ff;
DCFG_CC_SOCU_DFLT = 0xffff0000;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In addition to this I can't find anywhere that actually explains HOW to use the debugger to authenticate when in this mode. Where do the certificates go in the MCUXpresso IDE etc?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is all very worrying when the documentation is not completely clear (there are quite a few fields in the CMPA and CFPA with no documentation I can find) and one wrong step can brick the device.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 18:26:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Re-LPC552x-How-to-write-CMPA-to-disable-debug-subdomains-from/m-p/1280460#M45114</guid>
      <dc:creator>andrewfisher</dc:creator>
      <dc:date>2021-05-24T18:26:09Z</dc:date>
    </item>
  </channel>
</rss>

