Hello,
I have been searching for days for a library that allows me to use the following combination:
- Arduino Due
- ST7796 TFT display with SPI interface
- Arduino IDE 2.3.x
Any hints, pointers or comments are welcome.
Thank you
Hello,
I have been searching for days for a library that allows me to use the following combination:
So you must have found this
What's the problem with it?
I thank you for your response. I did not look into this solution as I wasn`t sure, that there is no difference between ST7796 and ST7796S.
Now I have set up the board and the display, loaded both libraries and tried to compile the graphicstest example. I only modified the setting for the RST- pin to -1, as I connected it to RESET pin of the DUE.
The compilation throws errors about abstract/pure virtual function calls in Wire.h and TwoWire.h, Print.h::availableForWrite() and Adafruit_ST7796S_kbv as well.
I guess it has something to do with the age of the DUE-core (V1.6.12) and the newer compiler used in ide 2.3.4?
But I have no idea as to how to correct these errors. Maybe you can help?
Thank you in advance
Later, I will try to compile that example using the version of the IDE I currently use (1.8.19) and whatever Due core version I have. If it compiles for me that might confirm your theory.
Just tried to compile it with arduino 1.8.18 showing the same errors:
Arduino: 1.8.18 (Windows 10), Board: "Arduino Due (Programming Port)"
Warning: Board STMicroelectronics:stm32:STeaMi doesn't define a 'build.board' preference. Auto-set to: STM32_STEAMI
In file included from C:\Users\andre\Documents\Arduino\libraries\Adafruit_BusIO/Adafruit_I2CDevice.h:5:0,
from C:\Users\andre\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:12,
from C:\Users\andre\Documents\Arduino\sketches\DUE\graphicstest_ST7796_1_8_18\graphicstest_ST7796_1_8_18.ino:17:
C:\Users\andre\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\libraries\Wire\src/Wire.h:120:16: error: cannot declare variable 'Wire' to be of abstract type 'TwoWire'
extern TwoWire Wire;
^
C:\Users\andre\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\libraries\Wire\src/Wire.h:35:7: note: because the following virtual functions are pure within 'TwoWire':
class TwoWire : public Stream {
^
In file included from C:\Users\andre\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\cores\arduino/Stream.h:26:0,
from C:\Users\andre\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\cores\arduino/HardwareSerial.h:24,
from C:\Users\andre\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\cores\arduino/Arduino.h:195,
from sketch\graphicstest_ST7796_1_8_18.ino.cpp:1:
C:\Users\andre\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\cores\arduino/Print.h:49:17: note: virtual int Print::availableForWrite()
virtual int availableForWrite(void) = 0; // for tappalainen NMEA 0183
^
In file included from C:\Users\andre\Documents\Arduino\libraries\Adafruit_BusIO/Adafruit_I2CDevice.h:5:0,
from C:\Users\andre\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:12,
from C:\Users\andre\Documents\Arduino\sketches\DUE\graphicstest_ST7796_1_8_18\graphicstest_ST7796_1_8_18.ino:17:
C:\Users\andre\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\libraries\Wire\src/Wire.h:123:16: error: cannot declare variable 'Wire1' to be of abstract type 'TwoWire'
extern TwoWire Wire1;
^
C:\Users\andre\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\libraries\Wire\src/Wire.h:35:7: note: since type 'TwoWire' has pure virtual functions
class TwoWire : public Stream {
^
graphicstest_ST7796_1_8_18:27:72: error: cannot allocate an object of abstract type 'Adafruit_ST7796S_kbv'
Adafruit_ST7796S_kbv tft = Adafruit_ST7796S_kbv(TFT_CS, TFT_DC, TFT_RST);
^
In file included from C:\Users\andre\Documents\Arduino\sketches\DUE\graphicstest_ST7796_1_8_18\graphicstest_ST7796_1_8_18.ino:18:0:
C:\Users\andre\Documents\Arduino\libraries\Adafruit_ST7796S_kbv/Adafruit_ST7796S_kbv.h:105:7: note: because the following virtual functions are pure within 'Adafruit_ST7796S_kbv':
class Adafruit_ST7796S_kbv : public Adafruit_SPITFT {
^
In file included from C:\Users\andre\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\cores\arduino/Stream.h:26:0,
from C:\Users\andre\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\cores\arduino/HardwareSerial.h:24,
from C:\Users\andre\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\cores\arduino/Arduino.h:195,
from sketch\graphicstest_ST7796_1_8_18.ino.cpp:1:
C:\Users\andre\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\cores\arduino/Print.h:49:17: note: virtual int Print::availableForWrite()
virtual int availableForWrite(void) = 0; // for tappalainen NMEA 0183
^
graphicstest_ST7796_1_8_18:27:22: error: cannot declare variable 'tft' to be of abstract type 'Adafruit_ST7796S_kbv'
Adafruit_ST7796S_kbv tft = Adafruit_ST7796S_kbv(TFT_CS, TFT_DC, TFT_RST);
^
In file included from C:\Users\andre\Documents\Arduino\sketches\DUE\graphicstest_ST7796_1_8_18\graphicstest_ST7796_1_8_18.ino:18:0:
C:\Users\andre\Documents\Arduino\libraries\Adafruit_ST7796S_kbv/Adafruit_ST7796S_kbv.h:105:7: note: since type 'Adafruit_ST7796S_kbv' has pure virtual functions
class Adafruit_ST7796S_kbv : public Adafruit_SPITFT {
^
Mehrere Bibliotheken wurden für "Adafruit_ST7796S_kbv.h" gefunden
Benutzt: C:\Users\andre\Documents\Arduino\libraries\Adafruit_ST7796S_kbv
Nicht benutzt: C:\Users\andre\Documents\Arduino\libraries\Adafruit_ST7796S_kbv-master
Mehrere Bibliotheken wurden für "Adafruit_GFX.h" gefunden
Benutzt: C:\Users\andre\Documents\Arduino\libraries\Adafruit_GFX_Library
Nicht benutzt: C:\Users\andre\Documents\Arduino\libraries\Adafruit-GFX-Library-master
exit status 1
cannot allocate an object of abstract type 'Adafruit_ST7796S_kbv'
Dieser Bericht wäre detaillierter, wenn die Option
"Ausführliche Ausgabe während der Kompilierung"
in Datei -> Voreinstellungen aktiviert wäre.
Any idea?
Thank you
This is odd. You are using a Due, which uses a Microchip AT91SAM3X8E MCU, not an ST Microelectronics STM32 MCU...
I'm using IDE 1.8.19 on Ubuntu 22.04
I installed "Arduino SAM Boards (32-bits ARM Cortex-M3)" boards package V1.6.12 and selected "Arduino Due (Programming Port)" as the board.
I downloaded the ZIP file from the link I posted above and installed it. I opened examples-> Adafruit ST7796S kbv->graphicstext and clicked compile.
Sketch uses 41072 bytes (7%) of program storage space. Maximum is 524288 bytes.
No errors or even warnings.
Given that strange error message you reported, I wonder if your installation of the IDE is corrupt somehow?
Do you have another PC/laptop you could install the IDE fresh on and try that?
Good morning,
I could compile the graphicstest on arduino ide 1.8.19 installed on ubuntu 22.04 in a VM with success.
Then I compiled it for an arduino uno using ide 2.3.4, again with success.
Then I deleted and reinstalled the DUE-core V 1.6.12. It compiled fine, but the upload failed. I had to change to another USB-cable. Everything is fine now.
The culprit was a corrupted DUE-core.
Thank you very much for your help.
Arduino IDE 1.x shows this warning whenever a build.board property has not been defined for any of the installed board definitions, regardless of whether you are compiling for that board. Arduino IDE 2.x has the more sensible behavior of only showing the warning when compiling for that specific board.
So the appearance of the irrelevant warning is actually normal and expected since @ograban was using Arduino IDE 1.8.18.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.