HardFault once calling MotionFX_propagate()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-05 9:59 PM
my mcu is STM32F730R8Tx
sensor: LSM9DS1
use CubeMx gen code, with Makefile(under linux env)
I use lsm9ds1_reg.c as sensor driver fetch raw data, and it worked fine.
then, do the following as MotionFX lib documents:
- MotionFX_initialize()
- MotionFX_getKnobs(&knobs);
- MotionFX_setKnobs(&knobs);
- MotionFX_enable_6X(MFX_ENGINE_DISABLE);
- MotionFX_enable_9X(MFX_ENGINE_ENABLE);
I can run the code, and i can get ther version code by MotionFX_GetLibVersion(): ST MotionFX v2.4.1
But, if i enable MotionFX_propagate() in the following routie, MCU will enter Hard Falut ISR...
if (is_imu_xl_gy_drdy())
{
MFX_input_t raw;
MFX_output_t out;
imu_getdata(&raw);
// curr_tick = HAL_GetTick();
// deltatime = (curr_tick - last_tick)/1000.0;
// last_tick = curr_tick;
deltatime = 0.01;
if (0)
{
len = snprintf(buf, 256, "%4.2f %4.2f %4.2f | %4.2f %4.2f %4.2f | %4.1f %4.1f %4.1f\n", raw.acc[0], raw.acc[1], raw.acc[2], raw.gyro[0], raw.gyro[1], raw.gyro[2], raw.mag[0], raw.mag[1], raw.mag[2]);
CDC_Transmit_FS(buf, len);
}
MotionFX_propagate(&out, &raw, &deltatime);
}
I have enable CRC in cubemx.
in Makefile, i did some change:
- FLOAT-ABI change to -mfloat-abi=softfp
- in LDFLAGS add -u _printf_float
- in LIBS change to LIBS = -lc -lnosys -l:MotionFX_CM7F_wc32_ot.a -l:MotionFX_CM7F_wc16_ot.a -lm
in STM32F730R8Tx_FLASH.ld
- change _Min_Heap_Size to 0x1000
- change _Min_Stack_Size to 0x8000, i think it should large enough..
=============
But why HardFalut once calling MotionFX_propagate ?
Thank thee very much!!
- Labels:
-
STM32CubeMX
-
STM32F7 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-06 8:39 AM
Hi @MMa.1893​ ,
It seems so far that everything is fine in your configuration code. Could you please share which version of X-CUBE-MEMS1 or MotionFX library are you using?
Although the MotionFX library is device independent, it is typically used in combination with STM32F4 motherboards.
For this reason, I reported your question internally and we have to double-check the functionality of this function on Cortex-M7.
-Eleon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-08 6:06 PM
Hi, Eleon
i can get ther version code by MotionFX_GetLibVersion(): ST MotionFX v2.4.1
in STM32CubeMX X-CUBE-MEM1, "Drivers and sample application for MEMs components" version is 8.1.1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-09 1:27 AM
Thanks for the feedback @MMa.1893​ .
I actually have to correct myself regarding the above sentence "it is typically used in combination with STM32F4 motherboards", since these libraries are provided compiled for Cortex-M0, M3, M4 and M7, so they should work with all the MCU families.
-Eleon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-09 1:47 AM
so .... why my code fault ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-09 1:49 AM
We are currently check, and we'll come back to you as soon as possible.
-Eleon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-09 1:53 AM
Thank thee very much!
i can send you my design if you need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-09 2:09 AM
Yes, of course, you can share it here or in the Message section of the community.
Thanks,
-Eleon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-09 2:19 AM
ok i have message you, hope it can be solved asap:smiling_face_with_halo:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-11-11 3:51 AM
Hi @MMa.1893​ ,
Our experts have validated that the library is working on NUCLEO- F767ZI, so they believe the library is OK.
About your shared project, there looks like there are many lines put in comments, so it is not clear what was used and what not.
Is it possible for you to create a simple project with only the library and test it? And, if possible, we can also check the input data which are passed to the library.
-Eleon
