<?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: Undefined Instruction exception when executing an mcr instruction in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Undefined-Instruction-exception-when-executing-an-mcr/m-p/286117#M33716</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you just solved my problem :smileyhappy:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Oct 2014 10:42:07 GMT</pubDate>
    <dc:creator>marcocassol</dc:creator>
    <dc:date>2014-10-28T10:42:07Z</dc:date>
    <item>
      <title>Undefined Instruction exception when executing an mcr instruction</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Undefined-Instruction-exception-when-executing-an-mcr/m-p/286115#M33714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm getting an undefined instruction exception when I call enable_neon_fpu() (from the SDK 1.1: file sdk/core/src/CortexA9.s). The exception is triggered when the processor tries to execute the 3rd instruction in the following piece of code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 11px; font-family: Menlo;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: Menlo; font-size: 11px; color: #bb2ca2;"&gt;.global&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px; font-family: Menlo;"&gt; enable_neon_fpu&lt;/SPAN&gt;&lt;P style="font-family: Menlo; font-size: 11px;"&gt;&lt;/P&gt;&lt;P style="font-family: Menlo; font-size: 11px;"&gt;&amp;nbsp; &lt;SPAN style="color: #bb2ca2;"&gt;.func&lt;/SPAN&gt; enable_neon_fpu&lt;/P&gt;&lt;P style="font-family: Menlo; font-size: 11px;"&gt;enable_neon_fpu:&lt;/P&gt;&lt;P style="font-family: Menlo; font-size: 11px; color: #008400;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&gt;/* set NSACR, both Secure and Non-secure access are allowed to NEON */&lt;/P&gt;&lt;P style="font-family: Menlo; font-size: 11px;"&gt;&amp;nbsp; MRC p15, &lt;SPAN style="color: #272ad8;"&gt;0&lt;/SPAN&gt;, r0, c1, c1, &lt;SPAN style="color: #272ad8;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Menlo; font-size: 11px; color: #008400;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; ORR r0, r0, &lt;/SPAN&gt;#(0x3&amp;lt;&amp;lt;10) @ enable fpu/neon&lt;/P&gt;&lt;P style="font-family: Menlo; font-size: 11px;"&gt;&amp;nbsp; MCR p15, &lt;SPAN style="color: #272ad8;"&gt;0&lt;/SPAN&gt;, r0, c1, c1, &lt;SPAN style="color: #272ad8;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Menlo; font-size: 11px; color: #008400;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&gt;/* Set the CPACR for access to CP10 and CP11*/&lt;/P&gt;&lt;P style="font-family: Menlo; font-size: 11px;"&gt;&amp;nbsp; LDR r0, =&lt;SPAN style="color: #272ad8;"&gt;0xF00000&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Menlo; font-size: 11px;"&gt;&amp;nbsp; MCR p15, &lt;SPAN style="color: #272ad8;"&gt;0&lt;/SPAN&gt;, r0, c1, c0, &lt;SPAN style="color: #272ad8;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Menlo; font-size: 11px; color: #008400;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&gt;/* Set the FPEXC EN bit to enable the FPU */&lt;/P&gt;&lt;P style="font-family: Menlo; font-size: 11px; color: #008400;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; MOV r3, &lt;/SPAN&gt;#0x40000000 &lt;/P&gt;&lt;P style="font-family: Menlo; font-size: 11px;"&gt;&amp;nbsp; @VMSR FPEXC, r3&lt;/P&gt;&lt;P style="font-family: Menlo; font-size: 11px;"&gt;&amp;nbsp; MCR p10, &lt;SPAN style="color: #272ad8;"&gt;7&lt;/SPAN&gt;, r3, c8, c0, &lt;SPAN style="color: #272ad8;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Menlo; font-size: 11px; color: #bb2ca2;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&gt;.endfunc&lt;/P&gt;&lt;P style="font-family: Menlo; font-size: 11px; color: #bb2ca2;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt; font-family: Menlo;"&gt;The application is a bare-metal executable which first calls platform_init() (from the SDK 1.1: file apps/common/&lt;SPAN style="color: #000000; font-family: Menlo;"&gt;platform_init&lt;/SPAN&gt;.c). &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Menlo; font-size: 10pt; line-height: 1.5em;"&gt;enable_neon_fpu() is the first SDK routine called from &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Menlo;"&gt;platform_init&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Menlo; font-size: 10pt; line-height: 1.5em;"&gt;(). The executable is loaded in the processor - an iMX6Q - using a Lauterbach USB probe and the TR32 debugger. The same &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Menlo;"&gt;binary works if I load it using an OCD compatible probe (Olimex). So I'd tend to believe that there may be an initialisation problem in the case of the Lauterbach probe. I've checked the CPSR when the exception triggers: its value is 0x600001D3 which means that the processor is in the supervisor mode.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Menlo;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Menlo;"&gt;Any idea of what could cause this exception?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Menlo;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Menlo;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Menlo;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Menlo;"&gt;Philippe&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Menlo;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Jan 2014 18:22:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Undefined-Instruction-exception-when-executing-an-mcr/m-p/286115#M33714</guid>
      <dc:creator>philippewicker</dc:creator>
      <dc:date>2014-01-04T18:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Undefined Instruction exception when executing an mcr instruction</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Undefined-Instruction-exception-when-executing-an-mcr/m-p/286116#M33715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Replying to myself :smileywink:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the help of the Lauterbach people, the exception has been fixed by clearing the NS bit in the SCR register (command register.set NS 0 in the TRACE32 start-up script). However I'm still a bit confused because the iMX6 processor is supposed to start in privileged and secure mode after a reset.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jan 2014 18:50:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Undefined-Instruction-exception-when-executing-an-mcr/m-p/286116#M33715</guid>
      <dc:creator>philippewicker</dc:creator>
      <dc:date>2014-01-06T18:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Undefined Instruction exception when executing an mcr instruction</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Undefined-Instruction-exception-when-executing-an-mcr/m-p/286117#M33716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you just solved my problem :smileyhappy:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 10:42:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Undefined-Instruction-exception-when-executing-an-mcr/m-p/286117#M33716</guid>
      <dc:creator>marcocassol</dc:creator>
      <dc:date>2014-10-28T10:42:07Z</dc:date>
    </item>
  </channel>
</rss>

