Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [memory]

Use this tag for memory management or issues in programming.

0
votes
2answers
58 views

How to find out the maximum used stack space?

I am creating an Arduino sketch which involves quite some classes, and I want to check if it will run on an Arduino Uno or Mega (2 KB vs 8 KB SRAM). So far my global variables take up around 1,200 ...
1
vote
2answers
47 views

Is new without a delete acceptable?

I know it is not a good practice to use the new command to dynamically create data, however, if I would never use the delete, would it result in memory gaps/other problems? Background The reason I ...
2
votes
1answer
35 views

is PIN To PIN matching mcu against Atmega328P-AU available? [closed]

I want to upgrade my product which is based on Atmega328p-AU, having the problem of programming memory. I don't want to change the PCB of the product. Is PIN To PIN matching MCU against Atmega328P-AU ...
0
votes
1answer
46 views

Read nested array item from PROGMEM

I have a 2D array of uint16_t arrays (IR Remote Codes). Due to the size of this data in RAM I'm having all kinds of trouble when my array is larger than one code. Thus, I have been trying to move this ...
1
vote
0answers
125 views

Cant get rid of Soft WDT reset using ESP8266

Im using ESP12E DevKit v2 (esp8266 wifi module) board for controlling relays and displaying DHT22 temp,humidity on web server. It runs smoothly but after while i always get a watchdog timer reset. (If ...
0
votes
0answers
38 views

Memory management issues with Chars

new to C - I am struggling with a memory management issue which I think is related to the char array variable Cars in the following code. I can run this program once or twice just fine and print my ...
0
votes
1answer
23 views

Can you save data to heap section in Arduino memory?

On normal computers, heap will be cleaned as you close the program, but can I save data to Arduino's heap with malloc function. And will it be cleaned after I power off the Arduino?
0
votes
1answer
40 views

Dynamically modifying the call stack using pointers

In a C++ Arduino library, can we modify the call stack from inside a function by intentionally decrementing a pointer to a stack variable so that it's out of range? Like this: void FooBar() { char ...
0
votes
0answers
42 views

How can I fix a “MbedTLS error -17040” issue with my arduino code on ESP-32?

Despite several days of searching, I can't find any resources to check the MbedTLS error code "-17040". All of the error codes descriptions available are referencing only hex format errors (which the ...
1
vote
1answer
82 views

Arduino Program Memory Ran Out

I have a Arduino sketch I made and I have run out of dynamic memory on my Arduino Nano. How could I possibly reduce the amount of memory the program takes? (I'm not that good at this stuff) P.S: The ...
0
votes
1answer
56 views

CPU information on Arduino Serial Monitor

how to show the CPU temperature, CPU usage (percentage) and the memory usage(percentage) in Arduino Serial Monitor.
1
vote
2answers
132 views

Expand Arduino storage without an SD card [closed]

I'd like to have my Arduino write some files and store them somewhere. They won't be big files, but the 1Mb available on the device won't be enough. I know an SD card is the popular solution, but the ...
1
vote
2answers
98 views

Arduino write to memory and self shut down (over MOSFET) - An idea help

i would like to ask you for help with design of an circuit. I have and atmega328p, with detection for voltage on its Vin (Vcc). I have made and voltage divider and its output i connected to Analog ...
-1
votes
2answers
68 views

ATmega328, arduino nano v3 code error saying insufficient ram memory [closed]

the code error says this and im not sure what to do please i need urgent help :(` // Easy bluetooth controlled scrolling text // by Yoruk for Instructable // 26 02 15 : first code // 03 03 15 : ...
0
votes
1answer
99 views

Is SRAM erased when putting Arduino into sleep_mode_pwr_down?

Question In the interest of reducing power consumption, I am putting the Arduino into sleep mode between taking sensor readings. However, the data from readings are stored in arrays, and must not be ...
0
votes
2answers
140 views

freeMemory() function from memoryfree library not returning decreased value in arduino UNO

I burned the code written below, I expect that as we declare the local variable in the loop, freeMemory() function should return decreased value. But it remains constant..! please explain why..? The ...
0
votes
1answer
27 views

MemoryFree library showing Irregular Behaviour..!

I simply burned the code written below but it is showing me irregular behaviour.. as in output's last paragraph, free memory increases after a runtime allocation, how it is possible? The output is ...
0
votes
1answer
64 views

Memory chip for arduino

I know that you can't expand your ram because it is intern. But I want a extern memory chip (1024KBytes) that is very fast. I know that I need a library to access information on this chip. And ...
0
votes
3answers
72 views

storage problem

I made a Arduino program to control my air conditioner(model:GREE Lomo) by PC. I download IRremote library from here for that. #include "IRremote.h" IRsend irsend; int irPin = 3; // pin IR led int ...
1
vote
1answer
77 views

Which platform is better to debug Arduino memory problems? Linux or Windows?

I am developing a product. I developed every module in the firmware individually. Now I am integrating them but getting memory issues. I am not able to see how the memory is allocated inside the MCU ...
3
votes
2answers
566 views

Locally declared variable takes up global variable space in dynamic memory/SRAM

I'm trying to make my Arduino Uno control the air conditioner by recording the raw IR signal of several of the AC remotes temperatures using AnalysisIR. However these IR codes are quite long (array ...
1
vote
1answer
27 views

Runtime Error when using array of structs of unknown size as variable within class - some kind of overflow issue?

I have a class defined as below, it's basically a simple ring buffer, with some methods for getting useful statistics from the data held in the buffer. enum BalanceMsgType{ BAL_MSG_NOT = 0, ...
0
votes
0answers
62 views

Question about memory allocation analysis

As I'm experiencing weird bugs in a rather lengthy project, I started analyzing my RAM usage on my ATMEGA328P with Arduino bootloader. At least I tried to and wrote the following piece of code. ...
0
votes
1answer
173 views

How to read main code inside main code in Arduino?

How can I read the hex code of the main programme stored inside flash memory inside my running Arduino programme? So far I am able to read the Flash at any given address by using PROGMEM unsigned ...
0
votes
1answer
421 views

How do string pointers work in Arduino?

To the best of my understanding, when I declare String s = "This is a string."; what happens is that space is allocated on the stack for a pointer which points to some String object which internally ...
6
votes
3answers
1k views

When to use PROGMEM?

I believe PROGMEM is used to store large data (e.g. strings) that don't change. So it frees up the SRAM. in the Ardunio Reference it is mentioned that. "Using PROGMEM is also a two-step procedure. ...
0
votes
0answers
100 views

Lighting up long led strip no longer works when my code grows

I have a 144 LED strip - Adafruit NeoPixel Digital RGB LED Strip 144 LED, link here: https://www.adafruit.com/product/1507 If I create a simple project, eg turning pixels on off from the serial ...
1
vote
1answer
420 views

Does the StringObject.reserve() function prevent memory fragmentation/leaks?

I'm currently writing and testing a professional Arduino application, I'm aware of the dangers of using the String class, so I began to implement C-style strings in some places, but it's just way ...
0
votes
1answer
24 views

Use Mac for memory & processing

I understand that each model of Arduino has limited cpu, ram, etc. However, I have this very powerful Mac that it’s hooked up to. Am i able to use my Mac for expensive computation and just pass ...
3
votes
2answers
709 views

Using SD shield for extra external memory?

I am an Arduino beginner and I am planning to make a musical instrument with it. I want to add record and playback functionalities into the instrument. I figure I will have to store lots of data to ...
1
vote
3answers
94 views

SoftwareSerial runs out of “text” space on ATtiny

I have an ATtiny and am trying to send a very large byte array stored in a separate .h file over SoftwareSerial: for (int i=0; i<numElements; i++) { softSerial.println(myList[i]); } I imagine ...
2
votes
3answers
552 views

Using malloc() and free() for a stack/linkedlist [closed]

I know this question has been asked before, however it was asked two years ago and I have some other constraints to add. (Previous question here) : Is using malloc() and free() a really bad idea on ...
1
vote
1answer
293 views

Is it possible to read-write the memory of a Gikfun ISD1820 voice recording module?

I just got a Gikfun ISD1820 voice recording module for an Arduino project that I'm working on. I want to be able to record a few seconds message and then send the message over wifi to another Arduino ...
2
votes
3answers
180 views

How do I create global pointers with low memory overhead?

Problem I have a few large objects in my code that need global visibility, but creating them seems to eat up memory significantly faster than simple math would dictate, and furthermore, using them ...
1
vote
2answers
889 views

Const data optimisation for Arduino

I'm taking a course on Arduino Uno programming and on today's talk I heard that the const data is optimized by Arduino, so that it occupies less space than the actual data type (namely, a const int ...
0
votes
2answers
38 views

Issue with length of string value

I have been getting some weird issues with a sketch I put together(apart from memory low warnings, it was working fine) When im about to post data to my php server - it seems not all the information ...
3
votes
2answers
114 views

How to leak function addresses?

I'm doing some security research on FreeRTOS embedded systems and I don't have much information about Arduino. Is there any way to leak function or variable addresses on serial console? I can use avr-...
1
vote
1answer
19 views

Recording of sensor results but only retain the last 3 sets of data

I'm doing a radiation-seeking robot, which will find the source of the radiation autonomously. But in this case, my robot will spin 180 degrees to detect the nearest source of radiation and 1 set of ...
0
votes
2answers
819 views

How to dynamically allocate arrays

Question given in the title. I'm trying to dynamically allocate the size of an array on runtime on an arduino pro micro. I've tried realloc, malloc and the c++ variant delete and new without success. ...
0
votes
2answers
294 views

What are safe memory usage limits?

The Arduino IDE used to warn you when your sketch used too much memory. This warning now seems to have been removed. I compiled a sketch, and was surprised to see it use 175% of data memory...but not ...
1
vote
0answers
382 views

Arduino Uno R3 keeps on resetting within void setup() itself

This problem is very recent as I have run the program (standard SHT10 sensor code) successfully many times. But now, all of a sudden, my program keeps repeating void setup() statements and does not ...
0
votes
3answers
384 views

Arduino constant vs Microchip PIC constant

2.2 THE BASICS OF C PROGRAMMING LANGUAGE book is has like this, CONSTANTS A constant is a number or a character having fixed value that cannot be changed during program execution. Unlike ...
0
votes
2answers
344 views

Executing machine code at runtime Uno

I want to create a small single threaded os for my arduino.The first thing I want to do is to allow my arduino to read a section from flash/eeprom and execute it. I have some question regarding the ...
1
vote
1answer
303 views

Strings becoming empty (Arduino Uno)

I'm running a modifed code on Arduino Uno + WiFi shield (updated), and I have seen strange behaviors with String ; here is my code, the goal is to parse a HTML request to know which page was requested ...
1
vote
1answer
366 views

Arduino eeprom_put sketch writes data in two locations?

Using precisely this code - the eeprom_put example in the Arduino IDE, and am seeing some strange results... The sketch does write correctly to eeAddress = 0, and the corresponding eeprom_get sketch ...
0
votes
1answer
2k views

Global memory reduction when using SPI/SD

I want to use an SD card and when including the library both SPI.h and SD.h are included. Also later I want to use an external SRAM chip (probably using SPI.h as well). However, without the SRAM chip ...
6
votes
3answers
2k views

External Flash Memory File System

I'm building a weather data collector and I want to be able to dump that weather data somewhere. I've considered the options, and since I'm going to be storing a fairly small amount of data (in the ...
3
votes
2answers
3k views

Arduino String memory allocation

When a String variable is declared and modified inside a function, where does it go? To the heap(as string declaration is a part of dynamic memory allocation) or to the stack(as it is a part of ...
2
votes
1answer
946 views

Arduino Nano memory issue. SD card and LCD screen together

When i am uploading my code to arduino nano, i am getting message about high dynamic memory usage (87%): Sketch uses 17,628 bytes (57%) of program storage space. Maximum is 30,720 bytes. Global ...
0
votes
1answer
288 views

Using PROGMEM in constructor

Is it safe to use PROGMEM variable like dynamically allocated memory (a pointer to PROGMEM variable which is out of scope). I need this so I can generate a variable size (before compilation), ...