Questions tagged [progmem]
PROGMEM is a keyword used when declaring a variable that keeps the data in flash instead of copying it into SRAM. It is part of the `pgmspace.h` library. Use this tag for discussions about using this attribute.
66 questions
1
vote
2
answers
176
views
How to manage mixed pointers to RAM and PROGMEM on Arduino?
I'm working on a project where I want to implement something like a FORTH interpreter on Arduino. The interpreter consists of "WORDS," where each WORD has a name, a header, and an array of ...
-1
votes
1
answer
215
views
How do I fix display showing random pixels on ST7789V2 LCD Module?
Problem Description:
I’m trying to interface a Waveshare 1.69-inch LCD module (ST7789V2 driver, 240x280 resolution) with an Arduino UNO board. I’ve connected all the necessary ports as per the ...
-1
votes
1
answer
326
views
Large arrays crash the arduino
I have three large PROGMEM arrays, in order to store musical notes for a song. One array is the notes, one is the note durations, and one is the pause after the note.
The first array is an int one and ...
2
votes
2
answers
487
views
PlatformIO and const PROGMEM
I'm using the DuinoWitchery LCD library (https://github.com/duinoWitchery/hd44780) in a PlatformIO Arduino project with CLion.
The following code works if I stick it in main.cpp:
// near top of class.....
-1
votes
1
answer
128
views
Can I use [[__progmem__]] instead of PROGMEM?
In pgmspace.h, PROGMEM is defined as __ATTR_PROGMEM__, which is defined as __attribute__((__progmem__)). AFAIK, __attribute__ is GNU only. Since C++ 11, we have the attribute specifier sequence.
I can'...
5
votes
4
answers
1k
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 ...
1
vote
2
answers
519
views
Is there a good reference for Arduino Due memory architecture and usage?
It's been harder than I expected to find a reference source or usage guide.
There's a number of sources I've looked at along the road to this question:
The Due is listed here and here as having 512KB ...
0
votes
1
answer
107
views
Send a 2d PROGMEM array over SoftwareSerial
I have a 2d array:
const byte messages_for_measurement[2][8] PROGMEM =
{
{ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 },
{ 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10 },
};
I want to send ...
1
vote
1
answer
1k
views
Read bytes from PROGMEM array
Disclaimer: I just started using C++ and I'm a bit of a beginner. Keep that in mind as your answering.
So I recently bought my first Arduino. It's a customized one and it has an 8x8 display attached ...
1
vote
2
answers
959
views
Printing elements of char array from PROGMEM
Given:
const char* PROGMEM names[] = {"Foo","Bar"};
Serial.print(names[0]);
I get garbage output. Is there some function that will print the string from PROGMEM? E.G.:
Serial.print(<function name&...
0
votes
1
answer
140
views
strcpy_P increases IROM usage by 400%
Using ESP8266 (NodeMcu 1) in Arduino IDE:
I can't upload my sketch because a single call to strcpy_P seems to increase the IROM usage by about 400%: 25% total usage without the call, 100+% with the ...
3
votes
2
answers
765
views
PROGMEM : pgm_read_float_near() equivalent for double? (Arduino Due)
I'm using an Arduino Due where double have a size of 8 bytes. In my software, I use double table const stored in prog memory, I was using an UNO before and used pgm_read_float_near() to retrieve these ...
0
votes
2
answers
1k
views
Initialize object with PROGMEM constants
I have a class which has a const char * property:
class A
{
public:
const PROGMEM char* text;
};
void setup()
{
// A a{"Hello World!"};
// A a{PSTR("...
0
votes
1
answer
2k
views
ESP8266 compilation error: "previous declaration of 'HTTPMethod HTTP_HEAD'"
I have an ESP8266 program that used to work but is now failing to compile with this error:
C:\...\Arduino\libraries\WiFiManager/WiFiManager.h:25:24: note: in expansion of macro 'PROGMEM'
const ...
0
votes
1
answer
2k
views
Use of progmem in ESP8266 vs AVR and also how to handle large dynamic strings
This is a somewhat tricky question dealing with implementation and best-practices of the ESP8266. I'd ideally hope that it's answered by people with in-depth knowledge on the problem.
As you are ...