ESP32 C3 Super Mini with GC9A01

blake4711
Posts: 1
Joined: Sat Aug 03, 2024 7:15 am

ESP32 C3 Super Mini with GC9A01

Postby blake4711 » Sat Aug 03, 2024 7:39 am

Hey,

I've been at it for almost a week, trying to connect my ESP C3 super mini to a round GC9A01 240x240. I've tried with both Micropython and ESP-IDF and am currently trying with Arduino IDE and the TFT_eSPI lib. In Arduino I've selected the MakerGO ESP32 C3 SuperMini. I found suggestions to use the ESP32 C3 DevModule, but that wasn't working ether.

I have already looked around a lot here in the forum and so on, and I have also adopted the most common pin assignment. This is the User_Setup.h

Code: Select all

#define USER_SETUP_INFO "User_Setup"

#define GC9A01_DRIVER
#define TFT_SDA_READ

#define TFT_WIDTH  240
#define TFT_HEIGHT 240
#define TFT_CS 7
#define TFT_DC 8
#define TFT_RST 9

#define TFT_MISO 5
#define TFT_MOSI 6
#define TFT_SCLK 4

#define LOAD_GLCD   // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2  // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4  // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6  // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7  // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
#define LOAD_FONT8  // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
#define LOAD_GFXFF  // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
#define SMOOTH_FONT

#define SPI_FREQUENCY  27000000

#define SPI_READ_FREQUENCY  20000000
The Display has no MISO so it isn't connected to anything. The display also has a BLK pin. High = Backlight on so I haven't connected it ether.

For test Code im Using an example from the lib: Colour_Test:

Code: Select all

#include <SPI.h>

#include <TFT_eSPI.h>       // Hardware-specific library

#define TFT_MISO 5

TFT_eSPI tft = TFT_eSPI();  // Invoke custom library

void setup(void) {
  tft.init();

  tft.fillScreen(TFT_BLACK);
  tft.drawRect(0, 0, tft.width(), tft.height(), TFT_GREEN);

  // Set "cursor" at top left corner of display (0,0) and select font 4
  tft.setCursor(0, 4, 4);

  // Set the font colour to be white with a black background
  tft.setTextColor(TFT_WHITE);

  // We can now plot text on screen using the "print" class
  tft.println(" Initialised default\n");
  tft.println(" White text");
  
  tft.setTextColor(TFT_RED);
  tft.println(" Red text");
  
  tft.setTextColor(TFT_GREEN);
  tft.println(" Green text");
  
  tft.setTextColor(TFT_BLUE);
  tft.println(" Blue text");

  delay(5000);
}

void loop() {
  tft.invertDisplay( false ); // Where i is true or false
 
  tft.fillScreen(TFT_BLACK);
  tft.drawRect(0, 0, tft.width(), tft.height(), TFT_GREEN);

  tft.setCursor(0, 4, 4);

  tft.setTextColor(TFT_WHITE);
  tft.println(" Invert OFF\n");

  tft.println(" White text");
  
  tft.setTextColor(TFT_RED);
  tft.println(" Red text");
  
  tft.setTextColor(TFT_GREEN);
  tft.println(" Green text");
  
  tft.setTextColor(TFT_BLUE);
  tft.println(" Blue text");

  delay(5000);


  // Binary inversion of colours
  tft.invertDisplay( true ); // Where i is true or false
 
  tft.fillScreen(TFT_BLACK);
  tft.drawRect(0, 0, tft.width(), tft.height(), TFT_GREEN);

  tft.setCursor(0, 4, 4);

  tft.setTextColor(TFT_WHITE);
  tft.println(" Invert ON\n");

  tft.println(" White text");
  
  tft.setTextColor(TFT_RED);
  tft.println(" Red text");
  
  tft.setTextColor(TFT_GREEN);
  tft.println(" Green text");
  
  tft.setTextColor(TFT_BLUE);
  tft.println(" Blue text");

  delay(5000);
}
But it looks like my ESP is already crashing in the setup without a backtrace. With some prints and removing code, I was able to figure out, that the problem is with tft.init(). And in there with: writecommand(0x00); (Which is called in case TFT_RST >= 0, but it doesn't matter since all writecommands lead to a crash).

Because of this, I assumed a problem with this line: spi.begin(TFT_SCLK, TFT_MISO, TFT_MOSI, -1); Printing the values reveals that this is executed: spi.begin(4, -1, 6, -1);. TFT_MISO is changed to -1, besides the declaration in User_Setup. I tried hard-wiring the variable, but it didn't change anything. I also tried a lot of different pins, but none of them work and all have the same problem.

Does anyone have any ideas about what I could try or even any idea what the specific problem is here?

TheCHIPWizzard
Posts: 1
Joined: Sun Nov 17, 2024 5:02 pm

Re: ESP32 C3 Super Mini with GC9A01

Postby TheCHIPWizzard » Sun Nov 17, 2024 5:09 pm

hi! i also had this problem , the problem is the newer esp32 core version. Please downgrade this to 2.0.14. if you dont know how.. just go to the arduino ide and select board manager ( you can find this on the left side of the ide ) then search esp32 (by espressif not arduino ) and select version 2.0.14 and download it . you can now use the tft_espi library. :D
Attachments
espressif_forum.png
espressif_forum.png (44.38 KiB) Viewed 1762 times

pdppdp
Posts: 4
Joined: Tue Nov 19, 2024 3:58 am

Re: ESP32 C3 Super Mini with GC9A01

Postby pdppdp » Thu Dec 19, 2024 3:16 am

I am having this same issue, with a generic C3-mini, to Arduino a Nologo ESP32C3 SuperMini.

I have tracked the issue to the first call of begin_tft_write(), which in my example is the initial attempt to reset the display.

There the device takes exception to the line:
spi.beginTransaction(SPISettings(SPI_FREQUENCY, MSBFIRST, TFT_SPI_MODE));

The call to the SpiSettings constructor is not the issue, a copy of that call placed before does not produce an exception.

The error occurs after entering spi.beginTransaction.

Fwiw, there is the register dump output
```
Guru Meditation Error: Core 0 panic'ed (Store access fault). Exception was unhandled.

Core 0 register dump:
MEPC : 0x42002934 RA : 0x4200291c SP : 0x3fc95010 GP : 0x3fc8c000
TP : 0x3fc8492c T0 : 0x30303030 T1 : 0x0000003f T2 : 0x37323d59
S0/FP : 0x3fc8cb90 S1 : 0x00000000 A0 : 0x00000001 A1 : 0xffffffff
A2 : 0x00000000 A3 : 0x00800000 A4 : 0x08000000 A5 : 0x00000010
A6 : 0x00000040 A7 : 0x00000020 S2 : 0x019bfcc0 S3 : 0x3fc8d000
S4 : 0x00000001 S5 : 0x00000000 S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x0196e6aa T4 : 0x3d545352 T5 : 0x49464253 T6 : 0x4d203030
MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000007 MTVAL : 0x00000010
MHARTID : 0x00000000
```

Btw, I have tried versions of EspCrashDecoder from github, the standalone one for instance, can't get any to work. Is there a comparable Esspressif tool?

Who is online

Users browsing this forum: No registered users and 21 guests