title: Setup / Errors with Floating Point on TI AM3517 Cortex-A8
body: <p>I'm getting an undefined instruction exception when executing:  </p>
  
  <pre><code>   0xED2D8B0E         VPUSH    {D8-D14}
  </code></pre>
  
  <p><em>(Note: The statement was generated by the compiler as part of C language function entry protocol.)</em>  </p>
  
  <h2>Initialization code:</h2>
  
  <pre><code>;; Initialize VFP (if needed).
  ;; BL      __iar_init_vfp  HJ REMOVED AND REPLACED WITH BELOW
   MRC    p15, #0, r1, c1, c0, #2         ; r1 = Access Control Register
   ORR    r1, r1, #(0xf &lt;&lt; 20)            ; enable full access for p10,11
   MCR    p15, #0, r1, c1, c0, #2         ; Access Control Register = r1
   MOV    r1, #0
   MCR    p15, #0, r1, c7, c5, #4         ; flush prefetch buffer because of FMXR below
                                          ; and CP 10 &amp; 11 were only just enabled
                                          ; Enable VFP itself
   MOV    r0,#0x40000000
   FMXR   FPEXC, r0                       ; FPEXC = r0
  </code></pre>
  
  <p>I get the undefined exception when the target FPU is set up as VFPv3 or VFPV3 + NEON.</p>
  
  <p>The initialization code is placed in the "cstartup.c" file, at the <code>__iar_program_start</code> and <code>?cstartup</code> code, following this code snippet:  </p>
  
  <pre><code>MRC         p15,0,R1,C1,C0,0
  LDR         R0,=CP_DIS_MASK      ;; 0xFFFFEFFA
  AND         R1,R1,R0
  ORR         R1,R1,#(1&lt;&lt;12)
  MCR         p15,0,R1,C1,C0,0
  </code></pre>
  
  <h2>Registers (before VPUSH):</h2>
  
  <pre><code>CPSR:  0x80000113  
  APSR:  0x80000000  
  SPSR:  0x000001D3
  </code></pre>
  
  <h2>Tools:</h2>
  
  <ul>
  <li>IAR Embedded Workbench IDE &amp; Compiler - 7.40</li>
  <li>I-Jet debugging probe</li>
  <li>Zoom AM3517 eval board</li>
  <li>TI AM35X Cortex-A8 processor</li>
  </ul>
  
  <h2>Questions:</h2>
  
  <ol>
  <li>In the initialization code above, which statements are required for
  NEON and which for VFP?</li>
  <li>Are there any initialization instructions I'm missing for NEON and
  VFP initialization?  </li>
  <li>Are there statements I need to place in the macro file for the debug
  probe?</li>
  </ol>