<?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 I do not allow reading flash memory through code. in S32K</title>
    <link>https://community.nxp.com/t5/S32K/I-do-not-allow-reading-flash-memory-through-code/m-p/2115987#M49869</link>
    <description>&lt;P&gt;I design by S32k144.&lt;/P&gt;&lt;P&gt;I do not allow reading flash memory through code.&lt;/P&gt;&lt;P&gt;for example:&lt;/P&gt;&lt;P&gt;uint32_t address = 0x0;&lt;/P&gt;&lt;P&gt;uint32_t data = *(uint32_t *)address;&lt;/P&gt;&lt;P&gt;After setting，this operation will be illegal and the read data can not be the real.&lt;/P&gt;&lt;P&gt;But I do not know how to realize it, do you have any solutions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Jun 2025 08:40:19 GMT</pubDate>
    <dc:creator>pangyun</dc:creator>
    <dc:date>2025-06-13T08:40:19Z</dc:date>
    <item>
      <title>I do not allow reading flash memory through code.</title>
      <link>https://community.nxp.com/t5/S32K/I-do-not-allow-reading-flash-memory-through-code/m-p/2115987#M49869</link>
      <description>&lt;P&gt;I design by S32k144.&lt;/P&gt;&lt;P&gt;I do not allow reading flash memory through code.&lt;/P&gt;&lt;P&gt;for example:&lt;/P&gt;&lt;P&gt;uint32_t address = 0x0;&lt;/P&gt;&lt;P&gt;uint32_t data = *(uint32_t *)address;&lt;/P&gt;&lt;P&gt;After setting，this operation will be illegal and the read data can not be the real.&lt;/P&gt;&lt;P&gt;But I do not know how to realize it, do you have any solutions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jun 2025 08:40:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/I-do-not-allow-reading-flash-memory-through-code/m-p/2115987#M49869</guid>
      <dc:creator>pangyun</dc:creator>
      <dc:date>2025-06-13T08:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: I do not allow reading flash memory through code.</title>
      <link>https://community.nxp.com/t5/S32K/I-do-not-allow-reading-flash-memory-through-code/m-p/2116178#M49878</link>
      <description>&lt;P style="display: block; font-weight: 400; margin: 8px 0px 4px; overflow-wrap: break-word; color: #d6d6d6; font-family: 'Segoe Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: #242424; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-darkreader-inline-color="" data-darkreader-inline-bgcolor=""&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style="font-weight: 600;"&gt;MPU&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;can be configured to restrict access to memory regions, including flash.&lt;/P&gt;
&lt;UL style="margin: 4px 0px; padding-inline: 24px 0px; box-sizing: border-box; list-style-type: disc; color: #d6d6d6; font-family: 'Segoe Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: #242424; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-darkreader-inline-color="" data-darkreader-inline-bgcolor=""&gt;
&lt;LI style="padding-inline-start: 4px;"&gt;
&lt;P style="display: block; font-weight: 400; margin: 0px 0px 8px; overflow-wrap: break-word;"&gt;&lt;STRONG style="font-weight: 600;"&gt;Steps:&lt;/STRONG&gt;&lt;/P&gt;
&lt;OL style="margin: -8px 0px 0px; padding-inline: 24px 0px; box-sizing: border-box; padding-bottom: 8px;"&gt;
&lt;LI style="padding-inline-start: 4px;"&gt;Enable the MPU.&lt;/LI&gt;
&lt;LI style="padding-inline-start: 4px;"&gt;Define a region covering the flash area.&lt;/LI&gt;
&lt;LI style="padding-inline-start: 4px;"&gt;Set access permissions to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style="font-weight: 600;"&gt;no access&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;or&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style="font-weight: 600;"&gt;execute-only&lt;/STRONG&gt;.&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 13 Jun 2025 14:48:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/I-do-not-allow-reading-flash-memory-through-code/m-p/2116178#M49878</guid>
      <dc:creator>davidtosenovjan</dc:creator>
      <dc:date>2025-06-13T14:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: I do not allow reading flash memory through code.</title>
      <link>https://community.nxp.com/t5/S32K/I-do-not-allow-reading-flash-memory-through-code/m-p/2122046#M50190</link>
      <description>&lt;P&gt;Now,I want to set the address(0~0x77fff) unreadable.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pangyun_0-1750754639157.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/344324i40F66C908A0897BF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pangyun_0-1750754639157.png" alt="pangyun_0-1750754639157.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pangyun_1-1750754666963.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/344325iDB0155E73D741674/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pangyun_1-1750754666963.png" alt="pangyun_1-1750754666963.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pangyun_2-1750754682557.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/344326i66F48A8386108585/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pangyun_2-1750754682557.png" alt="pangyun_2-1750754682557.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pangyun_3-1750754698829.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/344327i31A78D2CC1968E68/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pangyun_3-1750754698829.png" alt="pangyun_3-1750754698829.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pangyun_4-1750754715209.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/344328i67225B68AAAC6DD0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pangyun_4-1750754715209.png" alt="pangyun_4-1750754715209.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;s32k144&amp;nbsp;&amp;nbsp; debug flash&lt;/P&gt;&lt;P&gt;code 1:&lt;/P&gt;&lt;P&gt;#define ADDRESS_PROTECT 0x0000U&lt;/P&gt;&lt;P&gt;(void)MPU_EnableRegion(&amp;amp;mpu_pal_config_1_Instance, 2U, true);&lt;/P&gt;&lt;P&gt;&amp;nbsp; test = *((uint32_t *)ADDRESS_PROTECT);&lt;/P&gt;&lt;P&gt;Like this, It can be OK.&lt;/P&gt;&lt;P&gt;code 2:&lt;/P&gt;&lt;P&gt;(void)MPU_EnableRegion(&amp;amp;mpu_pal_config_1_Instance, 2U, false);&lt;/P&gt;&lt;P&gt;&amp;nbsp; //test = *((uint32_t *)ADDRESS_PROTECT);&lt;/P&gt;&lt;P&gt;it is always in "void HardFault_Handler(void)", I can't understand this, because I don't read any address,It should be normal,but it's not,why?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 08:53:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/I-do-not-allow-reading-flash-memory-through-code/m-p/2122046#M50190</guid>
      <dc:creator>pangyun</dc:creator>
      <dc:date>2025-06-24T08:53:17Z</dc:date>
    </item>
  </channel>
</rss>

