Hm. PlatformIO does not link in the .pio\libdeps\nucleo_f401re\STM32duino MotionFX\src\cortex-m4\fpv4-sp-d16-hard\libMotionFX.a file although the library.properties says precompiled = true. This has been a bug before in the PlatformIO core but thought to be resolved. Let me double check.
This is really cursed. The only way I can get it to compile is if I copy the MotionFX arduino library into lib/, delete the STM32duino MotionFX/src/cortex-m4/libMotionFX.a file and add
It insisted on adding STM32duino MotionFX/src/cortex-m4/ to the library search path, where it would find the wrong MotionFX library (compiled without floating point).
Linking .pio\build\nucleo_f401re\firmware.elf
c:/users/max/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: warning: .pio/build/nucleo_f401re/firmware.elf has a LOAD segment with RWX permissions
Checking size .pio\build\nucleo_f401re\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [= ] 6.4% (used 6336 bytes from 98304 bytes)
Flash: [= ] 13.1% (used 68520 bytes from 524288 bytes)
Building .pio\build\nucleo_f401re\firmware.bin
This must be deleted from lib_deps then otherwise you have the libary twice. Better delete the whole .pio folder after this too. You might then need to re-add the library for your specific sensor, like STM32duino LSM6DSL to your lib_deps.
I have libMotionFX.a file only this path \lib\STM32duino MotionFX\src\cortex-m4\fpv4-sp-d16-hard\libMotionFX.a
The rest I deleted out, and I used the example file name Fusion9X_IKS01A3.ino
the .pio\libdeps is empty, no file
I still cannot compile, same error
src\main.cpp:108:24: error: 'MFXState_t' was not declared in this scope
108 | MotionFX_initialize((MFXState_t *)mfxstate);
| ^~~~~~~~~~Compiling .pio\build\nucleo_f401re\FrameworkArduino\pins_arduino.c.o
src\main.cpp:108:36: error: expected primary-expression before ')' token
108 | MotionFX_initialize((MFXState_t *)mfxstate);
| ^
src\main.cpp:108:3: error: 'MotionFX_initialize' was not declared in this scope; did you mean 'MotionFX_CM0P_initialize'?
108 | MotionFX_initialize((MFXState_t *)mfxstate);
| ^~~~~~~~~~~~~~~~~~~