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
0answers
26 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
21 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
34 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
32 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
0answers
57 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
47 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
110 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
85 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
65 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
80 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
99 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
60 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
70 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
76 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 ...
0
votes
0answers
40 views

Programming parallel FRam with Arduino mega?

I'm looking to program a FM28V100 on an Arduino mega. It is supposed to behave like SRAM (see datasheet: http://www.cypress.com/file/136646/download) Are there any libraries I could use? I looked ...
3
votes
2answers
532 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
26 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
58 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
171 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
327 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 ...
5
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
33 views

Code stops working after adding libraries

Here is a brief description of the project I am working on before I get into the problem. A Love-O-Meter project (not similar to the Arduino example), using 2 pulse sensors to measure the heartbeat, ...
0
votes
0answers
86 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
336 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
606 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
84 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
504 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
266 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
148 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
768 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
109 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
709 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
248 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
353 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
299 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
315 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
282 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
345 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
1k 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 ...
5
votes
3answers
1k 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 ...
2
votes
2answers
2k 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
866 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
267 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), ...
0
votes
1answer
266 views

Reading a 10-byte buffer out of a PROGMEM string stored in a string table

I'm storing a large snippet of text in three separate PROGMEM char arrays: const char script1[] PROGMEM = "...."; const char script2[] PROGMEM = "...."; const char script3[] PROGMEM = "...."; The ...
1
vote
1answer
563 views

Storing data on AT24C02 EEPROM chips with Arduino

I have recently come across some 8-pin 128-byte EEPROM chips. I've seen those USB EEPROM chip programmer units, but I was wondering if there is any way I could manually store data on the chip with my ...
1
vote
1answer
823 views

Writing to a SPI memory

Recently I salvaged a BIOS chip (EN25QH16) which has 2 Megabytes of memory (8192 pages, 256 bytes/page). I followed this instructables and it works. I double checked the opcodes because the code is ...