Questions tagged [memory]
Use this tag for memory management or issues in programming.
136 questions
0
votes
1
answer
374
views
ESP32CAM fails to initialise camera with error 0xffffff
There is a simple PlatformIO sketch (arduino format) that has the following main.cpp file:
#include <Arduino.h>
#include "esp_camera.h"
#include "camera_pins.h"
#define ...
0
votes
2
answers
515
views
Is std::string (and ephemeral memory allocation in general) safe to use for ESP32 Arduino?
I know that with 8-bit AVR Arduinos, std::string is widely regarded as fundamentally unsafe due to problems with heap-fragmentation (partly due to limited ram, and partly because the WAY the ...
1
vote
1
answer
410
views
stream a "big" array of measures to a server through wifi
I'm measuring accelerations at "high frequency" (4kHz) from an accelerometer (ADXL355/ADXL357) to an esp32. It's crucial that no sample is lost while performing a measure which last say 2 ...
1
vote
2
answers
255
views
What's Memory Allocation technique in Arduino
I am currently working on an assignment for my embedded systems course, and my professor has asked us to determine the memory allocation technique employed in Arduino. Specifically, I need to identify ...
1
vote
1
answer
280
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 ...
5
votes
2
answers
135
views
Not enough memory error using OneSheeld.h
I'm a dairy farmer and I'm new to playing around with Arduino's. I created a code to send me SMS's when my equipment stops working as it should, but I run into a "Not enough memory" error. ...
0
votes
3
answers
67
views
How do you deal with balancing the limited storage of Arduino with the decrease in speed if you just print everything as it gets measured?
I am working on a simple data acquisition system based on an Arduino Uno. Each run would ideally collect up to 10k data points (all doubles). Obviously, the Arduino doesn't have the capacity to hold ...
2
votes
1
answer
3k
views
Space taken by Global Variables
Using Nano's for small programmes I get compilation reports about the amount of space taken by global variables.
On a typical progamme it says something like Sketch uses 16316 bytes (53%) of program ...
2
votes
1
answer
184
views
Can a power cut damage the software?
When unplugging the power source of a device that is writing some data "A" to an SD card, also other data "B" might get corrupted. (This is detailed here.)
Regarding Arduino ...
1
vote
1
answer
245
views
I can change value of only one register on 8-Bit Register integrated circuit (74hc273 / DM74LS273)?
First, please be patient, I'm not electronical person. I am learning Arduino and electronics for hobby and this is my fist time with integrated circuits.
Situation: I'm want to extend the Arduino ...
9
votes
5
answers
2k
views
Same structure taking different memory space on Uno and NodeMCU ESP8266, leading to data corruption when transferring via nRF24L01+
I'm trying to transfer data between a Arduino Uno board to a NodeMCU ESP8266 board, using nRF24L01+ transceivers module and RF24 library on both side. The data I'm transferring are stored in a struct ...
1
vote
1
answer
2k
views
nRF52 non-volatile storage/recall of a variable - is there a simple solution?
I have an Arduino program written for the nRF52 with which runs for a pre-set time-value (i.e. 2 minutes) before shuts off automatically. The variable time-value can be changed via BLE-write by the ...
0
votes
1
answer
134
views
Global array doesn't get assigned the space it would take up in memory
I have this sketch:
const uint32_t len = 65536;
uint8_t arr[len];
void setup() {}
void loop() {}
The length of the array should fit into the dynamic memory. However, when I compile the sketch it ...
2
votes
0
answers
653
views
How to adjust Partition Scheme Wemos D1 mini pro?
I bought myself a WEMOS D1 mini PRO (16MB) for creating a quite large project.
As I'm writing code, my memory is starting to grow.
When I looked at the Flash size in Arduino IDE, the only options I ...
1
vote
1
answer
3k
views
converting an unsigned integer into a const char pointer
I know this is simple basic C stuff, but I can't quite figure it out or find a solution when searching and reading.
I have a method I want to call from a library that wants a const char pointer
...
2
votes
1
answer
488
views
What happens when you call malloc()/free()/new/delete?
So I understand that generally speaking, dynamic allocation should be avoided. My question isn't how or why, but what happens when you call a function that allocates memory?
On Windows or Linux, when ...
4
votes
1
answer
617
views
Does the compiled binary of a sketch include uncalled functions from a library?
I am writing a GUI using a TFT display and the Adafruit GFX library and its default font on Arduino Nano.
I want to be memory efficient and I assumed that the 'optimise for size' default setting of ...
1
vote
1
answer
1k
views
Why isn't this EEPROM.get() working?
I am trying to save a string/char to EEPROM with EEPROM.put() and then get the value, but it doesn't work and I get a blank value when I do a EEPROM.get().
I remember this is how it worked on arduino ...
2
votes
1
answer
364
views
Connect SDRAM to STM32
Well, first of all hello to everything and thanks for reading my question. I am designing a board with STM32F730R8T6 MCU, and I want to connect MT48LC16M16A2P-6A to it which is 4MB SDRAM chip. The ...
1
vote
0
answers
316
views
ESP8266 NodeMCU running out of heap
I'm trying to create SMS alarm using Twilio, Firebase and Arduino IDE. Using sensors I am measuring the temperature. If the temperature is higher than a specified value (ESP reads that value from ...
2
votes
1
answer
503
views
Branchless programing on arduino?
So I've been looking into branchless programming to speed up code and I'm curious as to how exactly Arduino (or rather atmega328) actually reads machine instructions. Does it have a memory cache or ...
0
votes
1
answer
830
views
Connect two SD cards to one Arduino board and copy from one to another
I'm trying to connect 2 SD cards to an Arduino Uno board.
My first question is: Is it possible to connect two SD cards to one Arduino simultaneously?
The second question is: If it is possible to ...
1
vote
1
answer
295
views
Junk values in EEPROM. while writing large values
Facing an issue while writing a large value (like 2000-5000) to EEPROM using EEPROM.put().
For example, While writing 2000 values to address 5 of EEPROM. Some junk values are written automatically to ...
-1
votes
1
answer
355
views
EEPROM not consistent over reboot
I'am using a Wemos D1 mini V3.0.0 (esp 8266 core).
I tried to save a structure in EEPROM memory but all data are lost when i reboot the board.
I am using these basics functions :
int cle_verif = ...
0
votes
3
answers
5k
views
How to fix memory-leak code in ESP8266/NodeMCU caused by string concenation?
I have following code in loop() in NodeMCU.
This part is before setup():
String serial_data_read = ""; // for incoming serial string data
String serial_data = ""; // for incoming serial string ...