07-25-2023 03:46 PM
I appreciate if someone can explain why this library consumes so much ram.
Here is the empty sketch usage:
RAM: [= ] 12.0% (used 7720 bytes from 64288 bytes) Flash: [= ] 7.6% (used 40184 bytes from 527616 bytes)
If I include Arduino_BHY2:
RAM: [====== ] 55.5% (used 35672 bytes from 64288 bytes) Flash: [===== ] 50.8% (used 267952 bytes from 527616 bytes)
As, I am trying to run my ML model, I am having diffuculties regarding RAM availability.
What are my options?
Best Regards,
Solved! Go to Solution.
08-02-2023 05:00 PM
Hi hkayan,
ArduinoBLE lib takes most of the memory.
When only include the ArduinoBLE.h in a simple script:
#include "ArduinoBLE.h"
// Set DEBUG to true in order to enable debug print#define DEBUG false
void setup()
{#if DEBUG
Serial.begin(115200);
#endif
}
void loop()
{
}
Then memory cost is shown as:
Sketch uses 243580 bytes (46%) of program storage space. Maximum is 527616 bytes.
Global variables use 32784 bytes (50%) of dynamic memory, leaving 31504 bytes for local variables. Maximum is 64288 bytes.
Do you use BLE function? If no, you can remove the BLE dependency in our Arduino_BHY2 lib.
08-02-2023 09:23 PM
Hi @BSTRobin,
Many thanks for the answer. Yes, I need the BLE as update NIcla via Portenta over BLE.
Seems like I need to manually dig to reduce the usage, or do you have any other suggestions?
08-07-2023 03:54 PM
Hi hkayan,
For optimizing Arduino BLE library, you can refer to the discussions on the Arduino forum, such as: https://forum.arduino.cc/t/how-to-minimize-library-size/878586