Skip to main content
Visitor II
January 6, 2020
Question

Source code for ST.COM's X-CUBE-MEMS1 available?

  • January 6, 2020
  • 9 replies
  • 1667 views

Is the source code for ST.COM's X-CUBE-MEMS1available? I am using an STM32L412. And when I try to include the STM32 pre-compiled library into my project I get errors. I am thinking the processor I am using is not compatible with the libraries. So I'd like to try using the source code instead.

-thanks

    This topic has been closed for replies.

    9 replies

    ST Employee
    January 6, 2020

    The libraries are compatible with STM32L412 or any device with Cortex-M4.

    The source code of the libraries are not public.

    What error did you get and which IDE do you use?

    Rstua.1Author
    Visitor II
    January 6, 2020

    Hi @Miroslav BATEK​ 

    My code was compiling before adding X-CUBE-MEMS1 libraries. After adding the libraries, there were several very long error messages that appeared to be truncated. I assumed they were because the libraries were not compatible with the processor. But it may be I have added the libraries incorrectly. I will post the response I get once I get to that computer.

    -again, thank you for your help.

    Rstua.1Author
    Visitor II
    January 6, 2020

    Here are the 2 lines of errors I see after adding the X-CUBE-MEMS1 MC and EC libraries and the associated header files...

    c:/program files (x86)/atollic/truestudio for stm32 9.3.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: error: LSM9DS1 Driver.elf uses VFP register arguments, ../Middlewares/STM32_Motion_Library/Lib\MotionEC_CM4F_wc32_ot.a(motion_ec.o) does not
    c:/program files (x86)/atollic/truestudio for stm32 9.3.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: failed to merge target specific data of file ../Middlewares/STM32_Motion_Library/Lib\MotionEC_CM4F_wc32_ot.a(motion_ec.o)

    ST Employee
    January 6, 2020

    Please check the project settings in C Compiler - target - Floating point.

    These should be settings something like "Mixed ..." not Hardware Implementation.

    The libraries are compiled with -mfloat-abi=softfp option .

    Rstua.1Author
    Visitor II
    January 6, 2020

    So, the error is not truncated. I believe it is saying my code is setup to use VFP registers and the MotionEC code (library) is not. I'm assuming VFP controls the way the ARM registers are used. However, I am not sure what I am looking for in the code. As there are many defines with VFP in the define names (for example: "_TARGET_FPU_VFP", "_ARM_PCS_VFP", "__VFP_FP__", ect).

    ST Employee
    January 6, 2020

    Go to project properties and try to find the settings there,

    I don't have Attolic TrueStudio but in STM32CubeIDE it looks like in the attached screenshot.

    0690X00000BvdewQAB.png

    Rstua.1Author
    Visitor II
    January 6, 2020

    Digging further, (according to this stack exchange question / answer: https://stackoverflow.com/questions/9753749/arm-compilation-error-vfp-registered-used-by-executable-not-object-file) this may be a "hard-float" verses "soft-float" problem.

    Rstua.1Author
    Visitor II
    January 6, 2020

    Trying something: Under Properties=>C/C++ Build=>Settings=>Tool Settings=>C Compiler=>Target=>Floating point change from "Hardware Implementation" to "Mix HW/SW implementation". Also did the same under Linker (Under Properties=>C/C++ Build=>Settings=>Tool Settings=>C Linker=>Target=>Floating point change from "Hardware Implementation" to "Mix HW/SW implementation"). Now the project compiles! But I am not sure if the code is working as expected yet.

    Rstua.1Author
    Visitor II
    January 6, 2020

    I'm sorry @Miroslav BATEK​ . I didn't realize you had posted 2 answers while I was entering more follow up information. I just refreshed my web page and now see where you were directing me toward the correct answer way before I had stumbled though them.

    Thanks again!