Hello again. Unfortunately it does not seem to work. 
Hardware:
- FireBeetle 2 ESP32-E
- DESPI-C02
- Good Display GDEY075T7
GxEPD2_4G does not seem to work with the new 800x480 model GDEY075T7 (4 grayscales) from Good Display.
GxEPD2 works without problems, GxEPD2_4G does not - of course no PINs changed.
Here is my code:
#include <Fonts/FreeMonoBold9pt7b.h>
//#define ENABLE_GxEPD2_GFX 1
const uint8_t PIN_EPD_BUSY = 14;
const uint8_t PIN_EPD_CS = 13;
const uint8_t PIN_EPD_RST = 21;
const uint8_t PIN_EPD_DC = 22;
#define MAX_DISPLAY_BUFFER_SIZE 65536ul // e.g.
////
//// Testing with GxEPD2 without Grayscale
////
//#include <GxEPD2_BW.h>
//#define GxEPD2_DISPLAY_CLASS GxEPD2_BW
//#define GxEPD2_DRIVER_CLASS GxEPD2_750_T7
//#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8))
////
////
//// GxEPD2_4G
////
#include <GxEPD2_4G_4G.h>
#define GxEPD2_DISPLAY_CLASS GxEPD2_4G_4G
#define GxEPD2_DRIVER_CLASS GxEPD2_750_T7
#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 4) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 4))
////
GxEPD2_DISPLAY_CLASS<GxEPD2_DRIVER_CLASS,
MAX_HEIGHT(GxEPD2_DRIVER_CLASS)> display
(GxEPD2_DRIVER_CLASS(PIN_EPD_CS,
PIN_EPD_DC,
PIN_EPD_RST,
PIN_EPD_BUSY));
#undef MAX_DISPLAY_BUFFER_SIZE
#undef MAX_HEIGHT
void setup() {
Serial.begin(115200);
Serial.println();
Serial.println("setup");
delay(100);
display.init(115200);
display.setRotation(0);
display.setFont(&FreeMonoBold9pt7b);
display.fillScreen(GxEPD_WHITE);
display.setTextColor(GxEPD_BLACK);
Serial.printf("Display Width: %d\n", display.width());
Serial.printf("Display Height: %d\n", display.height());
const char HelloWorld[] = "Hello World!";
int16_t tbx, tby; uint16_t tbw, tbh;
display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh);
uint16_t hwx = ((display.width() - tbw) / 2) - tbx;
uint16_t hwy = ((display.height() - tbh) / 2) - tby;
display.setFullWindow();
display.firstPage();
do
{
display.setCursor(hwx, hwy);
display.print(HelloWorld);
} while (display.nextPage());
}
void loop() {
}
Here is the error on the serial monitor:
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:13232
load:0x40080400,len:3028
entry 0x400805e4
setup
Display Width: 800
Display Height: 480
Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x1e000105 PS : 0x00060830 A0 : 0x800d40b1 A1 : 0x3ffb2230
A2 : 0x1e000105 A3 : 0x3ffd1b91 A4 : 0x3ffd1b98 A5 : 0x00000000
A6 : 0x3ffd1ba0 A7 : 0x3ffd1b9e A8 : 0x800d1813 A9 : 0x3ffb2210
A10 : 0x3ffd1ba8 A11 : 0x00000000 A12 : 0x00000000 A13 : 0x3ffb225c
A14 : 0x3ffb2256 A15 : 0x3ffb2258 SAR : 0x00000010 EXCCAUSE: 0x00000014
EXCVADDR: 0x1e000104 LBEG : 0x40085e6d LEND : 0x40085e8f LCOUNT : 0xffffffff
Backtrace: 0x1e000102:0x3ffb2230 0x400d40ae:0x3ffb2290
ELF file SHA256: 6b761d0ce2d85524
The problem is caused by "display.firstPage();", that's all I could find out.
Can you @ZinggJM do something about it? I would be frustrated if I / you / we could not get the display to work with grayscale.
Greetings from Germany.