AnsweredAssumed Answered

Include arm_math.h

Question asked by Mattis Asp on Feb 26, 2018
Latest reply on Feb 26, 2018 by Mattis Asp

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

Outcomes