0

We have been working on a project to get e-paper displays work with Raspberry Pi Pico board. We already managed to get everything working with ESP8266-board, but for power consuming reasons we would like to use Pico. E-paper display what we use is Waveshare 2.9" SPI.

We are trying to use this library: https://github.com/ZinggJM/GxEPD2

It works well with ESP8266, has someone managed to get it working also with Raspberry Pi Pico, and if so, could you provide any tips to get it working with Pico? Please find attached error message what we receive.

Error message screenshot

This is error message That I get:

Arduino: 1.8.13 (Windows 10), Board: "Raspberry Pi Pico, Serial, None"

C:\Users\   \Documents\Arduino\libraries\GxEPD2\src\GxEPD2_EPD.cpp:17:10: fatal error: pgmspace.h: No such file or directory

   17 | #include <pgmspace.h>
      |          ^~~~~~~~~~~~

compilation terminated.
exit status 1
Error compiling for board Raspberry Pi Pico.

Lines below from this file GxEPD2_EPD.cpp:17:10:

14 #if defined(ESP8266) || defined(ESP32) 
15 #include <pgmspace.h>
16 #else
17 #include <avr/pgmspace.h>
18  #endif
Clifford
  • 88,407
  • 13
  • 85
  • 165
avaa.tech
  • 1
  • 2
  • How did you flash the ESP and how are you flashing the pico? Your error message shows that your compiler can't find the right includes. Also please add your error message as text – Michael Kotzjan Mar 26 '21 at 09:48
  • I did flash both with arduino ide Only thing what i changed was board. PICO -> Board = "Raspberry pi pico" Library=(Raspberry pi RP2040(0.9.5) ESP -> Board = "NodeMCU 1.0" Library=(ESP2866 Borads (2.7.4) – avaa.tech Mar 26 '21 at 10:50
  • These kind of questions regarding how to get various pre-made hobbyist stuff to mix is probably more suitable for https://raspberrypi.stackexchange.com/. – Lundin Mar 26 '21 at 11:51
  • How did you install the Pico board in Arduino IDE? I thought this wasn't released yet?? – PMF Mar 26 '21 at 12:22
  • 2
    Following this: https://github.com/earlephilhower/arduino-pico – avaa.tech Mar 26 '21 at 13:19
  • Even if your display is not the Pico specific one at https://www.waveshare.com/wiki/Pico-ePaper-2.9 I imagine the demo code provided will work and will be easier than porting code form another platform. The code included the EPD driver described at https://www.waveshare.com/wiki/Pico-ePaper-2.9 – Clifford Mar 26 '21 at 16:13

1 Answers1

0

The header it doesn't find is pgmspace.h, which is the support for accessing the program memory on AVR based arduinos (which use a Harvard memory model). This is not required for most 32bit based CPUs, since they have a flat von-Neumann memory model. Many other 32bit boards (such as the one for the Arduino Due or the ESP32) include a dummy header file to mimic the AVR behavior. Since these are nothing but replacement macros, you might be able to use the implementation of the Arduino Due (which is conceptionally very close to the Raspberry Pico). The definition is here.

PMF
  • 14,535
  • 3
  • 23
  • 49