In a code that I wrote for Nano I seem to be getting into a low memory issue. All print statements use the F macro. And as far as possible variables are restricted to functions and of course some are at Global level.
The warning I get is :
Sketch uses 20582 bytes (66%) of program storage space. Maximum is 30720 bytes.
Global variables use 1796 bytes (87%) of dynamic memory, leaving 252 bytes for local variables. Maximum is 2048 bytes.
Low memory available, stability problems may occur.
Possibly I am running into this mess because of too many libraries I think … the list is as below :
#include <LiquidCrystal_I2C.h>
#include <AltSoftSerial.h>
#include "Wire.h"
#include <SPI.h>
#include <SdFat.h>
#include <phi_interfaces.h>
#include <Nanoshield_ADC.h>
#include <EEPROM.h>
Right now the code is working but I am scared as to when the thing will crash as I cannot simulate all of the field conditions. This is a data logger.
I suppose that depends on the different functions calls and if the balance 252 bytes can manage the local variables in them, then it will keep going fine ? Is there a method to evaluate this ?