<?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>i.MX RT Crossover MCUs中的主题 Re: When encryption is enabled, static std::map cause BEE read violation on i.MX RT1052</title>
    <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/When-encryption-is-enabled-static-std-map-cause-BEE-read/m-p/1534316#M21936</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/206079"&gt;@cup-a-coffee&lt;/a&gt;&amp;nbsp;，&lt;BR /&gt;Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.&lt;BR /&gt;According to your statement, it seems like the definition of the above map object causes a hard fault when enabling the XIP encryption mode for RT1050, but it works well on a normal boot of RT1050, is my understanding right?&lt;BR /&gt;If yes, I was wondering if you can illustrate the steps of replicating the phenomenon, further, upload the related demo code.Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;
&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
    <pubDate>Sun, 09 Oct 2022 02:59:22 GMT</pubDate>
    <dc:creator>jeremyzhou</dc:creator>
    <dc:date>2022-10-09T02:59:22Z</dc:date>
    <item>
      <title>When encryption is enabled, static std::map cause BEE read violation on i.MX RT1052</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/When-encryption-is-enabled-static-std-map-cause-BEE-read/m-p/1533443#M21903</link>
      <description>&lt;P&gt;In our code, we have constant map object like below:&lt;/P&gt;&lt;PRE&gt;static const std::map&amp;lt;const uint32_t, const uint32_t&amp;gt; map =&lt;BR /&gt;{&lt;BR /&gt;    {1, 1},&lt;BR /&gt;    {2, 2}&lt;BR /&gt;};&lt;/PRE&gt;&lt;P&gt;It is initialized by __libc_init_array() before calling main()&lt;BR /&gt;When MCU initializes the std::map, a hard fault occurs. At this time, the BEE state was 0x8104&lt;/P&gt;&lt;P&gt;However, when I disable the BEE, MCU works fine with std::map.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Questions&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Why does this cause a hard fault with a non-zero BEE state when encryption is enabled?&lt;/LI&gt;&lt;LI&gt;How can I use this std::map + enabled encryption + prevent the hard fault with non-zero BEE state?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 14:22:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/When-encryption-is-enabled-static-std-map-cause-BEE-read/m-p/1533443#M21903</guid>
      <dc:creator>cup-a-coffee</dc:creator>
      <dc:date>2022-10-06T14:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: When encryption is enabled, static std::map cause BEE read violation on i.MX RT1052</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/When-encryption-is-enabled-static-std-map-cause-BEE-read/m-p/1534316#M21936</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/206079"&gt;@cup-a-coffee&lt;/a&gt;&amp;nbsp;，&lt;BR /&gt;Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.&lt;BR /&gt;According to your statement, it seems like the definition of the above map object causes a hard fault when enabling the XIP encryption mode for RT1050, but it works well on a normal boot of RT1050, is my understanding right?&lt;BR /&gt;If yes, I was wondering if you can illustrate the steps of replicating the phenomenon, further, upload the related demo code.Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;
&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Sun, 09 Oct 2022 02:59:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/When-encryption-is-enabled-static-std-map-cause-BEE-read/m-p/1534316#M21936</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2022-10-09T02:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: When encryption is enabled, static std::map cause BEE read violation on i.MX RT1052</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/When-encryption-is-enabled-static-std-map-cause-BEE-read/m-p/1733829#M27094</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We are experiencing the same issue that you have explained in yor post and I wonder if you have find any solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Adde&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 15:59:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/When-encryption-is-enabled-static-std-map-cause-BEE-read/m-p/1733829#M27094</guid>
      <dc:creator>adde_ado</dc:creator>
      <dc:date>2023-10-04T15:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: When encryption is enabled, static std::map cause BEE read violation on i.MX RT1052</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/When-encryption-is-enabled-static-std-map-cause-BEE-read/m-p/2017117#M32963</link>
      <description>&lt;P&gt;I have the same problem.&lt;/P&gt;&lt;P&gt;We also create a struct using cpp.&lt;BR /&gt;The compiler generates a&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;ldmia&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;instruction to load the constant values from flash.&lt;BR /&gt;Which are then used to initialize the struct.&lt;/P&gt;&lt;P&gt;This in combination with an enabled BEE causes a hard fault.&lt;/P&gt;&lt;P&gt;We where able to recreate the problem with two ASM instructions.&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;__asm __volatile ("\
    		ldr r5,=0x7001fb68 \n\
    		ldmia r5!, {r0, r1, r2, r3}");&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;In our case we use the IMX1064.&lt;/P&gt;&lt;P&gt;Side note:&lt;BR /&gt;We have used a number of values for R5.&lt;BR /&gt;0x7001fb60&lt;BR /&gt;0x7001fb64&lt;BR /&gt;0x7001fb68 &amp;lt;- this value cause problems.&lt;BR /&gt;0x7001fb6C&lt;BR /&gt;The others do not cause problems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 09:49:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/When-encryption-is-enabled-static-std-map-cause-BEE-read/m-p/2017117#M32963</guid>
      <dc:creator>gvisser</dc:creator>
      <dc:date>2024-12-19T09:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: When encryption is enabled, static std::map cause BEE read violation on i.MX RT1052</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/When-encryption-is-enabled-static-std-map-cause-BEE-read/m-p/2017272#M32965</link>
      <description>&lt;P&gt;We have found the solution:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.nxp.com/docs/en/errata/IMXRT1064CE_B.pdf" target="_blank"&gt;https://www.nxp.com/docs/en/errata/IMXRT1064CE_B.pdf&lt;/A&gt;&lt;BR /&gt;ERR050164 says the BEE does not like unaligned access.&lt;/P&gt;&lt;P&gt;The ResetISR will call __libc_init_array before main.&lt;BR /&gt;In the default project main has a function BOARD_ConfigMPU which will enable the cache.&lt;BR /&gt;However objects which are static const will be initialized in __libc_init_array.&lt;BR /&gt;Which is before the cache is enabled.&lt;BR /&gt;Thus is it possible for the code to access the storage with a address which is not 16-bytes aligned.&lt;/P&gt;&lt;P&gt;The solution is to enable the cache before the object is initialized.&lt;BR /&gt;So enable the cache in ResetISR before __libc_init_array.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 14:41:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/When-encryption-is-enabled-static-std-map-cause-BEE-read/m-p/2017272#M32965</guid>
      <dc:creator>gvisser</dc:creator>
      <dc:date>2024-12-19T14:41:19Z</dc:date>
    </item>
  </channel>
</rss>

