Questions tagged [memory-usage]
Use this tag for questions about memory usage on the Arduino.
148 questions
1
vote
0
answers
117
views
"Stack canary watchpoint triggered (loopTask)" when synchronizing with Arduino Cloud IoT (ArduinoCloud.update())
I have created a sketch that updates 195 variables : 16xString variables, 34xfloat, 52xint, 107xbool.
Notice : I'm using the IDE tool instead of the included Cloud IoT compile (because I have a pb ...
-1
votes
2
answers
266
views
How can I make this program take up less memory?
I'm measuring how long it takes to drain a battery. An Arduino Nano controls an SSD1036 OLED display, a board with two relays, and an INA3221 voltage/current measurement board.
The battery is ...
0
votes
1
answer
89
views
How can I make this function take up less memory? [duplicate]
I've written a sketch that uses TimeLib to display elapsed time. I'm measuring how long it takes to drain a battery. The goal is to display the time as hh:mm:ss.
The code I use works well when I ...
0
votes
1
answer
115
views
Problem with char* variable malloc/free. Empty contents on recipient variable after using free
I am working on a custom SD card data logger using the following function and struct:
char *filenameCreator(const char *prefix, const char *num, bool addExtension)
{
char *filename = (char *)...
0
votes
1
answer
192
views
deserializeJson() failed: NoMemory when sending Serial json using ArduinoJson
Hey all I have a sketch that takes up 99% of my storage space since I am using a Arduino Nano.
Although everything in my code fits as-is, there seems to be an issue with me sending a json string over ...
-1
votes
1
answer
134
views
Help reducing dynamic memory usage with LoRa library
I have combined code that reads heart rate and SPO2 then sends the data using LoRaWAN. Using these 2 libraries that work well by themselves LoraWAN lib | MAX30102 lib. My board is an Arduino Pro or ...
0
votes
2
answers
130
views
Is it "safe" to use "new" keyword to instantize several sensor objects?
I've read that it is bad practice to use dynamic memory allocations on a microcontroller and I have a pretty good grasp of why.
I am developing a custom PCB around an ATMega2560 and in my situation, I ...
1
vote
1
answer
276
views
Conditional assignment of array
I have some really long global variable arrays filled with data.
There is a single function that processes the data. The function works on only one array everytime. This arrays value changes every ...
1
vote
1
answer
354
views
Why does Serial.print(1) cost 228 bytes more program memory compared to Serial.print((char)(48+1))?
Just discovered this. When I cast an int to a char inside a Serial.print statement it costs way less program memory. I'm not sure why. Could someone explain this to me?
In the following example the ...
2
votes
1
answer
252
views
How to make the compiler ensure that local variables memory allocation won't cause any RAM overflow during execution?
Upon compiling a sketch using the Arduino IDE, a message like the following gets displayed in the console:
Global variables use 1540 bytes (75%) of dynamic memory, leaving 508 bytes for local ...
-3
votes
1
answer
102
views
Which Arduino board would be sufficient for the following simulink project?
I'm trying to run a Fuzzy Logic MPPT Algorithm in Arduino UNO, here's the Simulink File
However when I try to upload the code, I get the following error
Is this project possible with UNO, if yes, ...
1
vote
2
answers
513
views
Is there a good reference for Arduino Due memory architecture and usage?
It's been harder than I expected to find a reference source or usage guide.
There's a number of sources I've looked at along the road to this question:
The Due is listed here and here as having 512KB ...
1
vote
0
answers
363
views
Save data permanently on ESP32
I'm working on a stage (this is my first bigger Arduino project), and I want to create an initializer for it, and for this, I want to store some variables in the memory of ESP32 WROVER-B. For this, I ...
1
vote
1
answer
446
views
1 global variable consuming 19% of memory
I am working on a simple project on talking to the serial monitor, and my only global variable ("int" type, named "incomingByte") is consuming a lot of memory. There is no problem ...
3
votes
2
answers
907
views
5V alternative to Due?
I've designed a circuit controlled by an Arduino Mega 2560 involving a number of external components all running on and sending out 5V signals. I'm now realizing that the 8Kb of SRAM on the Mega 2560 ...