LPC4330 sinf() slow

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

LPC4330 sinf() slow

390 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mfinke@uni-wuppertal.de on Mon Sep 07 09:46:41 MST 2015
Hello,

the LPC4330 is running with a clock of 204 MHz. With softABI enabled one sinf() calculation takes 29 us so the calculation frequency is going down to 34 kHz. Is there a way to speed it up?

Best Regards
Labels (1)
0 Kudos
3 Replies

368 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Sep 08 07:40:00 MST 2015
The FAQ I previously pointed you at explains how to modify projects to build them using HardABI rather than SoftABI. This mechanism can be used on the LPCOpen library projects as well as your own application project.

You should also remember that the floating point unit on Cortex-M4 only provides hardware implementation of "simple" operations. Thus things like sinf() are still implemented as library code. It is just that this library code can use floating point instructions for low level operations.

Thus it is quite possible that for timing critical operations, you might want to look at alternative approaches, such as pre-generating a data lookup table.

Regards,
LPCXpresso Support
0 Kudos

368 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mfinke@uni-wuppertal.de on Tue Sep 08 01:43:15 MST 2015
Thanks for your reply:

- I'm using LPCExpresso 7.9
- in Debug - mode I'm useing no optimisation, should I?
- All Variables are floats
- The code is running on the M4 core

My Test-Project is attached. What do I have to do to get HardABI working? The board and chip librarys of PLCOpen aren't working with HardAPI, or?

Best Regards
0 Kudos

368 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Sep 08 00:27:55 MST 2015
You could try switching to compiling with HardABI?

https://www.lpcware.com/content/faq/lpcxpresso/cm4-floating-point

But beyond that it would probably be helpful if you provided more information, for example:

- What toolchain are you using?
- What optimisation level are you using?
- Are you carrying out all your calculations using floats, rather than doubles?
- Is this code running on the Cortex-M4 core or the Cortex-M0 ?

It would probably also be helpful if you could post a simple buildable project, or at least a code snippet so we can see what you are doing.

Regards,
LPCXpresso Support
0 Kudos