ESP32 (wroom) with ILI9341 and MCP2515

Hello, everyone.
I have a problem that I would like to use an ILI9341 and an MCP2515 driven by an ESP32 wroom.
For some reason the two don't work with each other, but separately they do.
I suspect the SPI as the source of the problem.

This is the connection:

ILI9341 - ESP32 wroom:

VCC   ----   5V (because it asks for 5V on the back of the display)
GND  ----   GND
CS     ----    D15
RESET ----  D25
D/C   ----    D26
SDI(MOSI) ---- D13
SCK   ----    D14
SDO(MISO) ---- D12

MCP2515 - ESP32 wroom:
VCC  ---- 5V
GND  ---- GND
CS   ----    D5
MISO  ---- D19
MOSI  ---- D23
SCK  ----   D18
INT   ---- D2

This is the code:

#include <SPI.h>
#include <mcp2515.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>

//mcp pinout
//INT-D2 | CS-D5 | SCK - D18 | MOSI - D23 | MISO - D19

struct can_frame canMsg;
MCP2515 mcp2515(5); // CS pin

// ILI9341 PIN Definitions
#define TFT_CS     15
#define TFT_RST    25
#define TFT_DC     26
#define TFT_MOSI   13
#define TFT_SCLK   14
#define TFT_MISO   12


// Initialize the ILI9341 display
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST,TFT_MISO);

void setup() {

  Serial.begin(115200);
  
  mcp2515.reset();
  mcp2515.setBitrate(CAN_500KBPS, MCP_8MHZ);
  mcp2515.setNormalMode();
  
  Serial.println("------- CAN Read ----------");


  // Initialize the display
  tft.begin();
  tft.setRotation(1);
  tft.fillScreen(ILI9341_BLACK);
  tft.setTextColor(ILI9341_WHITE);
  tft.setTextSize(2);
  tft.setCursor(100, 100);
  tft.print("OUR TEAM");
  delay(1000);
  tft.fillScreen(ILI9341_BLACK); 
}

void loop() {
  if (mcp2515.readMessage(&canMsg) == MCP2515::ERROR_OK) {
    Serial.print(canMsg.can_id, HEX); // print ID
    Serial.print(" "); 
    Serial.print("|"); 
    Serial.print(canMsg.can_dlc, HEX); // print DLC
    Serial.print(" ");
    Serial.print("|");
    
    for (int i = 0; i<canMsg.can_dlc; i++)  {  // print the data
      Serial.print(canMsg.data[i],HEX);
      Serial.print(" ");
    }

    Serial.println();      
  }
   

}

Thanks very much for all your help!

I moved your topic to a more appropriate forum category @cszombi.

The Nano ESP32 category you chose is only used for discussions directly related to the Arduino Nano ESP32 board.

In the future, please take the time to pick the forum category that best suits the subject of your question. There is an "About the _____ category" topic at the top of each category that explains its purpose.

Thanks in advance for your cooperation.

Sorry I do not do well with word problems. Post an annotated schematic showing exactly how you have wired it Be sure to show all components used including capacitors, resistors etc, connections, power connections, ground connections. Links to any hardware device including the Arduino that gives technical information. Frizzes do not count as schematics for me as they do not contain the needed information. Remember we are trying to find a problem not assemble it.

The ESP32 is not 5v tolerant.
Need a 'high speed' level shifter from 5v to 3.3v.