<?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 Re: Can't read Secure Region with Segger J-Link on LPC55S69-EVK in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Can-t-read-Secure-Region-with-Segger-J-Link-on-LPC55S69-EVK/m-p/941098#M37505</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just in case anyone else runs into this, I probed the underlying SWD transaction figured it out. SEGGER JLink looks like it's masking out the secure bit (bit 28) so an access to 0x3000.0000 gets issued out over the wire as an access to 0x2000.0000 causing a fault.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem can be worked around by disabling the SAU while debugging, i.e&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Try to read&lt;/P&gt;&lt;P&gt;(gdb) x/a 0x30000000&lt;BR /&gt;0x30000000 &amp;lt;SystemCoreClock&amp;gt;:&amp;nbsp;&amp;nbsp; &amp;nbsp;Cannot access memory at address 0x30000000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// put processor in secure mode&lt;/P&gt;&lt;P&gt;(gdb) set *(uint32_t*)0xE000EE08=0x10000&lt;/P&gt;&lt;P&gt;// disable SAU&lt;/P&gt;&lt;P&gt;(gdb) set *(uint32_t*)0xE000EDD0=0x0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// read should now work&lt;/P&gt;&lt;P&gt;(gdb) x/a 0x30000000&lt;BR /&gt;0x30000000 &amp;lt;SystemCoreClock&amp;gt;:&amp;nbsp;&amp;nbsp; &amp;nbsp;0x5b8d800&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interestingly, it seems like when debugging with the LinkServer in the MCUXpresso IDE the SAU gets disabled and I don't see any logic in the code which enables the SAU. So I guess you have to fully power cycle the board when using the IDE to actually be testing the trustzone features.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Jul 2019 23:02:33 GMT</pubDate>
    <dc:creator>chris18</dc:creator>
    <dc:date>2019-07-22T23:02:33Z</dc:date>
    <item>
      <title>Can't read Secure Region with Segger J-Link on LPC55S69-EVK</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Can-t-read-Secure-Region-with-Segger-J-Link-on-LPC55S69-EVK/m-p/941097#M37504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When using SEGGER JLink, I can't seem to read memory in the secure region from GDB. For example on the hello_world_ trustzone demo app in the sdk, I always see access errors for secure regions reads&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(gdb) x/a *(uint32_t*)0x30000000&lt;BR /&gt;Cannot access memory at address 0x30000000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but non-secure regions work fine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(gdb) x/a *(uint32_t*)0x20008000&lt;BR /&gt;0x20008920:&amp;nbsp;&amp;nbsp; &amp;nbsp;0x20008898&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on how to fix this? Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jul 2019 06:09:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Can-t-read-Secure-Region-with-Segger-J-Link-on-LPC55S69-EVK/m-p/941097#M37504</guid>
      <dc:creator>chris18</dc:creator>
      <dc:date>2019-07-19T06:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can't read Secure Region with Segger J-Link on LPC55S69-EVK</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Can-t-read-Secure-Region-with-Segger-J-Link-on-LPC55S69-EVK/m-p/941098#M37505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just in case anyone else runs into this, I probed the underlying SWD transaction figured it out. SEGGER JLink looks like it's masking out the secure bit (bit 28) so an access to 0x3000.0000 gets issued out over the wire as an access to 0x2000.0000 causing a fault.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem can be worked around by disabling the SAU while debugging, i.e&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Try to read&lt;/P&gt;&lt;P&gt;(gdb) x/a 0x30000000&lt;BR /&gt;0x30000000 &amp;lt;SystemCoreClock&amp;gt;:&amp;nbsp;&amp;nbsp; &amp;nbsp;Cannot access memory at address 0x30000000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// put processor in secure mode&lt;/P&gt;&lt;P&gt;(gdb) set *(uint32_t*)0xE000EE08=0x10000&lt;/P&gt;&lt;P&gt;// disable SAU&lt;/P&gt;&lt;P&gt;(gdb) set *(uint32_t*)0xE000EDD0=0x0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// read should now work&lt;/P&gt;&lt;P&gt;(gdb) x/a 0x30000000&lt;BR /&gt;0x30000000 &amp;lt;SystemCoreClock&amp;gt;:&amp;nbsp;&amp;nbsp; &amp;nbsp;0x5b8d800&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interestingly, it seems like when debugging with the LinkServer in the MCUXpresso IDE the SAU gets disabled and I don't see any logic in the code which enables the SAU. So I guess you have to fully power cycle the board when using the IDE to actually be testing the trustzone features.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2019 23:02:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Can-t-read-Secure-Region-with-Segger-J-Link-on-LPC55S69-EVK/m-p/941098#M37505</guid>
      <dc:creator>chris18</dc:creator>
      <dc:date>2019-07-22T23:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Can't read Secure Region with Segger J-Link on LPC55S69-EVK</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Can-t-read-Secure-Region-with-Segger-J-Link-on-LPC55S69-EVK/m-p/941099#M37506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;For Secure data, it can only be read by secure code. Secure code can only be execute by CPU in secure mode.&lt;/P&gt;&lt;P&gt;Below is the summary of Trustzone memory regions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1. Secure (S) - For Secure code/data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; −Secure data can only be read by secure code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; −Secure code can only be executed by CPU in secure mode&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;2.&amp;nbsp; Non-Secure (NS) – For non-Secure code/data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; −NS Data can be accessed by both secure state and non-secure state CPU&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; −Cannot be executed by Secure code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;3 Non-Secure Callable (NSC)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; −This is a special region for NS code to branch into and execute a Secure Gateway (SG) opcode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Jun Zhang&lt;/P&gt;&lt;P&gt;&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;&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;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2019 09:04:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Can-t-read-Secure-Region-with-Segger-J-Link-on-LPC55S69-EVK/m-p/941099#M37506</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2019-07-23T09:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Can't read Secure Region with Segger J-Link on LPC55S69-EVK</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Can-t-read-Secure-Region-with-Segger-J-Link-on-LPC55S69-EVK/m-p/941100#M37507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the response. Yes, in this case I was trying to read the memory via a debugger, *not* from code running on the MCU itself. While there are restrictions on the DAP side as well, as long as Secure Debug is Enabled (DHCSR.S_SDE), I believe the debugger should be able to read the memory. As I mentioned above, the issue I ran into looks like it was due to a bug in the SEGGER JLink software. The LinkServer appears to disable the SAU entirely which isn't good for testing either. I wound up using pyOCD GDBServer because I could do reads from secure and non-secure code/data &amp;amp; it didn't appear to mess with any of the MCU state.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2019 18:09:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Can-t-read-Secure-Region-with-Segger-J-Link-on-LPC55S69-EVK/m-p/941100#M37507</guid>
      <dc:creator>chris18</dc:creator>
      <dc:date>2019-07-23T18:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Can't read Secure Region with Segger J-Link on LPC55S69-EVK</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Can-t-read-Secure-Region-with-Segger-J-Link-on-LPC55S69-EVK/m-p/941101#M37508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Chris,&lt;/P&gt;&lt;P&gt;To avoid any misunderstanding, can you make a video to show me the issue?&lt;/P&gt;&lt;P&gt;I will check it further. Thanks for your cooperation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a nice day,&lt;/P&gt;&lt;P&gt;Jun Zhang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2019 08:47:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Can-t-read-Secure-Region-with-Segger-J-Link-on-LPC55S69-EVK/m-p/941101#M37508</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2019-07-24T08:47:34Z</dc:date>
    </item>
  </channel>
</rss>

