Sd2PinMap.h:371:2: error: #error Architecture or board not supported.

I'm trying to get the https://github.com/adafruit/Adafruit_EPD library working with my Adafruit Feather HUZZAH ESP8266 + Featherwing 2.13" Tri-color display.

When verifying the code https://github.com/adafruit/Adafruit_EPD/blob/master/examples/EPDTest/EPDTest.ino via Arduino IDE 1.8.9, I get error:

In file included from C:\Users\...\Documents\Arduino\libraries\SD/utility/Sd2Card.h:26:0,

                 from C:\Users\...\Documents\Arduino\libraries\SD/utility/SdFat.h:29,

                 from C:\Users\...\Documents\Arduino\libraries\SD/SD.h:25,

                 from C:\Users\...\Documents\Arduino\ESP8266HUZZAH_epd\ESP8266HUZZAH_epd.ino:10:

C:\Users\...\Documents\Arduino\libraries\SD/utility/Sd2PinMap.h:371:2: error: #error Architecture or board not supported.

 #error Architecture or board not supported.

  ^

exit status 1
Error compiling for board Adafruit Feather HUZZAH ESP8266.

I'm using the Adafruit SD library from here: https://github.com/adafruit/SD So I'm not sure why the ESP8266 board would not be supported.

What could be the problem?

edanweis:
I’m not sure why the ESP8266 board would not be supported.

What could be the problem?

Look at the date stamps on the files in the repository. The ESP8266 didn’t even exist the last time any significant development was done on that library. The ESP8266 core for Arduino comes with its own SD library. Try deleting C:\Users…\Documents\Arduino\libraries\SD and see whether that fixes your problem.

Good point, I didn’t think it was so old! I have swapped the SD library for the esp8266/Arduino shim version.

But now I get the error:

