KEIL memcmp inv_start_quaternion function error

By matthew1phillips , 4 March 2016

Hi all,

I am having technical difficulty with the mpl library. In particular, I am getting a hardfault when inv_start_quaternion() is called by pointer via the inv_start_mpl() function. Here is my relevant code:

/* Start. */
inv_init_mpl();
inv_enable_quaternion(); /* Including this causes errors!! */
inv_enable_9x_sensor_fusion();
inv_enable_fast_nomot();
inv_enable_gyro_tc();
inv_enable_in_use_auto_calibration();
inv_enable_vector_compass_cal();
inv_enable_magnetic_disturbance();
inv_enable_eMPL_outputs();
inv_start_mpl(); /* This implicitely calls inv_start_quaternion(). */
/* End. */

My call stack shows: inv_start_quaternion() (0x08005834) -> memcmp() (0x08005A64) -> HardFault_Handler (0x08008C8E). As the library is proprietary, it is difficult to debug.

I am using the unzipped library called "libmpllib_Keil_M4FP.zip." I have also tested with "libmpllib_Keil_M4.zip" (unzipped of course). Note that the library works when the inv_enable_quaternion() is not called. Also note that calling inv_enable_quaternion() in a different order does not change the outcome (as expected).

Other info:
– STM32f407, Cortex M4
– Keil 5.17
– C Compiler: Armcc.exe (V5.06 update 1 (build 61))
– Compiler control string: --c99 -c --cpu Cortex-M4.fp -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I..\stm32f4xx -I..\stm32f4xx\CMSIS\Include -I..\stm32f4xx\CMSIS\Device\ST\STM32F4xx\Include -I..\stm32f4xx

Questions: Am I importing the library correctly? Can my compiler work with the library, or should I be using another library/compiler? Am I not linking to standard libraries correctly? Or how should I solve this issue?

Thank you

phpbb Topic ID
33526