Questions tagged [memory]

Use this tag for memory management or issues in programming.

Filter by
Sorted by
Tagged with
1
vote
0answers
49 views

how to clear heap memory in esp32?

I am using Free RTOS on esp32 in my program. However at some point of time when I execute xTaskCreate() it returns -1 , which error is could_not_allocate_required_memory. In my program, each time i ...
5
votes
1answer
277 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
votes
2answers
68 views

Arduino sketch uses too much memory storage space?

I've never used arduino before but am using one for a school project. I am using an arduino leonardo and I've uploaded the sample code below #include "Adafruit_CCS811.h" Adafruit_CCS811 ccs; ...
1
vote
1answer
54 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 ...
1
vote
2answers
40 views

What happens, memory-wise, when I call a function from another function?

I'm inspecting where the memory is used in an application which runs on Arduino. To my surprise, there are several locations where 100 to 200 bytes are consumed by simply calling a function. Example: ...
2
votes
1answer
55 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
1answer
54 views

External RAM (23LC1024) and external Flash (W25Q64JVSSIQ) with Sparkfun SAMD21

i'm trying to extend the capabilities of the Sparkfun SAMD21. My question is, which pins do I have to share? I mean, I understand that MISO, MOSI and SCK are shared, but CS connects each to a ...
1
vote
0answers
47 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
0answers
39 views

Having a bunch of global variables or calculate them on the go on an Arduino, as far as memory is concerned

So I'm new in the arduino world but I have a grasp of object oriented programming, and decided to write a little library for running games on an arduino mega using a display. My question is, I'm ...
2
votes
1answer
88 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 ...
1
vote
0answers
18 views

Leonardo Board stops reading analog input

I'm currently writing software that reads in analog data, writes it into an instance variable array, then returns the address of the array. However, after a few iterations of loop, the program stops ...
0
votes
1answer
65 views

If the code used for Arduino can be embedded into a permanent , callable memory, is there a way to create an OS for Arduino that runs on call?

This thought came into my mind on thinking about smartwatches. Although those I saw on YouTube are really good, they don't seem to provide a real experience of a real smartwatch - one that has an OS ...
0
votes
1answer
96 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 ...
0
votes
1answer
38 views

What does display.setSegments(&segto, 1, 1); do?

I am using a TM1637 display for my Arduino Uno. The goal was to just light up one point of the colon in the middle - what seems to be kind of impossible to accomplish. During research I stumbled over ...
1
vote
1answer
66 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 ...
2
votes
1answer
53 views

3-instruction remote machine coding Arduino Atmel chip over a serial line from a tethered (host) PC

I'm trying to write a program for AVR Atmel 328 chip on Arduino Nano board that will allow me to send machine code instructions to the chip over a serial line, run/execute them on the chip, and ...
-1
votes
1answer
77 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
2answers
327 views

Serial printing from Flash Memory (F() macro, PROGMEM, sprintf_P, SPTR)

I have been testing on an Arduino UNO various techniques for serial printing from Flash Memory instead of RAM. At the same time, I have been using the freeMemory() function from Adafruit. I created a ...
0
votes
2answers
327 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 ...
3
votes
4answers
622 views

How can a function/method determine if a const array passed in is PROGMEM (flash) or not (RAM)?

Is it possible for a function/method to know if a constant array that has been passed in is in flash or RAM? If I have a method or function that receives a constant array that is in RAM, the array is ...
0
votes
0answers
19 views

Cypress CY15FRAMKIT-002 Serial FRAM with Arduino

I recently bought the CY15FRAMKIT-002 FRAM kit and I wanted to know whether there is an arduino library that supports this kit. So far I could find a library for the CY15FRAMKIT-001, but my guess is ...
1
vote
1answer
97 views

Can stack size be determined by free heap?

i have NodeMCU with es8266 onboard on it. I read heap and stack memory are facing each other and if heap or stack gets full and reachs another strange things happen. So i am wondering if can we use ...
0
votes
2answers
70 views

Unpredictable behavior on parsing key-value delimited input from serial

I am having trouble with a "simple" command parser; I'm guessing I'm doing something wrong with memory allocation - appreciate any pointers :) For context: I'm running on an Arduino Uno (if it ...
0
votes
2answers
362 views

Reading from SPIFFS - What's the best way to deal with a string (or char) array with undefined length?

I've read that it's best to avoid using String in Arduino so I'm ready to use a char array if it's better. I'm reading the file names from an SD Card and my goal is to store them in an array and then ...
1
vote
1answer
292 views

AVR & PIC 8-bit Microcontrollers - Can you add: external flash memory, external RAM, video & audio output, more address busses?

so I was planning on creating a mini PC out of basic ICs and 8-bit microcontrollers such as ATTinys and/or PICs and I have several questions regarding those: Can you add external RAM, say with SRAM, ...
1
vote
3answers
284 views

How to save data in arduino when it's power goes off

I am doing a project 'arduino based switch operation'. Here the user needs to set a time to turn on relay and set time to turn it off. The problem is that I want to supply power to arduino using ...
0
votes
1answer
59 views

I think i worn out all of my Arduino Uno memory

Hi my Arduino Uno stacked with a motor driver shield was working perfectly however I am using the same board for a while now and suddenly my board stopped working. When I upload a code no matter what ...
1
vote
1answer
134 views

Reduce Sketch Size Help!

I dont know what to do? Sketch uses 3712 bytes (12%) of program storage space. Maximum is 30720 bytes. Global variables use 210 bytes (10%) of dynamic memory, leaving 1838 bytes for local variables. ...
1
vote
3answers
94 views

How long will program stay in memory without power?

Let's say we program an arduino uno or nano and then stop using it for a while. How long can we expect the program to last on the arduino?
3
votes
3answers
2k views

Spiffs vs Eeprom on esp8266

In my project, i have some data to save permanently. After some research i got many examples and informations to do that with eeprom. I used it effectively. After all i decide to deep dive to esp8266 ...
0
votes
1answer
67 views

Porting “far” flash memory access from Arduino Mega to Due

I have a project that runs on the Arduino Mega 2560 which takes up almost the complete amount of flash memory available (https://github.com/fredlcore/bsb_lan/blob/master/BSB_lan.ino). Because of this, ...
2
votes
0answers
248 views

why is memcpy of unsigned long killing my sampling speed?

I'm using a Mega 2560 to communicate with a mixture of analog (i.e. measured via analogRead()) and I2C based sensors. Sampled data is placed in a 16 byte array, then written to an SD card once a 512 ...
0
votes
2answers
149 views

How fast is flash reading compared to SRAM?

I'm working on a project that will eventually scale to 864 LEDs on WS2815 LED strips (three rows of 288 LEDs). I'm currently running it on an Arduino Uno with a single test strip of 144 LEDs. FastLED ...
0
votes
1answer
766 views

Is it possible to use WiFi and Bluetooth / BLE in the same ESP32 project?

@Majenko's answer works like a charm. I did have to make some changes as follows: Per Majenko, you need to change the Tools > Partition scheme. I used "No OTA (Large APP) as he suggested and it is ...
3
votes
1answer
89 views

Best way of storing extra data for Arduino project

I am an arduino beginner and I am trying to make a speed camera alert system, it would start beeping if I am above the speed limit and getting close to the speed camera. There is this website where I ...
0
votes
2answers
965 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 ...
0
votes
2answers
83 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
49 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
189 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
411 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
1answer
67 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
323 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 ...
1
vote
1answer
96 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
609 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.
2
votes
2answers
427 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
295 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 ...
0
votes
2answers
80 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 : ...
1
vote
1answer
424 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
643 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
86 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 ...