C:\Users\...\Arduino\libraries\SDFS\src/FatLib/FatFile.h:979:7: error: redefinition of 'class fs::File'

 class File : public StreamFile<FatFile, uint32_t> {

       ^

In file included from C:\Users\...\Arduino\libraries\SD/SD.h:24:0,

                 from C:\Users\...\Arduino\ESP8266HUZZAH_epd\ESP8266HUZZAH_epd.ino:10:

Is there a package manager to manage libraries for Arduino like npm for js?

edanweis:
I have swapped the SD library for the esp8266/Arduino shim version.

Nooo! I didn’t tell you to install a new library. You already have the SD library installed. It’s bundled with the ESP8266 core for Arduino. Please delete C:\Users…\Arduino\libraries\SD and try compiling again.

edanweis:
Is there a package manager to manage libraries for Arduino like npm for js?

Yes, it’s called Arduino Library Manager. You can open it at Sketch > Include Library > Manage Libraries…. However, in the case of the libraries bundled with hardware packages like ESP8266 core for Arduino, the whole package, with bundled libraries is all managed together. This makes sense because you know the bundled library will have been tested for that specific package version. If you do what you did and install a library from the tip of the branch and use it with an older version of the core, you have no guarantee they will be compatible. Hardware packages are managed via Arduino Boards Manager, which you will find at Tools > Board > Boards Manager.

Ooops! OK I deleted the SD directory and re-installed the esp8266 version 2.5 via the board manager (just in case it would rewrite some libraries I may have previously deleted manually).

But now I see the error below.

:\Users\...\Documents\Arduino\ESP8266HUZZAH_epd\ESP8266HUZZAH_epd.ino: In function 'bool bmpDraw(char*, int16_t, int16_t)':

ESP8266HUZZAH_epd:234:19: error: 'class Adafruit_IL0373' has no member named 'writePixel'

               epd.writePixel(col, row, c);

                   ^

Multiple libraries were found for "SPI.h"
 Used: C:\Users\...\Documents\Arduino\libraries\SPI
 Not used: C:\Users\...\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\libraries\SPI
exit status 1
'class Adafruit_IL0373' has no member named 'writePixel'

I've search through the entire Arduino libraries folder for writePixel and I can't find this anywhere.

Then I tried to compile the existing library example EPDTest.ino but got even more errors:

c:/users/.../appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\EPDTest.ino.cpp.o:(.text._Z12testdrawtextPct+0x4): undefined reference to `Adafruit_GFX::setCursor(short, short)'

c:/users/.../appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\EPDTest.ino.cpp.o:(.text._Z12testdrawtextPct+0x8): undefined reference to `Adafruit_GFX::setTextColor(unsigned short)'

c:/users/.../appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\EPDTest.ino.cpp.o:(.text._Z12testdrawtextPct+0xc): undefined reference to `Adafruit_GFX::setTextWrap(unsigned char)'

c:/users/.../appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\EPDTest.ino.cpp.o: in function `testdrawtext(char*, unsigned short)':

C:\Users\...\Documents\Arduino\libraries\Adafruit_EPD\examples\EPDTest/EPDTest.ino:84: undefined reference to `Adafruit_GFX::setCursor(short, short)'

c:/users/.../appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\...\Documents\Arduino\libraries\Adafruit_EPD\examples\EPDTest/EPDTest.ino:84: undefined reference to `Adafruit_GFX::setTextColor(unsigned short)'

... lots more of these.

c:/users/.../appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\Adafruit_EPD\Adafruit_IL0373.cpp.o:(.rodata._ZTV15Adafruit_IL0373[vtable for Adafruit_IL0373]+0x1c): undefined reference to `Adafruit_GFX::drawFastVLine(short, short, short, unsigned short)'

c:/users/.../appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\Adafruit_EPD\Adafruit_IL0373.cpp.o:(.rodata._ZTV15Adafruit_IL0373[vtable for Adafruit_IL0373]+0x20): undefined reference to `Adafruit_GFX::drawFastHLine(short, short, short, unsigned short)'

c:/users/.../appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\Adafruit_EPD\Adafruit_IL0373.cpp.o:(.rodata._ZTV15Adafruit_IL0373[vtable for Adafruit_IL0373]+0x24): undefined reference to `Adafruit_GFX::drawRect(short, short, short, short, unsigned short)'

c:/users/.../appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\Adafruit_EPD\Adafruit_IL0373.cpp.o:(.rodata._ZTV15Adafruit_IL0373[vtable for Adafruit_IL0373]+0x28): undefined reference to `Adafruit_GFX::fillRect(short, short, short, short, unsigned short)'

c:/users/.../appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\Adafruit_EPD\Adafruit_IL0373.cpp.o:(.rodata._ZTV15Adafruit_IL0373[vtable for Adafruit_IL0373]+0x2c): undefined reference to `Adafruit_GFX::fillScreen(unsigned short)'

c:/users/.../appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\Adafruit_EPD\Adafruit_IL0373.cpp.o:(.rodata._ZTV15Adafruit_IL0373[vtable for Adafruit_IL0373]+0x30): undefined reference to `Adafruit_GFX::invertDisplay(unsigned char)'

c:/users/.../appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\Adafruit_EPD\Adafruit_IL0373.cpp.o:(.rodata._ZTV15Adafruit_IL0373[vtable for Adafruit_IL0373]+0x34): undefined reference to `Adafruit_GFX::newColor(unsigned char, unsigned char, unsigned char)'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Adafruit Feather HUZZAH ESP8266.

edanweis:
I’ve search through the entire Arduino libraries folder for writePixel and I can’t find this anywhere.

That’s because it’s inherited from the Adafruit GFX library’s Adafruit_GFX class:

edanweis:

c:/users/.../appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\EPDTest.ino.cpp.o:(.text._Z12testdrawtextPct+0x4): undefined reference to `Adafruit_GFX::setCursor(short, short)'

I suspect you messed up the installation of the Adafruit GFX library somehow. The first step is to delete your current installation of the Adafruit GFX library. The output you posted doesn’t show the location of that folder. If you don’t know where it is, try this:

  • File > Preferences
  • Check the box next to “Show verbose output during: compilation”.
  • Click the “OK” button.
  • Sketch > Verify/Compile
  • After the compilation finishes, examine the contents of the black console window at the bottom of the Arduino IDE window. It should show the path of all the libraries that are used by the sketch.

After that, install a fresh copy of the Adafruit GFX library:

  • Sketch > Include Library > Manage libraries…
  • Wait for download to finish.
  • In the “Filter your search…” box, type “adafruit gfx”.
  • In the search results, click on “Adafruit GFX Library by Adafruit”.
  • Click the “Install” button.
  • Wait for the installation to finish.
  • Click the “Close” button.

That should fix the errors when compiling the Adafruit EPD library’s EPDTest example sketch as well as the error about writePixel().

Thanks! that works now.

You're welcome. I'm glad to hear it's working now. Enjoy! Per

For the ESP32, the two libraries I found that work very well are the u8g2 library and the GxEPD library.