Open hkayann opened 1 year ago
Hi @hkayann the Ardunio_BHY2 uses mbed's BLE stack which is the biggest consumer of the RAM. If you don't need BLE, you could use proper parameters for BHY2.begin() to turn off the BLE, which should help reduce the RAM usage significantly. Example: BHY2.begin(NICLA_STANDALONE);
Hi @hkayann ! We're you able to configure the sketch to use less RAM as suggested by @bstbud ?
@sebromero I am not so still looking for a way to do this.
@bstbud is there any way to reduce the RAM used by the BLE library?
Another interesting thing is that the Arduino_BHY2
requiresArduinoBLE.h
anyway.
@sebromero I am not so still looking for a way to do this.
@bstbud is there any way to reduce the RAM used by the BLE library?
based on my knowledge, the memory of the BLE stack has been optimized already, and there is only little wiggling room.
Thanks for the reply @bstbud, I am trying alternative ways now.
One of them is to load my variables into the RAM of BHI260AP as that chip 256KB SRAM while Nicla offers 64 KB only.
I appreciate any lead on that. I know it is not directly related to this issue, sorry for that. So if you want, feel free to close this one.
Another interesting thing is that the
Arduino_BHY2
requiresArduinoBLE.h
anyway.
@hkayann, even though the ArduinoBLE.h header is included, it does not mean the RAM will be used/claimed by the BLE stack automatically although by default this is the case. If you don't need BLE in your project, you could change the parameters of the BHY2.begin() function, for example, you could pass NICLA_I2C instead of NICLA_BLE_AND_I2C (by default) and the BLE stack won't set up the memory pool in this case.
@bstbud I see. I need BLE. Any suggestion on this?
One of them is to load my variables into the RAM of BHI260AP as that chip 256KB SRAM while Nicla offers 64 KB only.
@bstbud I see. I need BLE. Any suggestion on this?
One of them is to load my variables into the RAM of BHI260AP as that chip 256KB SRAM while Nicla offers 64 KB only.
Hi @hkayann yes, this is the same suggestion I would give. The BHI260AP has more memory, and sensor processing related tasks could be handled on the BHI260AP which is also much more power efficient than the main MCU. The Nordic MCU could be used for connectivity tasks. Now the SDK for BHI260AP is publicly available. You could refer to: https://www.bosch-sensortec.com/products/smart-sensor-systems/bhi260ap/#technical for how to use the SDK.
Hi @bstbud,
I am playing with that right now. I would really appreciate if at least, very briefly if you can tell me the steps required to implement that for Nicla Sense ME?
Hi @bstbud,
I am playing with that right now. I would really appreciate if at least, very briefly if you can tell me the steps required to implement that for Nicla Sense ME?
I would start with the SDK and the quick start guide provided to implement some simple example algorithms to understand the basics and then step up to implement your own algorithm. If you encounter specific issues, I suggest to post some questions on Bosch Sensortec online community.
I appreciate if someone can explain why this library consumes so much ram.
Here is the empty sketch usage:
If I include Arduino_BHY2:
As, I am trying to run my ML model, I am having diffuculties regarding RAM availability.