Skip to content

TFT Examples for Spresense fail with compilation error avr/io.h not found #245

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

Open
derekm opened this issue Mar 1, 2025 · 1 comment
Open

Comments

@derekm
Copy link

derekm commented Mar 1, 2025

When trying the TFT examples in File -> Examples -> Examples for Spresense -> TFT -> Arduino, compilation fails with:

In file included from C:\Users\derekm\AppData\Local\Arduino15\libraries\TFT\src\utility\Adafruit_GFX.cpp:35:
C:\Users\derekm\AppData\Local\Arduino15\libraries\TFT\src\utility\glcdfont.c:3:10: fatal error: avr/io.h: No such file or directory
    3 | #include <avr/io.h>
      |          ^~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: exit status 1
@SPRESENSE
Copy link
Collaborator

@derekm
This is not limited to the Spresense board, but to Arduino boards in general,
After installing Arduino IDE2, the first time you run it, the Built-in libraries will be downloaded to the following location for Windows PC.

C:\Users\%USERNAME%\AppData\Local\Arduino15\libraries>dir /b
Arduino_BuiltIn
Ethernet
Firmata
Keyboard
LiquidCrystal
Mouse
SD
Servo
Stepper
TFT

These libraries, including TFT, will fail to build in the Spresense board environment because they are mainly dedicated to the AVR board.

As you mentioned, the Examples menu is confusing because both the Spresense-specific libraries and the built-in libraries are listed as Examples for Spresense.

It has been reported as an Arduino IDE issue, but seems to be still unresolved.
arduino/arduino-ide#2259

If you are not likely to use the Built-in libraries, you can remove the above folder.

Thanks.

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

No branches or pull requests

2 participants