Can X-CUBE-MEMS1 libraries be used in B-L475E-IOT01A board?
I have a
http://www.st.com/en/evaluation-tools/b-l475e-iot01a.html
, which I am using now to learn about how ST MEMS sensors work and if I can use them in my future PCB designs.I have found recently that ST provides a library to mix 9-axis sensor data to calculate the orientation of any device. This libraries are in the
http://www.st.com/en/embedded-software/x-cube-mems1.html
.In my case, I want to use the 'MotionFX' library, mixing the data from Magnetometer+Gyroscope+Accelerometer which there are in this board.
My problem is that the function 'MotionFX_initialize()' gets stuck and never leave. Due to the fact that ST doesn't give us the source code of the library, I can't understand why this function doesn't work, because according to the documentation, there is no requirements or preconditions to use this function.
I have checked the assembly code (using TRUESTUDIO IDE) and this is the result:
MotionFX_initialize:
0800de00: ldr r1, [pc, &sharp880] ; (0x800e174 <MotionFX_initialize+884>)0800de02: ldr r2, [pc, &sharp884] ; (0x800e178 <MotionFX_initialize+888>)0800de04: stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, r10, r11, lr}0800de08: ldr r3, [r1, &sharp0]0800de0a: movs r0, &sharp10800de0c: bic.w r3, r3, &sharp10800de10: str r3, [r1, &sharp0]0800de12: mov r3, r20800de14: str r0, [r2, &sharp0]0800de16: ldr r5, [r3, &sharp0]0800de18: cmp r5, &sharp00800de1a: bne.n 0x800de16 <MotionFX_initialize+22>0800de1c: ldr r3, [pc, &sharp860] ; (0x800e17c <MotionFX_initialize+892>)0800de1e: ldr r2, [pc, &sharp864] ; (0x800e180 <MotionFX_initialize+896>)0800de20: str r2, [r3, &sharp0]0800de22: ldr r2, [r3, &sharp0]0800de24: ldr r3, [pc, &sharp860] ; (0x800e184 <MotionFX_initialize+900>)0800de26: cmp r2, r30800de28: beq.n 0x800de2c <MotionFX_initialize+44>0800de2a: b.n 0x800de2a <MotionFX_initialize+42>The last assembly code line (
0800de2a
) is where the code gets stuck. AsMotionFX_initialize function doesn't have any parameter, I guess all this assembly code is equal in every microcontroller or evaluation board.
In my TRUESTUDIO project, I use 'libMotionFX200_CM4F_GCC_ot.a' because
http://www.st.com/en/evaluation-tools/b-l475e-iot01a.html
board have a ARM-M4 microcontroller. I have configured correctly the project in order to link the library with the compiler. Even the whole project can compile without any error.So, I wonder if there are limitations to use this library or if I have found out a bug. Can somebody who have used this library give me some help o tell me if you could use it without problems?
List of ideas I have tried so far:
In another post, I read this:
. But my CRC module has always been active and the library doesn't work.Disabling optimizations.
Enabling optimizations to -O3 (because 'DataLogFusion' example do it).
Comparing the IDE configuration with the example, to check if the library linking is correct.♯
