How to add compile option in SmartSnippets Studio

Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
zhuxl
Offline
Last seen:3 years 9 months ago
Joined:2017-04-07 09:48
How to add compile option in SmartSnippets Studio

Hi Dialog

Our project uses a third party library that use math function, such as expf, exp, floorf, ceilf. When the project is compiled, there are some error, as bellow:
undefined reference to `floorf'
undefined reference to `ceilf'
undefined reference to `expf'
.....

Query mu question from Google, the result is that add the comile options "-lm" when the project is compiled.
Now, Where to add this compile options, Thanks.

Best Regards,
zhuxl

Device:
MT_dialog
Offline
Last seen:1 week 3 days ago
Staff
Joined:2015-06-08 11:34
Hi zhuxi,

Hi zhuxi,

Are you using Keil ? This is something that you should check in keil support site, but i am able to include the math.h file and build the project.

Thanks MT_dialog

zhuxl
Offline
Last seen:3 years 9 months ago
Joined:2017-04-07 09:48
Hi MT_dialog

Hi MT_dialog

I use Dialog SmartSnippets Studio, I want to add some compile options.
I meet a problem when add "-fpu=None" compiled options. follow bellow:

/***start**************************/
make --silent pre-build main-build
Generate mem.ld for selected configuration (QSPI).

Building target: target.elf
Invoking: Cross ARM C Linker
arm-none-eabi-gcc.exe: error: unrecognized command line option '--fpu=None'
make: *** [target.elf] Error 1
/**************end******************/

Why the smartStudio can`t unrecognized command line option please. :)
PS: my product based on ARM Cotex-M0 CPU

Best Regards,
Zhuxl

MT_dialog
Offline
Last seen:1 week 3 days ago
Staff
Joined:2015-06-08 11:34
Hi zhuxi,

Hi zhuxi,

As far as i can tell the --fpu=none is a command supported by keil compiler, in the case of the GNU tools the proper command for selecting an FPU is -mfpu which doesn't accept the 'none' as ab argument. Also you dont have to explicitly set the FPU, since its an ARM M0 it doens't have an FPU and the floating point operations are done via sw implementation.

Thanks MT_dialog