Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Enabling VFP on ARM926EJ-S (NXP LPC3180): (5 Items)
   
Enabling VFP on ARM926EJ-S (NXP LPC3180)  
added the recommended assembly code to _start.S as follows:

    /* Enable VFP */
    ldr     r0, =0x40000000
    fmxr    fpexc, r0

I get the following error:

C:/QNX641/host/win32/x86/usr/bin/qcc -V4.3.3,gcc_ntoarm -c -O -Wa,-I. -Wa,-IC:/bsp-new-641/bsp-epic_libstartup/arm/a-le 
-Wa,-IC:/bsp-new-641/bsp-epic_libstartup/arm -Wa,-IC:/bsp-new-641/bsp-epic_libstartup -Wa,-IC:/bsp-new-641/bsp-
epic_libstartup -Wa,-IC:/bsp-new-641/bsp-epic_libstartup/public -Wa,-IC:/bsp-new-641/bsp-epic_libstartup/public -Wa,-IC:
/QNX641/target/qnx6/usr/include  -Wa,--defsym,VARIANT_a=1  -Wa,--defsym,VARIANT_le=1  -Wa,--defsym,BUILDENV_qss=1    -I.
 -IC:/bsp-new-641/bsp-epic_libstartup/arm/a-le -IC:/bsp-new-641/bsp-epic_libstartup/arm -IC:/bsp-new-641/bsp-
epic_libstartup -IC:/bsp-new-641/bsp-epic_libstartup -IC:/bsp-new-641/bsp-epic_libstartup/public -IC:/bsp-new-641/bsp-
epic_libstartup/public -IC:/QNX641/target/qnx6/usr/include       -EL       C:/bsp-new-641/bsp-epic_libstartup/arm/cstart
.S 
C:/bsp-new-641/bsp-epic_libstartup/arm/cstart.S: Assembler messages:
C:/bsp-new-641/bsp-epic_libstartup/arm/cstart.S:77: Error: selected processor does not support `fmxr fpexc,r0'

I'm thinking that I need to set -mcpu=???, but haven't figured out what to set this to. Or, do I need to do something 
else?

Thanks,
Todd
Re: Enabling VFP on ARM926EJ-S (NXP LPC3180)  
What are you trying to do with the VFP?

If you want it available for use in the OS you'll need to set things
up so the kernel knows there's an FPU.

So far we've only supported VFP on ARMv6 and ARMv7 processors since
the startup can detect if it's present via CP14 CPACR.

Since there is not automatic way to detect a VFP on ARM926, it has to
be set up by board-specific code.

You need to set CPU_FLAG_FPU in the system page cpuinfo flags field.
The VFP needs to be disabled so that the kernel can trap accesses to
it and allocate per-thread VFP context as required.

Assuming it's a VFPv2, that _should_ be enough to get it working, but
since I've never tried this I can't offer any guarantees...

	Sunil.

Todd Peterson wrote:
> added the recommended assembly code to _start.S as follows:
> 
>     /* Enable VFP */
>     ldr     r0, =0x40000000
>     fmxr    fpexc, r0
> 
> I get the following error:
> 
> C:/QNX641/host/win32/x86/usr/bin/qcc -V4.3.3,gcc_ntoarm -c -O -Wa,-I. -Wa,-IC:/bsp-new-641/bsp-epic_libstartup/arm/a-
le -Wa,-IC:/bsp-new-641/bsp-epic_libstartup/arm -Wa,-IC:/bsp-new-641/bsp-epic_libstartup -Wa,-IC:/bsp-new-641/bsp-
epic_libstartup -Wa,-IC:/bsp-new-641/bsp-epic_libstartup/public -Wa,-IC:/bsp-new-641/bsp-epic_libstartup/public -Wa,-IC:
/QNX641/target/qnx6/usr/include  -Wa,--defsym,VARIANT_a=1  -Wa,--defsym,VARIANT_le=1  -Wa,--defsym,BUILDENV_qss=1    -I.
 -IC:/bsp-new-641/bsp-epic_libstartup/arm/a-le -IC:/bsp-new-641/bsp-epic_libstartup/arm -IC:/bsp-new-641/bsp-
epic_libstartup -IC:/bsp-new-641/bsp-epic_libstartup -IC:/bsp-new-641/bsp-epic_libstartup/public -IC:/bsp-new-641/bsp-
epic_libstartup/public -IC:/QNX641/target/qnx6/usr/include       -EL       C:/bsp-new-641/bsp-epic_libstartup/arm/cstart
.S 
> C:/bsp-new-641/bsp-epic_libstartup/arm/cstart.S: Assembler messages:
> C:/bsp-new-641/bsp-epic_libstartup/arm/cstart.S:77: Error: selected processor does not support `fmxr fpexc,r0'
> 
> I'm thinking that I need to set -mcpu=???, but haven't figured out what to set this to. Or, do I need to do something 
else?
> 
> Thanks,
> Todd
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post67811
> 
Re: Enabling VFP on ARM926EJ-S (NXP LPC3180)  
I'm using the VFP to do FFT's. Using the info that you provided (seems all I needed to do was set the  CPU_FLAG_FPU 
flag), I'm getting a good improvement in performance (6X)! Thanks!!! The only oddity that I notice is that if I link 
using libm vs. libm-vfp, I see no difference.
Todd
Re: Enabling VFP on ARM926EJ-S (NXP LPC3180)  
Have you put libm.so=libm-vfp.so in your image build file?

Todd Peterson wrote:
> I'm using the VFP to do FFT's. Using the info that you provided (seems all I needed to do was set the  CPU_FLAG_FPU 
flag), I'm getting a good improvement in performance (6X)! Thanks!!! The only oddity that I notice is that if I link 
using libm vs. libm-vfp, I see no difference.
> Todd
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post68056
> 
Re: Enabling VFP on ARM926EJ-S (NXP LPC3180)  
I have libm.so->libm-vfp.so and most applications behave well. Some applications choke because they cannot find a symbol
:

unknown symbol: __fixsfsi

an example of this is random. If I put the non-vfp libm.so somewhere and set LD_LIBRARY_PATH to point to this location, 
random runs fine.