We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [flash]

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.

Filter by
Sorted by
Tagged with
28
votes
4answers
72k views

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 ...
15
votes
6answers
50k views

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 ...
8
votes
3answers
8k views

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 ...
7
votes
4answers
4k views

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 ...
6
votes
5answers
2k views

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 ...
5
votes
2answers
4k views

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 ...
5
votes
2answers
880 views

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? ...
5
votes
2answers
1k views

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 ...
5
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 ...
4
votes
3answers
2k views

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 ...
4
votes
1answer
1k views

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[] =...
3
votes
2answers
915 views

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 ...
3
votes
2answers
8k views

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 ...
3
votes
1answer
179 views

Flashing an ATtiny85 with a NodeMCU?

I recently purchased a Digispark for some of my smaller electronics projects. After it initially being a great little board, I soon found myself unable to flash the board in the same way I had done ...
3
votes
2answers
5k views

How to read/write variables persistenly on Arduino Due (no EEPROM/shield)?

I am relatively new to Arduino and I am currently writing some code to control a relay board. The on/off times are provided by the user at run-time and should be stored persistently (EEPROM or flash) ...
2
votes
2answers
221 views

EEPROM.get returns bad data

I am using the attached code. What I am trying to do is: Test if there is a personalized "board serial number" written in the EEPROM (by previous code run) If data found was not 7 characters (e.g SN-...
2
votes
3answers
1k views

Is it possible to use extra AVR Flash memory as non-volatile EEPROM-like Flash memory storage?

In STM32 microcontrollers it is possible to use a technique that ST calls IAP, or In-Application Programming, in order to write to the Flash memory from your running application. They even have a nice ...
2
votes
3answers
2k views

Wrong data from DS18B20 temperature sensor after long power off

I have my Arduino Uno connected to the PC via USB when prototyping. I am developing a thermometer with memory, using DS18B20 sensors. When PC is shut down, there is no power on the USB and the ...
2
votes
1answer
111 views

AVR-GCC can't call function located on fixed address

I wrote the following code: #include <avr/io.h> __attribute__((noinline, section(".app_start"))) void app_start() //app_start section starts at 0xFA0 { //register_packet_dispatch(...
2
votes
2answers
3k views

Trying to flash ESP8266 with Arduino UNO

This is my first project other than some of the starter projects. I am trying to flash the firmware onto an ESP8266 wifi module using and arduino uno. It would be nice to know if anything is wrong/...
2
votes
1answer
495 views

What protocols and tools does Arduino Due use for flashing and debugging?

I am interested in writing a simple C program outside of the Arduino IDE and respective libraries, but deploying it directly to an Arduino Due (which uses a SAM3X8E ARM MCU). I am trying to figure out ...
2
votes
1answer
46 views

Is it possible to execute a code in runtime when gets updated over the air (OTA)?

I would like to build a lib like ArduinoOTA but with no downtime at runtime. To achieve that I am wondering if it is possible to create a simple setup and loop code to Check for new releases If we ...
2
votes
3answers
2k views

External Flash Memory for ATtiny85

I'm designing a lightweight circuit, but the ATtiny85 micro-controller I'm using to power it doesn't have nearly enough flash memory to store the code for the devices I'll have hooked up to it (It has ...
2
votes
1answer
1k views

Arduino EEPROM retains old data after flashing with a new program

I have a custom 5V 16Mhz Arduino Uno (a breadboard Uno of sorts) that runs the grbl firmware. After the initial flashing I can see all the settings (through the serial monitor) and everything works. ...
2
votes
2answers
81 views

ESP8266 seems to be bricked , how to recover?

In a part of my sketch I put by mistake pinMode(7,INPUT_PULLUP); Which is dedicated pin for external flash chip (gpio7/SDIO_DATA_0/SPI_MISO) that not supposed to use for sketch. after uploading ...
2
votes
1answer
6k views

String to persistent memory (EEPROM?)

I am creating a server node that I want to be able to save the wifi SSID and the password into persistent memory so that when it starts ups it can connect to the network. I have looked for several ...
2
votes
1answer
880 views

Better method for PROGMEM data access with multiple indirection?

-edit- This is a simplified recreation of personal learning project I have ongoing. My issue is in accessing data in flash, the path to which includes multiple layers of indirection. When the data ...
2
votes
2answers
392 views

How do I implement a userspace bootloader on Arduino Due?

Is it possible to use a custom bootloader, that loads and executes a main program stored for example on an SD card? The idea is to make it possible to update the Arduino remotely. I tried this with a ...
2
votes
0answers
2k views

ESP-01 not running custom firmware

I have two esp-01 micro controllers that I'm trying to flash using the Arduino IDE but found some problems in the process. I followed step 1 of this tutorial to install all the dependencies to the IDE....
2
votes
0answers
260 views

Software flashing attiny167 from RPi with avrdude

I am trying to flash a program onto an attiny167 (already bootloaded with the micronucleus bootloader) with a Raspberry Pi via avrdude and USB. Background I have 50 Raspberry Pi 3B's connected to an ...
2
votes
0answers
368 views

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 ...
2
votes
1answer
737 views

Unable to upload sketch after bootloader has been flashed on Arduino Micro

I have created my own custom Arduino Micro, but I am experiencing problems when I attempt to upload an sketch via USB in Arduino IDE. Here is how I program the Arduino Micro: avrdude -c ...
1
vote
2answers
61 views

Unusual use of << operator… not a bit shift?

Poking through the example code of SDFS, I saw the following: static ArduinoOutStream cout(Serial); // F stores strings in flash to save RAM cout << F("\ntype any character to start\n"); What ...
1
vote
2answers
778 views

Arduino LED flashes with one button press

I want the LED to flash when I press the switch once, but it keeps flashing. I tried the idea of just lighting the LED and keeping it lit with just one button press, so I wrote: int led=13,button=12; ...
1
vote
2answers
541 views

Error when trying flash bootloader into Arduino Pro Mini 328P 8MHz 3.3V

I tried flash bootloader into Arduino Pro Mini 328P 8MHz/3.3V clone, but got error. First I did test: ~$ avrdude -c usbasp -p m328p avrdude: AVR device initialized and ready to accept instructions ...
1
vote
2answers
383 views

Flash Arduino Micro code on Atmega32U micro controller

First of all, I am not an expert on electronics, so forgive me for asking something which is trivial for probably the most of you. I am trying to get my Arduino (Micro) code running on a custom PCB ...
1
vote
2answers
434 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
1k views

Any way to use F macro with a passed variable?

I want to know if it's possible to use the F() macro on text that is being passed to a function. This is an example function: void displayMenu(const char * txt, byte &var) { lcd.clear(); lcd....
1
vote
1answer
1k views

Flash a .hex to an ATtiny45 with Arduino

I'm trying to upload a hex file to an ATtiny45 with an Arduino. I uploaded the Arduino ISP sketch to my board. I connected the ATtiny as shown below: Then I go to CMD and type: avrdude -c avrisp -p ...
1
vote
2answers
362 views

Arduino memory issue with old HP HDSP-2000 display chips

I'm running into memory issues with an Arduino Nano driving some old HDSP-2000/HDSP-2011 chips. I cannot seem to get the ASCII 5x7 array into PROGMEM and have it read properly. It's so low on memory ...
1
vote
1answer
795 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
145 views

Firmware update for remote situations

We are currently deploying units with the ATMEGA328 chip. Currently, all ICs have been flashed using the Arduino IDE. Upon release, we would like to offer updating of firmware in some cases, but ...
1
vote
1answer
703 views

What is the capability of AVRISP and USBASP on ATMega48, 328, 2560?

For use with ATMega 48 (old Arduino?), 328 (UNO, Pro Mini) and 2560 (Mega2560) chips, what is the capability for the AVRISP and USBASP programmers on: Can it read, write fuse? Can it read, write ...
1
vote
0answers
671 views

Send file from ESP to server via FTP

I've a code which records sound to SD, then starts an FTP connection for a limited time. I want to make an automatic system which records then sends the sound file continuously. Now I'm recording ...
1
vote
0answers
68 views

Erasing all flash on boards with over 64kb of program memory

I'm using a Mega2560 board. My project needs to store some large constant data. To preserve the first 64kb flash chunk, I write these data on addresses beyond this limit. But there is either an ...
1
vote
0answers
104 views

In-application programming for the Arduino Uno

I would like to know if it is possible to read from and write to the microcontroller's (Arduino Uno's ATmega328P) flash memory using a program or "bootloader" previously stored in the flash memory (or ...
1
vote
1answer
691 views

ESP8266 stuck in flash mode?

I have the setup described here: https://learn.adafruit.com/esp8266-temperature-slash-humidity-webserver/wiring I currently have the reset pin set to float and the GPIO0 pin grounded, which should ...
1
vote
1answer
354 views

Connecting Winbond W49F002U-12B to Arduino Mega

I am trying to connect a CMOS flash memory Winbond W49F002U-12B to an Arduino Mega, but failing. What I did: Read the Winbond W49F002U-12B datasheet. The key points are: CE - chip enabled; OE - ...
1
vote
1answer
286 views

Error building Arduino WiShield Flash example: 'dflash' was not declared in this scope

I'm using WiShield library from: https://github.com/jcmuller/WiShield What is wrong with this library? The code: /* * Web Server using Flash * * A simple web server example using the WiShield 2....
0
votes
2answers
191 views

NodeMCU ESP8266 12E loses code after power is reconnected

I have uploaded a simple code to control a 8 channel relay by turning individual relays on and off When I upload the code it works properly, the code works properly and the relays turn on and off in ...