Flash memory is a type of memory available on the Arduino boards. It can be accessed from a program using PROGMEM directive to store data. For questions about using and accessing flash memory, use this tag.
Questions tagged [flash]
126 questions
30
votes
4 answers
What can I do if I run out of Flash memory or SRAM?
According to the Arduino documentation, the ATmega328 has 32KB of Flash memory for the bootloader + uploaded sketch, and only 2KB SRAM for runtime data. The ATmega2560 has quite a bit more, totalling 256KB and 8KB respectively.
In either case, those…
Peter Bloomfield
- 10,982
- 9
- 48
- 87
15
votes
6 answers
How do I erase the memory of the Arduino Uno?
I'm just a tinkerer learning Arduino with my son and I was surprised that when I plugged the USB cord back in to the Arduino the program was still running and I thought to myself, "it's a good thing I didn't just blow anything up."
So, what's the…
Peter Turner
- 311
- 1
- 2
- 7
9
votes
3 answers
PROGMEM: do I have to copy data from flash to RAM for reading?
I have got some difficulties understanding the memory management.
Arduino documentation says, it is possible to keep constants like strings or whatever I don't want to change during runtime in program memory. I think of it as embedded somewhere in…
Ariser
- 577
- 1
- 8
- 26
8
votes
2 answers
Is it possible to run a binary from EEPROM?
Say I wrote a compiled sketch to EEPROM then read it. Could I run the program from EEPROM? I guess the question is: Can an Arduino run software not in flash memory in the middle of executing the software in flash?
Piper McCorkle
- 183
- 1
- 5
8
votes
4 answers
Where can I find out how to make a hex file for arduino firmware?
I have followed this tutorial on flashing my Arduino R3 to turn it into a "USB keyboard", but the article doesn't explain how the hex works, it's just for granted. Where can I learn about how to make my own hex file so that I can learn how to make…
trusktr
- 181
- 1
- 3
6
votes
5 answers
What happens if you write >10000 times to the flash memory of an ATmega?
I realized that I'm uploading code every 5 minutes and doing relatively intensive trial-and-error development, and that this habit could cause problems down the road, especially if I'm working on a custom board (non-Arduino) where the chip isn't…
user8437812
- 185
- 1
- 6
5
votes
4 answers
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 declared like this: const uint8_t MY_ARRAY[] = {…
Casey
- 151
- 6
5
votes
2 answers
What are the FLASH_ARRAY/FLASH_TABLE macros in this code?
In this code for heating monitor, there appears to be macros called FLASH_ARRAY and FLASH_TABLE. I can't find any reference to them either in this code, Arduino, or on the Internet. What do they do?
FLASH_ARRAY(byte, VARIABLE_DEVICE_TABLE,
…
Cybergibbons
- 5,420
- 7
- 34
- 51
5
votes
3 answers
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 megabyte range) I don't want to use SD cards (also…
Carrot M
- 86
- 1
- 6
5
votes
3 answers
Set EEPROM from PC before program
I have been working on an arduino program, which has gotten rather large. I am close to hitting the 32k limit on Flash for my ATmega328p. I would like lower my program size by saving some of my many string literals into EEPROM.
All of the example…
riverrun
- 85
- 1
- 4
5
votes
2 answers
Using PROGMEM to store array of structs
I am hitting the limits of my arduino's SRAM and found that SRAM usage can be reduced by storing static stuff in flash memory instead of SRAM.
My project can (optionally) be built with an included SimulatorClass. I use this to 'playback' data at…
Alex
- 181
- 2
- 3
- 9
5
votes
2 answers
Store floats in and reading them from flash
How do I store floats in flash and how do I read them from there? (I need a look-up table for pairs of float values.)
The storing part doesn't seem to be so difficult as this compiles:
PROGMEM float value1 = 1.23456;
But how do I read them? Do I…
fuenfundachtzig
- 1,535
- 1
- 14
- 26
4
votes
1 answer
Flash String Helper object as variable
So I have a Bunch of commonly used char arrays to build commands in my library.
So to preserve memory, I have them put into flash, via PROGMEM ext,
typedef const char PROGMEM ProgChar;
ProgChar AT[] = "AT";
ProgChar AT_RST[] = "RST";
Then in my…
Steven Venham
- 161
- 7
4
votes
2 answers
What programming practices should be adopted while coding sketches for Arduino?
What are some of the best programming practices that can be adopted while coding sketches for Arduino, so that it uses the least memory and performance should not suffer from memory outage, and still the code be robust?
From the link:…
Ciasto piekarz
- 575
- 3
- 12
- 28
4
votes
1 answer
Flash Arduino Due via UART
I would like to write code in Arduino language, compile it in the Arduino IDE, grab the resulting binary code, and flash it to the Due via the TX/RX UART pins, bypassing both the USB Programming Port and Atmel16U2 chip. Before the UART flash, I am…
fillybrese
- 41
- 1