Ok, I'll take another stab at this.
There are two separate and unrelated(?) issues: 1. Going between Example and MultiDisplayExample and 2. ghosting on partial update
This is all using GxEPD2.
1. I'm not looking for a fix to this issue as I know how to work around it. Maybe this is a bug report.
I setup MultiDisplayExample using separate reset and separate busy lines. (This seems to be more stable than having disconnected reset lines. I was getting weird behavior yesterday with "Busy Timeout!" when the resets were disconnected). I removed the "one common reset for all displays" lines in the beginning of void setup().
#if defined(ARDUINO_ARCH_SAMD)
#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise
#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8))
GxEPD2_BW<GxEPD2_290_M06, MAX_HEIGHT(GxEPD2_290_M06)> display1(GxEPD2_290_M06(/*CS=4*/ 2, /*DC=*/ 6, /*RST=*/ 21, /*BUSY=*/ 3)); // GDEW029M06
GxEPD2_BW<GxEPD2_290_M06, MAX_HEIGHT(GxEPD2_290_M06)> display2(GxEPD2_290_M06(/*CS=4*/ 5, /*DC=*/ 6, /*RST=*/ 20, /*BUSY=*/ 17)); // GDEW029M06
GxEPD2_BW<GxEPD2_290_M06, MAX_HEIGHT(GxEPD2_290_M06)> display3(GxEPD2_290_M06(/*CS=4*/ 8, /*DC=*/ 6, /*RST=*/ 19, /*BUSY=*/ 18)); // GDEW029M06
#endif
void setup()
{
Serial.begin(115200);
Serial.println();
Serial.println("setup");
display1.init(115200); // enable diagnostic output on Serial
display2.init(115200); // enable diagnostic output on Serial
display3.init(115200); // enable diagnostic output on Serial
....
Everything works as expected.
From here, I open up GxEPD2_Example. I defined the pins as the same as my display2 in MultiDisplayExample.
Upon uploading and running this example, display2 and display 3 do the same thing, except that display #3 doesn't do HelloWorld() and one of the hibernating functions. Everything else they do at the same time. Display1 remains blank.
If I restart my computer and run GxEPD2_Example before anything else, only display2 runs, leaving display1 and display3 blank (as expected).
#if defined(ARDUINO_ARCH_SAMD)
#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise
#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS)
#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8))
GxEPD2_DISPLAY_CLASS<GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS)> display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 5, /*DC=*/ 6, /*RST=*/ 20, /*BUSY=*/ 17));
I tried running GxEPD2_Example using 'GxEPD2_display_selection_added.h' and 'GxEPD2_display_selection_new_style.h' and they both had the same behavior as mentioned above.
Also, I'm not sure if this is possibly related, but on running GxEPD2_Example or GxEPD2_MultiDisplayExample for the first time after opening the Arduino IDE, I get a warning message during compiling. It uploads fine after the warning. If I compile it again, I do not get the warning message again. (Copied below as code)
In file included from C:\Users\D2468\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21.h:69:0,
from C:\Users\D2468\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/samd.h:105,
from C:\Users\D2468\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.11\cores\arduino/WVariant.h:22,
from C:\Users\D2468\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.11\variants\nano_33_iot/variant.h:25,
from C:\Users\D2468\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.11\libraries\Wire/Wire.h:24,
from C:\Users\D2468\Documents\Arduino\libraries\Adafruit_BusIO-master/Adafruit_I2CDevice.h:1,
from C:\Users\D2468\Documents\Arduino\libraries\Adafruit_BusIO-master/Adafruit_BusIO_Register.h:1,
from C:\Users\D2468\Documents\Arduino\libraries\Adafruit_BusIO-master\Adafruit_BusIO_Register.cpp:1:
C:\Users\D2468\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21g18a.h:226:0: warning: "LITTLE_ENDIAN" redefined
#define LITTLE_ENDIAN 1
In file included from c:\users\d2468\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\sys\types.h:67:0,
from c:\users\d2468\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\stdio.h:61,
from C:\Users\D2468\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/Print.h:22,
from C:\Users\D2468\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/Stream.h:25,
from C:\Users\D2468\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/HardwareI2C.h:22,
from C:\Users\D2468\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.11\libraries\Wire/Wire.h:23,
from C:\Users\D2468\Documents\Arduino\libraries\Adafruit_BusIO-master/Adafruit_I2CDevice.h:1,
from C:\Users\D2468\Documents\Arduino\libraries\Adafruit_BusIO-master/Adafruit_BusIO_Register.h:1,
from C:\Users\D2468\Documents\Arduino\libraries\Adafruit_BusIO-master\Adafruit_BusIO_Register.cpp:1:
c:\users\d2468\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\machine\endian.h:17:0: note: this is the location of the previous definition
#define LITTLE_ENDIAN _LITTLE_ENDIAN
In file included from C:\Users\D2468\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21.h:69:0,
from C:\Users\D2468\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/samd.h:105,
from C:\Users\D2468\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.11\cores\arduino/WVariant.h:22,
from C:\Users\D2468\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.11\variants\nano_33_iot/variant.h:25,
from C:\Users\D2468\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.11\libraries\Wire/Wire.h:24,
from C:\Users\D2468\Documents\Arduino\libraries\Adafruit_BusIO-master/Adafruit_I2CDevice.h:1,
from C:\Users\D2468\Documents\Arduino\libraries\Adafruit_BusIO-master\Adafruit_I2CDevice.cpp:1:
C:\Users\D2468\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21g18a.h:226:0: warning: "LITTLE_ENDIAN" redefined
#define LITTLE_ENDIAN 1
In file included from c:\users\d2468\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\sys\types.h:67:0,
from c:\users\d2468\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\stdio.h:61,
from C:\Users\D2468\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/Print.h:22,
from C:\Users\D2468\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/Stream.h:25,
from C:\Users\D2468\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.11\cores\arduino/api/HardwareI2C.h:22,
from C:\Users\D2468\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.11\libraries\Wire/Wire.h:23,
from C:\Users\D2468\Documents\Arduino\libraries\Adafruit_BusIO-master/Adafruit_I2CDevice.h:1,
from C:\Users\D2468\Documents\Arduino\libraries\Adafruit_BusIO-master\Adafruit_I2CDevice.cpp:1:
c:\users\d2468\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\machine\endian.h:17:0: note: this is the location of the previous definition
#define LITTLE_ENDIAN _LITTLE_ENDIAN