GPIO output gpio_num error

Hi first time posting

I'm using:
esp32
ILI9341 TFT
DS3231 RTC

I've run a simple program to check touch on my TFT and I've got this error message sent to my serial monitor

gpio_set_level(226): GPIO output gpio_num error
E (13717) gpio: gpio_set_level(226): GPIO output gpio_num error

this is the code :

'1. #include <uRTCLib.h>
2. #include <SPI.h>
3. #include <TFT_eSPI.h>
* TFT_eSPI tft = TFT_eSPI(); uRTCLib rtc;
4. uint16_t x = 0, y = 0;
5. void setup() {
6. Serial.begin(115200);
7. URTCLIB_WIRE.begin();
8. tft.init();
9. tft.fillScreen(TFT_BLACK);
10. }
 void loop() {
11. rtc.refresh();
12. if ( tft.getTouch(&x, &y) )
13. tft.drawString("touch working",80,80);
14. else
15. tft.drawString("touch is not working",80,80);
 }

this error message has started popping up ever since I changed my t_cs pin in my ILI9341 from pin 21 in my esp32 board to pin 34 because pin 21 is used for my ds3231 RTC
the touch is working but when I run other codes using touch the esp32 keeps resetting and the TFT keeps initializing any help would be received with praise

have a read of how-to-get-the-best-out-of-this-forum
in particulat try uploading your code again using code tags </>

also in the Arduino IDE select File>Preferences and enable "Verbose output during Compiling and upload" then compile your program again
upload the error messages as text

Show the contents of your User_Setup.h file

the whole thing?

only active settings related to your display, comments should be deleted

there are no errors from the compiler only in the Serial monitor
like I said earlier the esp keeps rebooting and I get this message

E (9) gpio: gpio_set_level(226): GPIO output gpio_num error
E (368) gpio: gpio_set_level(226): GPIO output gpio_num error

is this helpful?

// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR ESP32 SETUP   ######

// For ESP32 Dev board (only tested with ILI9341 display)
// The hardware SPI can be mapped to any pins

//#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS   15  // Chip select control pin
#define TFT_DC    2  // Data Command control pin
#define TFT_RST   4  // Reset pin (could connect to RST pin)
//#define TFT_RST  -1  // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST

// For ESP32 Dev board (only tested with GC9A01 display)
// The hardware SPI can be mapped to any pins

//#define TFT_MOSI 15 // In some display driver board, it might be written as "SDA" and so on.
//#define TFT_SCLK 14
//#define TFT_CS   5  // Chip select control pin
//#define TFT_DC   27  // Data Command control pin
//#define TFT_RST  33  // Reset pin (could connect to Arduino RESET pin)
//#define TFT_BL   22  // LED back-light

#define TOUCH_CS 34    // Chip select pin (T_CS) of touch screen

//#define TFT_WR 22    // Write strobe for modified Raspberry Pi TFT only

// For the M5Stack module use these #define lines
//#define TFT_MISO 19
//#define TFT_MOSI 23
//#define TFT_SCLK 18
//#define TFT_CS   14  // Chip select control pin
//#define TFT_DC   27  // Data Command control pin
//#define TFT_RST  33  // Reset pin (could connect to Arduino RESET pin)
//#define TFT_BL   32  // LED back-light (required for M5Stack)

I would try to align with GENERIC

// ***   ***   ***           Для ESP32 подключаем SPI так:
#define HSPIs             // Дисплей на HSPI, NRF24L01 на VSPI
#if defined(HSPIs)         // для ESP32 HSPI
#define TFT_CS        15  // GP13 - CS
#define TFT_RST       16  // GP14 - RESET
#define TFT_DC        17  // GP15 - A0
#define TFT_MISO      12  // GP12 - MISO (MISO, RX)
#define TFT_MOSI      13  // GP11 - SDA  (MOSI, TX)
#define TFT_SCLK      14  // GP10 - SCK
#else                     // для ESP32 VSPI
#define TFT_CS        5   // GP5  - CS
#define TFT_RST       20  // GP20 - RESET
#define TFT_DC        21  // GP21 - A0
#define TFT_MISO      19  // GP19 - MISO (MISO, RX)
#define TFT_MOSI      23  // GP23 - SDA  (MOSI, TX)
#define TFT_SCLK      18  // GP18 - SCK
#endif
#ifndef Pins_Arduino_h
#define Pins_Arduino_h

#include <stdint.h>

#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS        40
#define NUM_ANALOG_INPUTS       16

#define PIN_SPI1_MISO  (12u)
#define PIN_SPI1_MOSI  (13u)
#define PIN_SPI1_SCK   (14u)
#define PIN_SPI1_SS    (15u)

#define analogInputToDigitalPin(p)  (((p)<20)?(esp32_adc2gpio[(p)]):-1)
#define digitalPinToInterrupt(p)    (((p)<40)?(p):-1)
#define digitalPinHasPWM(p)         (p < 34)

static const uint8_t TX = 1;
static const uint8_t RX = 3;

static const uint8_t SDA = 21;
static const uint8_t SCL = 22;

static const uint8_t SS    = 5;
static const uint8_t MOSI  = 23;
static const uint8_t MISO  = 19;
static const uint8_t SCK   = 18;

static const uint8_t A0 = 36;
static const uint8_t A3 = 39;
static const uint8_t A4 = 32;
static const uint8_t A5 = 33;
static const uint8_t A6 = 34;
static const uint8_t A7 = 35;
static const uint8_t A10 = 4;
static const uint8_t A11 = 0;
static const uint8_t A12 = 2;
static const uint8_t A13 = 15;
static const uint8_t A14 = 13;
static const uint8_t A15 = 12;
static const uint8_t A16 = 14;
static const uint8_t A17 = 27;
static const uint8_t A18 = 25;
static const uint8_t A19 = 26;

static const uint8_t T0 = 4;
static const uint8_t T1 = 0;
static const uint8_t T2 = 2;
static const uint8_t T3 = 15;
static const uint8_t T4 = 13;
static const uint8_t T5 = 12;
static const uint8_t T6 = 14;
static const uint8_t T7 = 27;
static const uint8_t T8 = 33;
static const uint8_t T9 = 32;

static const uint8_t DAC1 = 25;
static const uint8_t DAC2 = 26;

#endif /* Pins_Arduino_h */

a couple of references, e.g. esp32-pinout-reference-gpios, indicate pin GPIO34 is input only

alright so should I change the t_cs to other pin?
if so which 1 do you think I should change it to?

go thru the list in the refence in post 9 to find an output GPIO you are not using
alternativily find a pin you are currently using as an input which could be used as an output and exchange with gpio34
be careful with pins which are used during boot - connect the wrong thing and you can stop the ESP32 booting and uploading until you disconnect from the pin

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.