Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pgmspace.h: No such file or directory for Raspberry Pi Pico #259

Closed
ghost opened this issue Jan 10, 2023 · 5 comments · May be fixed by #261
Closed

pgmspace.h: No such file or directory for Raspberry Pi Pico #259

ghost opened this issue Jan 10, 2023 · 5 comments · May be fixed by #261

Comments

@ghost
Copy link

ghost commented Jan 10, 2023

  • Arduino board: Raspberry Pi Pico
  • Arduino IDE version: 2.0.3
  • Using Arduino Mbed OS RP2040 Boards (installed from Arduino's board manager) to program the Pico

The error I get when trying to compile the example file "ssd1306_128x64_12c" is the following:

Adafruit_SSD1306.cpp:42:10: fatal error: pgmspace.h: No such file or directory

Lines 39-42 of such cpp file looks like this:
#ifdef AVR
#include <avr/pgmspace.h>
#elif defined(ESP8266) || defined(ESP32) || defined(ARDUINO_ARCH_RP2040)
#include <pgmspace.h>

If I modify line 42 like this:
#include <avr/pgmspace.h>
then the sketch compiles and works as expected.

So it seems that the Pico uses the avr pgmspace, maybe this can be modified in the cpp file
Thanks!

@cscott
Copy link

cscott commented Jan 24, 2023

It works fine if you use version 2.5.1 fwiw:

lib_deps = 
	adafruit/Adafruit [email protected]

(Don't use the ^ symbol after the @ sign or it will use "a version compatible with 2.5.1" and it thinks that 2.5.2 and above are "compatible".)

@cscott
Copy link

cscott commented Jan 24, 2023

Seems like 3fb7221 is at fault; they added support for the RP2040 Feather and somehow broke the RP2040 pico in the process.

cscott added a commit to cscott/Adafruit_SSD1306 that referenced this issue Jan 24, 2023
@germtown
Copy link

Switching to 2.5.1 (from 2.5.7) worked for me to get things building, I feel lucky this was my first search result!

@jptp13
Copy link

jptp13 commented May 19, 2024

Hi
Same issue for Arduino Nano ESP32
"Compilation error: avr/pgmspace.h: No such file or directory"
Any workaround?
Thanks

@ladyada
Copy link
Member

ladyada commented Oct 28, 2024

merged!

@ladyada ladyada closed this as completed Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants