libdriver / mpu6050

MPU6050 full function driver library for general MCU and Linux.
https://www.libdriver.com
MIT License
372 stars 154 forks source link

Enhance Memory Management #22

Open xxosc opened 5 months ago

xxosc commented 5 months ago

Issue:

The current codebase utilizes a hardcoded buffer size of 1024, which is suboptimal for memory-constrained microcontroller units (MCUs). Additionally, debug strings present in the binary further inflate memory usage, posing challenges for deployment on low-memory MCUs.

Proposals:

  1. Dynamic Buffer Sizing: Introduce a mechanism to dynamically adjust buffer size based on user-defined requirements. This flexibility would allow users to tailor buffer sizes to their MCU's specific memory constraints, optimizing memory usage without sacrificing functionality.

  2. Debug String Removal: Implement a feature to strip debug strings from the binary during compilation or provide a configuration option to exclude them. This optimization would significantly reduce the binary size and alleviate RAM usage, making deployment on low-memory MCUs more feasible.

  3. Interface for Storing Large Chunks of Constant Data in Progmem: Develop an interface to efficiently store large chunks of constant data like dmp firmware in PROGMEM. By utilizing PROGMEM for constant data storage, we can conserve RAM and effectively manage memory resources, particularly for storing large datasets or configuration parameters.

Expected Benefits:

libdriver commented 1 month ago

Thank your for your advice, and it will make LibDriver MPU6050 better, We will try to update this library in the next month developing plan.