ESP32 cannot connect to Wifi when e-paper inited (GxEPD2)

Hi
I have 2 e-papers connected to a LOLIN32 Lite board, and I've been working with them without any problem, until I wanted to connect to a WiFi.

The program runs well until it comes to the Wifi.begin instruction: there, I ear a beep like when the board is disconnected from the USB and the code seems to stop. When I add Serial.print before and after the Wifi.begin, I see the first one but not the other one.

Here is my code (a simplified extraction): the splashscreen is displayed on the small e-paper, and the program goes idle at the Wifi.begin

#include <WiFi.h>
const char* ssid     = "******";
const char* password = "++++++++++";

#include <GxEPD2_BW.h>
#include <Fonts/Open_Sans_ExtraBold_14.h>


#define RST_PIN 16
#define CS_1 14 //SS // CS 
#define CS_2 13 // CS = 13
#define BUSY_H_x 27 // BUSY = 27
#define BUSY_L_x 15 // BUSY = 15

GxEPD2_BW<GxEPD2_290GD, GxEPD2_290GD::HEIGHT> petit(GxEPD2_290GD(/*CS=*/ CS_1, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ BUSY_H_x)); 
GxEPD2_BW<GxEPD2_420, GxEPD2_420::HEIGHT> grand(GxEPD2_420(/*CS=*/ CS_2, /*DC=*/ 17, /*RST=*/ 22, /*BUSY=*/ BUSY_L_x));

/*
   Splashscreen on small display
*/
void SplashScreen() {
  Serial.println ("SPLASHSCREEN");
  petit.setRotation(1);
  petit.setFont(&Open_Sans_ExtraBold_14);
  uint16_t w = petit.width();
  uint16_t h = petit.height();
  petit.setFullWindow();
  petit.firstPage();
  petit.fillScreen(GxEPD_WHITE);
  do {
    petit.drawRect(0, 0, w, h, GxEPD_BLACK);
    petit.setCursor(w / 3, h / 2);
    petit.print ("DEEP SLEEP WEATHER");
  } while (petit.nextPage());
  petit.powerOff();
  delay(3000);
}

void setup()
{
  Serial.begin(115200);
  delay(10);
  // Init displays
  pinMode(RST_PIN, OUTPUT);
  digitalWrite(RST_PIN, HIGH);
  delay(20);
  digitalWrite(RST_PIN, LOW);
  delay(20);
  digitalWrite(RST_PIN, HIGH);
  delay(200);
  petit.init(115200); // enable diagnostic output on Serial
  grand.init(115200); // enable diagnostic output on Serial
  petit.setTextColor(GxEPD_BLACK);
  grand.setTextColor(GxEPD_BLACK);
  Serial.println("Begin displays");
  SplashScreen();

  // connecting to a WiFi network

  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);

  Serial.println("Before Wifi begin");
  WiFi.begin(ssid, password);
  Serial.println("After Wifi begin");

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
}


void loop() { }

