<?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 CRP note in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/CRP-note/m-p/522056#M4692</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jdurand on Sun Dec 02 16:18:44 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Just something I noticed with CRP:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since we program our production parts with SWD, I can't have the CRP set since that will make programming/verification fail (per NXP app. note).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I set the CRP_WORD to -1 (0xFFFFFFFF) and since we store serial numbers in our parts, I just defined it as an INT.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;During initialization I check if the serial number is &amp;gt; 0 (blank/default would be -1), if it is it's assumed this is a production unit going out to a customer and I then use IAP to write CRP-2 over the CRP-word and then call NVIC_SystemReset(). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This works fine with one footnote:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Stepping through the code with CodeRed and a Red Probe + on an LPC1226/301 (haven't tried any other method or processor yet) after the NVIC_Reset I can STILL continue debugging the code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But, if I exit debug mode and try to re-enter, then I can't.&amp;nbsp; So, it seems the CRP_Word isn't read from a soft RESET or else it doesn't matter if the SWD is currently active.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In our case, it doesn't matter since the device will be powered off at least once before the customer gets it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One other thing that's possible, you could have some strong password on your system that would let you clear the CRP word back to -1 to re-enable debugging, if you have a need.&amp;nbsp; Or just use Flash Magic for the single purpose of erasing all of FLASH and then go back to SWD.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 16:39:09 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T16:39:09Z</dc:date>
    <item>
      <title>CRP note</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CRP-note/m-p/522056#M4692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jdurand on Sun Dec 02 16:18:44 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Just something I noticed with CRP:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since we program our production parts with SWD, I can't have the CRP set since that will make programming/verification fail (per NXP app. note).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I set the CRP_WORD to -1 (0xFFFFFFFF) and since we store serial numbers in our parts, I just defined it as an INT.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;During initialization I check if the serial number is &amp;gt; 0 (blank/default would be -1), if it is it's assumed this is a production unit going out to a customer and I then use IAP to write CRP-2 over the CRP-word and then call NVIC_SystemReset(). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This works fine with one footnote:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Stepping through the code with CodeRed and a Red Probe + on an LPC1226/301 (haven't tried any other method or processor yet) after the NVIC_Reset I can STILL continue debugging the code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But, if I exit debug mode and try to re-enter, then I can't.&amp;nbsp; So, it seems the CRP_Word isn't read from a soft RESET or else it doesn't matter if the SWD is currently active.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In our case, it doesn't matter since the device will be powered off at least once before the customer gets it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One other thing that's possible, you could have some strong password on your system that would let you clear the CRP word back to -1 to re-enable debugging, if you have a need.&amp;nbsp; Or just use Flash Magic for the single purpose of erasing all of FLASH and then go back to SWD.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:39:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CRP-note/m-p/522056#M4692</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:39:09Z</dc:date>
    </item>
  </channel>
</rss>

