cancel
Showing results for 
Search instead for 
Did you mean: 

MotionFX Flash and RAM Size Problem

JonasQ
Associate

I would like to use the MotionFX Library from the X-CUBE-MEMS1 package in a project on a STM32WL55JC.

The datasheet of the library states the following:

  • Cortex-M4: 44.1 kB of code and 1.1 kB of data memory

I have already written a library for another application that converts my data for the MotionFX library and returns me the filtered values (Similar to User Manual UM2220, page 14). Before I include this, I have 8.66 KB of free RAM and 38.91 KB of free Flash. When I add the functions with the MotionFX Lib, I get the following errors:

  • FLASH overflowed by 4336 bytes
  • RAM overflowed by 3200 bytes

Now my questions:

  1. Is Code Size == Flash Size ?
  2. Is it possible to reduce the required RAM & Flash size by the MotionFx Library by changing the compiler settings?
  3. Why does the real required RAM & Flash size differ from the values given in the user manual?
  4. Is there generally an approach to reduce the size of the library for my application (simple Kalman filter, no calibration of the IMUs) by omitting something?

Best regards.

1 REPLY 1
Petr S
ST Employee

Hello,

The code size (in FLASH memory) cannot be decreased anymore because the library has been already compiled with highest optimization for size. I've analyzed the size for the most memory consuming Cortex-M4 library which is MotionFX_CM4F_wc32_ot_hard.a and it occupies 41.5 kB of FLASH and 2.2 kB of RAM. If you have 39 kB of FLASH free then it cannot fit. In case of RAM it's a bit tricky. The library itself really consumes 2.2 kB of RAM (sorry for obsolete value of 1.1 kB in UM), but all the variables needed for the library usage are now due to support of multiple instances of library moved outside the library so once you use the library you create all these variables in your application which consumes more RAM than you have.

Best regards,

Petr