And here is the copy of the monitor:

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x17 (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:1
load:0x3fff0018,len:4
load:0x3fff001c,len:808
load:0x40078000,len:6084
load:0x40080000,len:6696
entry 0x400802e4
Begin displays
SPLASHSCREEN
_PowerOn : 75912
_Update_Full : 2095981
_Update_Part : 288886
_PowerOff : 20950

Connecting to Lesept
Before Wifi begin

The WiFi connexion works well when the displays are not inited. I have tried to change the USB port, with no success.

What am I doing wrong?

Here are the connections I use for the displays:

/*
   Connexions
             grand   petit
      BUSY    15      27
      RES     22      16
      D/C     17      17
      CS      13      14
      SCK     18      18
      SDI     23      23
      GND     GND     GND
      3V3     3V      3V
*/

I have found this, dealing with the ADC2 of the ESP32 and the WiFi:

The ESP32 integrates two 12-bit SAR (Successive Approximation Register) ADCs supporting a total of 18 measurement channels (analog enabled pins).

The ADC driver API supports ADC1 (8 channels, attached to GPIOs 32 - 39), and ADC2 (10 channels, attached to GPIOs 0, 2, 4, 12 - 15 and 25 - 27). However, the usage of ADC2 has some restrictions for the application:

ADC2 is used by the Wi-Fi driver. Therefore the application can only use ADC2 when the Wi-Fi driver has not started.
Some of the ADC2 pins are used as strapping pins (GPIO 0, 2, 15) thus cannot be used freely.

Does the GxEPD2 library use the ADC, because I use these GPIO for the displays?

As far as I understood, the "strapping pins" are used on startup, and have pull-ups or pull-downs, or are driven from the usb-to-serial converter for download capability. Therefore you can't use them as input. But you may be able to use them for output by the application. Just make sure there is no "stronger" external pull-up or pull-down in the wrong direction. The same is true for ESP8266.

I don't understand: what do you mean by "strapping pins"?

EDIT: OK, Google helped... I just need to know if I can use these pins or not while using WiFi. You know, display on a e-paper display a message such as
Connecting to SSID
and adding "." each 200 ms or so.
Then displaying the IP address

Some of the ADC2 pins are used as strapping pins (GPIO 0, 2, 15) thus cannot be used freely.

I tried to remove the RST pins and not to use any of the pins related to the ADC2. The WiFi connects but the display does not work: I get this message on the serial monitor

Begin displays
SPLASHSCREEN
Busy Timeout!
_PowerOn : 10000932
Busy Timeout!
_Update_Full : 10000996
Busy Timeout!
_Update_Part : 10000901
_PowerOff : 20934

Connecting to Lesept
Before Wifi begin
After Wifi begin
......
WiFi connected
IP address: 
xxx.xxx.x.xx

"Busy Timeout"...

Here is the code:

#include <WiFi.h>
const char* ssid     = "*****";
const char* password = "********";

#include <GxEPD2_BW.h>
#include <Fonts/Open_Sans_ExtraBold_14.h>


#define RST_PIN 16
#define CS_p 16
#define CS_g 19
#define BUSY_p 5
#define BUSY_g 22

GxEPD2_BW<GxEPD2_290GD, GxEPD2_290GD::HEIGHT> petit(GxEPD2_290GD(/*CS=*/ CS_p, /*DC=*/ 17, /*RST=*/ -1, /*BUSY=*/ BUSY_p));
GxEPD2_BW<GxEPD2_420, GxEPD2_420::HEIGHT> grand(GxEPD2_420(/*CS=*/ CS_g, /*DC=*/ 17, /*RST=*/ -1, /*BUSY=*/ BUSY_g));

/*
   Splashscreen on small display
*/
void SplashScreen() {
  Serial.println ("SPLASHSCREEN");
  petit.setRotation(1);
  petit.setFont(&Open_Sans_ExtraBold_14);
  uint16_t w = petit.width();
  uint16_t h = petit.height();
  petit.setFullWindow();
  petit.firstPage();
  petit.fillScreen(GxEPD_WHITE);
  do {
    petit.drawRect(0, 0, w, h, GxEPD_BLACK);
    petit.setCursor(w / 3, h / 2);
    petit.print ("DEEP SLEEP WEATHER");
  } while (petit.nextPage());
  petit.powerOff();
  delay(3000);
}

void setup()
{
  Serial.begin(115200);
  delay(10);
  // Init displays
  pinMode(RST_PIN, OUTPUT);
  digitalWrite(RST_PIN, HIGH);
  delay(20);
  digitalWrite(RST_PIN, LOW);
  delay(20);
  digitalWrite(RST_PIN, HIGH);
  delay(200);
  petit.init(115200); // enable diagnostic output on Serial
  grand.init(115200); // enable diagnostic output on Serial
  petit.setTextColor(GxEPD_BLACK);
  grand.setTextColor(GxEPD_BLACK);
  Serial.println("Begin displays");
  SplashScreen();

  // connecting to a WiFi network

  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);

  Serial.println("Before Wifi begin");
  WiFi.begin(ssid, password);
  Serial.println("After Wifi begin");

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
}


void loop()
{
}

Even if I comment out all the lines with RST_PIN, it does not work.
What is wrong now?

The controller needs at least one sort of reset to start. If the initial power connection is not enough, then you can try to connect RST to the processor RTS pin.