<?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 ECRP codeprotect simulation on LPC5526 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/ECRP-codeprotect-simulation-on-LPC5526/m-p/1613232#M51882</link>
    <description>&lt;P&gt;Unit now i only used NXP controllers with single bit or multi-bit ECRP code protection.&lt;/P&gt;&lt;P&gt;It seems the LPC5526 (non S) is very different and to me a little confusing at the moment.&lt;BR /&gt;I just want to lock out (all debug) options through the SWD port and readout/update through the serial UART port.&amp;nbsp; Full erase (uart) would be nice but ONLY if it also erases the full protection (and that seems to be not true, leaving the unit bricked/un-programmable)&lt;/P&gt;&lt;P&gt;The device has to have an option to update through the serial port (ISP) after protect, so i want to reverse the protection&lt;/P&gt;&lt;P&gt;Idea now is to lock the device after testing under program control (done by my internally firmware) (EnableFlashProtect ) and have an option to unlock the complete device&amp;nbsp; after having received the right challenge response key (done by my internally firmware) (DisableFlashProtect )&lt;/P&gt;&lt;P&gt;Can this be done? (meaning protection is not OTP)&lt;/P&gt;&lt;P&gt;&amp;nbsp;NXP has a demo with a DisableFlashProtect and EnableFlashProtect part.&lt;BR /&gt;difference between both is (disable):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;	/* Clean-up CMPA area */
	g_CMPAData[4] = 0; // 4 and 5 must clean same time
	g_CMPAData[5] = 0;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and (enable)&amp;nbsp; (comment is source seems different from real value!):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;	//                                    Erase Dis  - ISP Dis - JTAG Dis - DGBEN Dis - NIDEN
	uint16_t CMPAData        = 0x0000; // (0 &amp;lt;&amp;lt; 8  | (1 &amp;lt;&amp;lt; 6) | (1 &amp;lt;&amp;lt; 4) | (1 &amp;lt;&amp;lt; 1) | (1 &amp;lt;&amp;lt; 0);
	uint16_t CMPADataReverse = ~CMPAData;

	uint32_t CMPALockData = (CMPADataReverse&amp;lt;&amp;lt;16)|(CMPAData);
	g_CMPAData[4] = CMPALockData;  // 4 and 5 must set as same value
	g_CMPAData[5] = CMPALockData;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this all we have to set and reset?&lt;BR /&gt;Looking at the values above it makes no sense, in the unprotect version the low value is 0 and the inversed high part is also 0. The protect version also writes (low) 0&amp;nbsp; and does the inversed high part.&lt;/P&gt;&lt;P&gt;Secondly in an other post i found that the above is only for SWD? and not blocking the access though the UART ISP method (holding p0.5 low on startup), meaning it's "useless". For that i should change boot options?&lt;BR /&gt;Just want the ECRP compatible settings.&lt;/P&gt;&lt;P&gt;If i get it right operating this way keeps me in "Tier1" Dev mode allowing changes.&lt;/P&gt;&lt;P&gt;I also seem to be missing the bit definitions in the UM11126.pdf manual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 11 Mar 2023 09:47:29 GMT</pubDate>
    <dc:creator>bwinter</dc:creator>
    <dc:date>2023-03-11T09:47:29Z</dc:date>
    <item>
      <title>ECRP codeprotect simulation on LPC5526</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ECRP-codeprotect-simulation-on-LPC5526/m-p/1613232#M51882</link>
      <description>&lt;P&gt;Unit now i only used NXP controllers with single bit or multi-bit ECRP code protection.&lt;/P&gt;&lt;P&gt;It seems the LPC5526 (non S) is very different and to me a little confusing at the moment.&lt;BR /&gt;I just want to lock out (all debug) options through the SWD port and readout/update through the serial UART port.&amp;nbsp; Full erase (uart) would be nice but ONLY if it also erases the full protection (and that seems to be not true, leaving the unit bricked/un-programmable)&lt;/P&gt;&lt;P&gt;The device has to have an option to update through the serial port (ISP) after protect, so i want to reverse the protection&lt;/P&gt;&lt;P&gt;Idea now is to lock the device after testing under program control (done by my internally firmware) (EnableFlashProtect ) and have an option to unlock the complete device&amp;nbsp; after having received the right challenge response key (done by my internally firmware) (DisableFlashProtect )&lt;/P&gt;&lt;P&gt;Can this be done? (meaning protection is not OTP)&lt;/P&gt;&lt;P&gt;&amp;nbsp;NXP has a demo with a DisableFlashProtect and EnableFlashProtect part.&lt;BR /&gt;difference between both is (disable):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;	/* Clean-up CMPA area */
	g_CMPAData[4] = 0; // 4 and 5 must clean same time
	g_CMPAData[5] = 0;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and (enable)&amp;nbsp; (comment is source seems different from real value!):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;	//                                    Erase Dis  - ISP Dis - JTAG Dis - DGBEN Dis - NIDEN
	uint16_t CMPAData        = 0x0000; // (0 &amp;lt;&amp;lt; 8  | (1 &amp;lt;&amp;lt; 6) | (1 &amp;lt;&amp;lt; 4) | (1 &amp;lt;&amp;lt; 1) | (1 &amp;lt;&amp;lt; 0);
	uint16_t CMPADataReverse = ~CMPAData;

	uint32_t CMPALockData = (CMPADataReverse&amp;lt;&amp;lt;16)|(CMPAData);
	g_CMPAData[4] = CMPALockData;  // 4 and 5 must set as same value
	g_CMPAData[5] = CMPALockData;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this all we have to set and reset?&lt;BR /&gt;Looking at the values above it makes no sense, in the unprotect version the low value is 0 and the inversed high part is also 0. The protect version also writes (low) 0&amp;nbsp; and does the inversed high part.&lt;/P&gt;&lt;P&gt;Secondly in an other post i found that the above is only for SWD? and not blocking the access though the UART ISP method (holding p0.5 low on startup), meaning it's "useless". For that i should change boot options?&lt;BR /&gt;Just want the ECRP compatible settings.&lt;/P&gt;&lt;P&gt;If i get it right operating this way keeps me in "Tier1" Dev mode allowing changes.&lt;/P&gt;&lt;P&gt;I also seem to be missing the bit definitions in the UM11126.pdf manual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Mar 2023 09:47:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ECRP-codeprotect-simulation-on-LPC5526/m-p/1613232#M51882</guid>
      <dc:creator>bwinter</dc:creator>
      <dc:date>2023-03-11T09:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: ECRP codeprotect simulation on LPC5526</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ECRP-codeprotect-simulation-on-LPC5526/m-p/1613809#M51891</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/131765"&gt;@bwinter&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a demo about&amp;nbsp;&lt;SPAN&gt;disable SWD and ISP&amp;nbsp;, you can refer to.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;About "bit definitions in the UM11126.pdf manual.", please see excel in attachment of UM.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Alice_Yang_0-1678694896800.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/214229iDF713051918B71D5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Alice_Yang_0-1678694896800.png" alt="Alice_Yang_0-1678694896800.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 08:10:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ECRP-codeprotect-simulation-on-LPC5526/m-p/1613809#M51891</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2023-03-13T08:10:22Z</dc:date>
    </item>
  </channel>
</rss>

