Include arm_math.h

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

Include arm_math.h

1,574 Views
mattisasp
Contributor II

Hi, I have downloaded LPCopen and am using eclipse MCUXpresso to run one of the demos "blinky" on linux Ubuntu 16.04.

I now want to add another library arm_math.h and use it together with the blinky example.
The header file is included

#include "arm_math.h"
...

void Testing(void){

      printf("testing cosine, cos(1) = %f", arm_cos_q15(1));

}

int main(void)
{

    // Init functions etc...

   Testing();
}

In this example printf is printing to UART, this must be set up separately.

Build log:

10:24:57 **** Incremental Build of configuration Debug for project periph_blinky ****
make -r -j16 all
Building target: periph_blinky.axf
Invoking: MCU Linker
arm-none-eabi-gcc -L"/home/username/Documents/MCUXpresso_10.1.1_606/workspace/lpc_chip_43xx/Debug" -L"/home/username/Documents/MCUXpresso_10.1.1_606/workspace/lpc_board_keil_mcb_4357/Debug" -Xlinker -Map="periph_blinky.map" -Xlinker --gc-sections -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb -T "periph_blinky_Debug.ld" -o "periph_blinky.axf"  ./src/cr_startup_lpc43xx.o ./src/sysinit.o ./src/systick.o   -llpc_board_keil_mcb_4357 -llpc_chip_43xx
./src/systick.o: In function `Testing':
/home/username/Documents/MCUXpresso_10.1.1_606/workspace/periph_blinky/Debug/../src/systick.c:496: undefined reference to `arm_cos_q15'
/usr/local/mcuxpressoide-10.1.1_606/ide/tools/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/softfp/libc.a(lib_a-writer.o): In function `_write_r':
writer.c:(.text._write_r+0x12): undefined reference to `_write'
/usr/local/mcuxpressoide-10.1.1_606/ide/tools/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/softfp/libc.a(lib_a-closer.o): In function `_close_r':
closer.c:(.text._close_r+0xc): undefined reference to `_close'
makefile:30: recipe for target 'periph_blinky.axf' failed

1 Reply

1,036 Views
mattisasp
Contributor II

Solved it, post here if you need the full solution.
A hint was given:

Hi,

 

When you add a library to a project in Simplicity Studio under the linker settings, you need to remove the "lib" and the ".a" from the library's name. In this case, you should add "m" to your linker library settings.

I am using MCUXpresso, but the same must be done here.