LPC4350FET256

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC4350FET256

368 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jimmcwin on Thu May 31 10:05:57 MST 2012
Does this part really support FPU ?

I am having hard faults when codes compiled with M4FPU using Keil uVision4( call _fp_init ). Please helps.

Jim

Labels (1)
0 Kudos
3 Replies

329 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jdurand on Sun Jun 03 11:33:53 MST 2012
A while back I did an evaluation of the FPU, the report and code is here:
http://www.lpcware.com/content/contribproj/jdurand-lpc4300ex

Note that I had a very early version of the Hitex board so the code may or may not run on a newer board.
0 Kudos

329 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jimmcwin on Thu May 31 15:31:18 MST 2012
It works. I just add these 4 lines of code at the reset vector before jumping to __main.

LDR.W R0, =0xE000ED88
; Read CPACR
LDR R1, [R0]
; Set bits 20-23 to enable CP10 and CP11 coprocessors
ORR R1, R1, #(0xF << 20)
; Write back the modified value to the CPACR
STR R1, [R0]


Thanks,


Jim
0 Kudos

329 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by PhilYoung on Thu May 31 14:42:40 MST 2012
The FPU works fine, but when you compile for the M4FPU with the keil tools it uses the FPU registers for many purposes, including some memcpy functions.
This means that it can sometimes crash ( depending on what the compiler created ) before getting to main,

I saw this a few times with C++ code when I had static objects with constructors as they get called before you get to main.

The best thing to do is enable the FPU from the init code, it is disabled after reset

I added
   extern void fpuInit(void);
to system_lpc43xx.c and then call fpuInit from

void SystemInit(void)

I call SystemInit from the boot code before doing anything else and just use it to set the flash and clock to speed up the boot process.

fpuInit is in fpu_init.c in the CMSIS\lpc43xx\Core\Device\NXP\LPC43xx\Source directory ( at least on my machine ).
this solves the problem for me.

regards

Phil.
0 Kudos