<?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 &amp;quot;Flash_VerifyErase&amp;quot; does not work on PRINCE regions in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/quot-Flash-VerifyErase-quot-does-not-work-on-PRINCE-regions/m-p/1225654#M43838</link>
    <description>&lt;P&gt;I have been using Flash_VerifyErase() to ensure I do not read an erased flash page and cause a hard fault. This has been working reliably until I turned on PRINCE flash encryption.&lt;/P&gt;&lt;P&gt;For some reason, Flash_VerifyErase() does not detect an erased region of PRINCE flash and causes a hard fault when I perform a read. The function Flash_read() does not appear to work, so as it stands I do not have a way to ensure I do not hard fault while reading Flash.&lt;/P&gt;&lt;P&gt;Is there a different function for detecting PRINCE erase? How can I prevent hard faulting when PRINCE is enabled?&lt;/P&gt;</description>
    <pubDate>Wed, 03 Feb 2021 15:14:59 GMT</pubDate>
    <dc:creator>awseiger</dc:creator>
    <dc:date>2021-02-03T15:14:59Z</dc:date>
    <item>
      <title>"Flash_VerifyErase" does not work on PRINCE regions</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/quot-Flash-VerifyErase-quot-does-not-work-on-PRINCE-regions/m-p/1225654#M43838</link>
      <description>&lt;P&gt;I have been using Flash_VerifyErase() to ensure I do not read an erased flash page and cause a hard fault. This has been working reliably until I turned on PRINCE flash encryption.&lt;/P&gt;&lt;P&gt;For some reason, Flash_VerifyErase() does not detect an erased region of PRINCE flash and causes a hard fault when I perform a read. The function Flash_read() does not appear to work, so as it stands I do not have a way to ensure I do not hard fault while reading Flash.&lt;/P&gt;&lt;P&gt;Is there a different function for detecting PRINCE erase? How can I prevent hard faulting when PRINCE is enabled?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 15:14:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/quot-Flash-VerifyErase-quot-does-not-work-on-PRINCE-regions/m-p/1225654#M43838</guid>
      <dc:creator>awseiger</dc:creator>
      <dc:date>2021-02-03T15:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: "Flash_VerifyErase" does not work on PRINCE regions</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/quot-Flash-VerifyErase-quot-does-not-work-on-PRINCE-regions/m-p/1226125#M43843</link>
      <description>&lt;P&gt;Hi, Alexander,&lt;/P&gt;
&lt;P&gt;Can you tell us the part number you are using? Do you use LPC55xx family?&lt;/P&gt;
&lt;P&gt;Anyway, I suggest you refer to AN12527.pdf and AN12527SW.zip which can be downloaded from the following link:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc5500-cortex-m33/high-efficiency-arm-cortex-m33-based-microcontroller-family:LPC55S6x?tab=Documentation_Tab" target="_blank"&gt;https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc5500-cortex-m33/high-efficiency-arm-cortex-m33-based-microcontroller-family:LPC55S6x?tab=Documentation_Tab&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you still have issue, pls post all your code so that we can have a review.&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Xiangjun Rong&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 06:09:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/quot-Flash-VerifyErase-quot-does-not-work-on-PRINCE-regions/m-p/1226125#M43843</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2021-02-04T06:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: "Flash_VerifyErase" does not work on PRINCE regions</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/quot-Flash-VerifyErase-quot-does-not-work-on-PRINCE-regions/m-p/1226577#M43850</link>
      <description>&lt;P&gt;Yes, this is for the LPC55S69, version 1B silicon - sorry I forgot that information before!&lt;/P&gt;&lt;P&gt;Please see my code, attached below. The commented portion is the recommended way to do Flash reads, but this section of code no longer works when PRINCE is enabled. Before I enabled PRINCE, I had this commented block inside the "else if" where the memcpy now lives.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;	status_t status = FLASH_VerifyErase(&amp;amp;flash_instance, addr, PflashPageSize);

	if(status == kStatus_Success)
	{
		memset(data, 0xFF, len);
		return len;
	}
	else if(status == kStatus_FLASH_CommandFailure)
	{
		memcpy(data, (void*)addr, len);
	}
	else
	{
		return -1;
	}

//	status = FLASH_Read(&amp;amp;flash_instance, addr, data, len);
//
//	if(status == kStatus_FLASH_EccError)
//	{
//		memset(data, 0xFF, len);
//		return len;
//	}
//	else if(status != kStatus_Success)
//	{
//		return -1;
//	}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 04 Feb 2021 18:40:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/quot-Flash-VerifyErase-quot-does-not-work-on-PRINCE-regions/m-p/1226577#M43850</guid>
      <dc:creator>awseiger</dc:creator>
      <dc:date>2021-02-04T18:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: "Flash_VerifyErase" does not work on PRINCE regions</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/quot-Flash-VerifyErase-quot-does-not-work-on-PRINCE-regions/m-p/2137982#M58525</link>
      <description>&lt;P&gt;I have the same problem. How can I safely read an encrypted flash page?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jul 2025 05:59:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/quot-Flash-VerifyErase-quot-does-not-work-on-PRINCE-regions/m-p/2137982#M58525</guid>
      <dc:creator>keepcoding</dc:creator>
      <dc:date>2025-07-22T05:59:50Z</dc:date>
    </item>
  </channel>
</rss>

