Bonjour a tous ! ![]()
J’ai un module ESP32 écran rond que j’arrive pas a utiliser avec la bibliothèque TFT_eSPI. Écran noir.
J’ai réussi a identifier que le code plante après tft.intit(), avec ce petit code test :
#include <TFT_eSPI.h> // Inclure la bibliothèque TFT_eSPI
TFT_eSPI tft = TFT_eSPI(); // Créer un objet TFT_eSPI
void setup() {
Serial.begin(115200); // Initialiser la communication série à 115200 bauds
while (!Serial); // Attendre que le moniteur série soit ouvert (utile pour les ESP32)
Serial.println("Démarrage du test TFT_eSPI...");
Serial.println("Tentative d'initialisation de l'écran...");
// Initialisation de l'écran TFT
// C'est cette ligne qui utilise les définitions de ton fichier Setup70tk_ESP32_C3_GC9A01.h
// Le code va bloquer ici si le problème est dans le setup SPI ou les pins fondamentales
tft.init();
// Si le code atteint cette ligne, cela signifie que tft.init() a terminé son exécution.
// Cela n'indique pas nécessairement que l'écran fonctionne visuellement,
// mais que la séquence d'initialisation logicielle s'est déroulée.
Serial.println("Initialisation de l'écran terminée. Vérification de l'affichage...");
// Tentative d'affichage pour voir si l'écran répond
tft.fillScreen(TFT_BLUE); // Remplir l'écran en bleu
delay(1000);
tft.fillScreen(TFT_RED); // Remplir l'écran en rouge
delay(1000);
tft.fillScreen(TFT_GREEN); // Remplir l'écran en vert
delay(1000);
Serial.println("Changement de couleurs effectué. Observez l'écran !");
// Si l'écran est toujours noir ici, le problème est probablement lié au rétroéclairage (TFT_BL)
// ou à un problème de configuration des couleurs/mémoire du pilote.
// La communication SPI elle-même a de bonnes chances de fonctionner si init() a passé.
Serial.println("Test terminé.");
}
void loop() {
// Le loop n'a pas besoin de faire grand-chose pour ce test
}
Résultat :
ELF file SHA256: f3dc4eb47
Rebooting...
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0xc (RTC_SW_CPU_RST),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x403818f4
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0x1148
load:0x403cc710,len:0xb40
load:0x403ce710,len:0x2f58
entry 0x403cc710
Démarrage du test TFT_eSPI...
Tentative d'initialisation de l'écran...
Guru Meditation Error: Core 0 panic'ed (Store access fault). Exception was unhandled.
Core 0 register dump:
MEPC : 0x42001b9a RA : 0x42001b8a SP : 0x3fc9a0a0 GP : 0x3fc8e600
TP : 0x3fc9a130 T0 : 0x76697461 T1 : 0xffc3ffff T2 : 0x746e6554
S0/FP : 0x60004000 S1 : 0x3fc8f740 A0 : 0x00000001 A1 : 0xffffffff
A2 : 0x00000000 A3 : 0x00000000 A4 : 0x08000000 A5 : 0x00000010
A6 : 0x00000004 A7 : 0x00000001 S2 : 0x00000001 S3 : 0x00000000
S4 : 0x00000000 S5 : 0x00000000 S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x00040000 T4 : 0x00000000 T5 : 0x00000041 T6 : 0x0000000f
MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000007 MTVAL : 0x00000010
MHARTID : 0x00000000
Stack memory:
3fc9a0a0: 0x00000003 0x00000002 0x01312d00 0x42000001 0x3fc90000 0x00000001 0x3fc8f740 0x42001eb0
3fc9a0c0: 0x00000000 0x3fc8f87c 0x00000029 0x42005302 0x00000000 0x3fc8f000 0x3fc90000 0x42000072
3fc9a0e0: 0x00000000 0x00000000 0x00000000 0x42007fa2 0x00000000 0x00000000 0x00000000 0x40386fe8
3fc9a100: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fc9a120: 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xbaad5678
3fc9a140: 0xb0cb77b3 0xcfdd4ecb 0xcfa58f22 0x4088cae9 0x48c3e7ca 0x67b3abb7 0x764253a1 0x2dcc5e0d
3fc9a160: 0xec00852c 0x48d02960 0xf8c6954f 0xc624d448 0x4d2860fb 0xc4bc8cb9 0x891872c5 0x86b99f43
3fc9a180: 0xf8628283 0xaa00afee 0x28a95e87 0x48028280 0x5c1b52ab 0x2df7235c 0x6193e051 0xab176507
3fc9a1a0: 0x2f7dba5e 0xe5929b1e 0xe6d76606 0x80d6e79f 0xf392adfe 0x7f2beeaa 0x0459f05b 0x97940c8c
3fc9a1c0: 0x23d39404 0x23f157b3 0x1b0e7256 0xad1e5255 0x87a3b6f8 0x9db76981 0xfff76eef 0xc8b7ce98
3fc9a1e0: 0xa63a7ca6 0x5710424b 0x6669f647 0x8be451b0 0x71fad3fb 0x5c19ba9a 0x5d361d65 0xaf6bb839
3fc9a200: 0x25c2c84b 0xf07c1441 0x90496bc5 0x055a8102 0xe4e0f778 0xfd3d2151 0x7cee2637 0x7bffae1a
3fc9a220: 0xe16138e5 0x31f134c2 0xbe673fd7 0xb5d76ab9 0x70dc2970 0x3fe218c1 0x48d36f72 0x084784bb
3fc9a240: 0x5c4be961 0x39a76996 0x89b88610 0x7715d8b7 0x78d6341d 0xda5dc65b 0xa4bc39db 0x522c5043
3fc9a260: 0xe90e9137 0x08c0a7e2 0x968d7c41 0x4c78f227 0xdca85bb7 0x1af0852b 0x7c636372 0x0669f8b1
3fc9a280: 0x6bce089d 0x1e8a4001 0x99d6285b 0x2f6600ae 0xa14091be 0x13ed295d 0x4ce7a991 0x32705e4f
3fc9a2a0: 0xb72bd9ad 0xe9260184 0xde0a2714 0x873e39b5 0xb9b092be 0x209f6613 0xcfdf248f 0x8bb2f974
3fc9a2c0: 0xbc8fd4b8 0x103dc80b 0x3ed96eca 0x31c3149e 0xb3d3d83c 0x98e2177d 0x6c0fad37 0x756fcf2a
3fc9a2e0: 0xf787a43e 0x7a48a625 0xc39d058a 0x8ef8c960 0x3a6b2e78 0x6c6afb7f 0x5a708068 0x91110c7c
3fc9a300: 0x7c3f5b5b 0x9a41e44a 0xbf3eeb5f 0x1241884b 0x2f124723 0x0b5906a4 0x660f2192 0xc8ffc810
3fc9a320: 0x533b919f 0x03ae0b61 0x402557bd 0x6ad3a1b2 0x3fc9812c 0x00000170 0xabba1234 0x0000015c
3fc9a340: 0x3fc99f50 0x00000000 0x3fc95e30 0x3fc8fdf4 0x3fc9a340 0x3fc8fdec 0x00000018 0x00000000
3fc9a360: 0x00000000 0x3fc9a340 0x00000000 0x00000001 0x3fc9813c 0x706f6f6c 0x6b736154 0x00000000
3fc9a380: 0x00000000 0x3fc9a130 0x00000005 0x00000000 0x00000001 0x00000002 0x00000000 0x00000000
3fc9a3a0: 0x00000000 0x00000000 0x3fc918f8 0x3fc91960 0x3fc919c8 0x00000000 0x00000000 0x00000001
3fc9a3c0: 0x00000000 0x00000000 0x00000000 0x42010a28 0x00000000 0x00000000 0x00000000 0x00000000
3fc9a3e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fc9a400: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fc9a420: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fc9a440: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fc9a460: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fc9a480: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xbaad5678
Juste après "Tentative d'initialisation de l'écran..."
=> Guru Meditation Error: Core 0 panic'ed (Store access fault). Exception was unhandled.
Par ailleurs, je rencontre un deuxième problème sous-jacent évoqué dans cette discutions ICI au niveau de mon Com3
(22, 'Un périphérique qui n’existe pas a été spécifié.', None, 433).
Mais il semblerai que ce problème n’empêche pas le flashage, donc je n’en parlerai pas ici.
Liens aliexpresse du module ICI
Voici les informations que j’ai pus regrouper :
Spécification technique :
> Modèle : ESP32-2424S012
> Microcontrôleur : ESP32-C3-MINI-1U
> Chip type / Type de puce : ESP32-C3 (QFN32) (revision v0,4)
> Fonctionnalité : Wifi, BLE, Flash intégré 4MB (XMC)
> Cristal : 40MHz
> MAC : f0:f5:bd:ea:0e:90
> Hard resetting via RTS pin / Réinitialisation matérielle via la broche RTS
PIN:
SPIMISO [DC] (SPI-Master In Slave Out)
[SPI-Envoi données Écran→ ESP32] IO2
JO3 (mosfet LED- / pour retro éclairage) IO3
REST (normal : HAUT / Bt reset actionné : BAS) EN
TP_INT (Touch Panel Interrupt) [I2C-Tactile-Contact]IO0
TP_RST (reset du tactile)IO1
SPICS [CS] (SPI-Chip select) [SPI-Selec.esclave→écran]IO10
TP_SDA (Touch Panel Serial Data) [I2C-Tactile-Données]IO4
TP_ SCL (Touch Panel Serial Clock) [I2C-Tactile-Synchro.]IO5
SPICLK (SPI-Clock) [SPI-Ecran-Synchro.]IO6
SPI MOSI [SDA] (SPI-Master Out Slave In)
[SPI-Envoi données ESP32→ Ecran]IO7
Ecran :
Écran rond TFT IPS 1,28pouce 240x240
Modèle : GC9A01
Communication : SPI
CLK : IO6
MOSI : IO7
DC : IO2 (ou -1 si écran ne renvois rien / ou non mentionné)
CS : IO10
Rétroéclairage : IO3
Ce que j’ai déjà fait :
Bibliothèque : esp32 by espressif
Paramètre utilisé :
- Board: ESP32C3 Dev Module
- Upload Speed: 921600
- USB CDC On Boot: Enabled
- CPU Frequency: 160 MHz
- Flash Frequency: 80MHz
- Flash Mode: QIO
- Flash Size: 4MByte (32Mbit)
- Partition Scheme: Default 4MB with spiffs (1.2MB App/1.5MB SPIFFS)
- Core Debug Level: None
- Erase All Flash: Disabled
- JTAG Adapter: Integrated USB JTAG
Modification/création fichier TFT_eSPI :
- Création d’un fichier personnel dans le dossier « User_Setups » nommé Setup70tk_ESP32_C3_GC9A01.h (je ne me suis pas encore occupé du tactile):
// Setup pour le module > Modèle : ESP32-2424S012 > Microcontrôleur : ESP32-C3-MINI-1U
#define USER_SETUP_ID 70
// ======== DRIVER ===========
// Only define one driver, the other ones must be commented out
//#define ILI9341_DRIVER // Generic driver for common displays
//#define ILI9341_2_DRIVER // Alternative ILI9341 driver, see https://github.com/Bodmer/TFT_eSPI/issues/1172
//#define ST7735_DRIVER // Define additional parameters below for this display
//#define ILI9163_DRIVER // Define additional parameters below for this display
//#define S6D02A1_DRIVER
//#define RPI_ILI9486_DRIVER // 20MHz maximum SPI
//#define HX8357D_DRIVER
//#define ILI9481_DRIVER
//#define ILI9486_DRIVER
//#define ILI9488_DRIVER // WARNING: Do not connect ILI9488 display SDO to MISO if other devices share the SPI bus (TFT SDO does NOT tristate when CS is high)
//#define ST7789_DRIVER // Full configuration option, define additional parameters below for this display
//#define ST7789_2_DRIVER // Minimal configuration option, define additional parameters below for this display
//#define R61581_DRIVER
//#define RM68140_DRIVER
//#define ST7796_DRIVER
//#define SSD1351_DRIVER
//#define SSD1963_480_DRIVER
//#define SSD1963_800_DRIVER
//#define SSD1963_800ALT_DRIVER
//#define ILI9225_DRIVER
#define GC9A01_DRIVER
// ======== TAILLE ECRAN ===========
#define TFT_WIDTH 240
#define TFT_HEIGHT 240
// ======== INVERSION COULEUR ===========
// #define TFT_INVERSION_ON
// #define TFT_INVERSION_OFF
// ======== BACKLIGHT ===========
#define TFT_BL 3 // LED back-light control pin
#define TFT_BACKLIGHT_ON HIGH // Level to turn ON back-light (HIGH or LOW)
// ======== PIN OUT ===========
#define TFT_CS 10
#define TFT_MOSI 7
#define TFT_MISO -1
#define TFT_SCLK 6
#define TFT_DC 2
#define TFT_RST -1
// ======== ECRAN TACTIL ===========
// ======== POLICE ===========
#define LOAD_GLCD
#define LOAD_FONT2
#define LOAD_FONT4
#define LOAD_FONT6
#define LOAD_FONT7
#define LOAD_FONT8
#define LOAD_GFXFF
#define SMOOTH_FONT
// ======== FREQUENCE HORLOGE SPI ===========
//#define SPI_FREQUENCY 1000000
//#define SPI_FREQUENCY 5000000
//#define SPI_FREQUENCY 10000000
#define SPI_FREQUENCY 20000000
//#define SPI_FREQUENCY 27000000
//#define SPI_FREQUENCY 40000000
//#define SPI_FREQUENCY 55000000
//#define SPI_FREQUENCY 65000000
//#define SPI_FREQUENCY 80000000
// Optional reduced SPI frequency for reading TFT
//#define SPI_READ_FREQUENCY 20000000
// The XPT2046 requires a lower SPI clock rate of 2.5MHz so we define that here:
//#define SPI_TOUCH_FREQUENCY 2500000 //2500000
-
Dans le fichier User_Setup_Select.h :
. Commenté : //#include <User_Setup.h>
. Décommenté : #include <User_Setups/Setup70tk_ESP32_C3_GC9A01.h> -
Modification du fichier TFT_eSPI_ESP32_C3.h dans le dossier « Processors » pour que la bibliothèque puisse correctement identifier et utiliser le port SPI n°2 (GPSPI2) de l'ESP32-C3, qui est le bon port pour connecter un écran externe. Elles lui donnent les bonnes "adresses" et la bonne "désignation" pour ce port spécifique du microcontrôleur.:
. Ajouts de :
#ifdef REG_SPI_BASE
#undef REG_SPI_BASE
#endif
#define REG_SPI_BASE(i) (((i)==2) ? (DR_REG_SPI2_BASE) : (DR_REG_SPI0_BASE - ((i) * 0x1000))) // GPSPI2 and GPSPI3
. Ajouts de : #define SPI_PORT 2
. Suppression de : #define SPI_PORT SPI2_HOST
Schéma technique :
J'ai demandé à l'IA qui me répond (a prendre avec des pincettes):
Votre module ESP32-2424S012 connecte l'écran TFT aux broches (GPIO 6, 7, 10) qui sont exclusivement utilisées par la mémoire Flash interne de l'ESP32-C3.
La bibliothèque TFT_eSPI s'attend à utiliser un autre contrôleur SPI (le "GPSPI2") pour les écrans externes.
Puisque les broches de votre écran sont sur le bus Flash, la bibliothèque TFT_eSPI ne peut pas les contrôler, ce qui provoque un plantage du microcontrôleur ("Guru Meditation Error") dès l'initialisation de l'écran.
En bref : Le câblage de votre module est incompatible avec la bibliothèque TFT_eSPI.
En résumer :
. Le code plante après tft.intit()
. Juste après, j'ai un retour en boucle : Guru Meditation Error: Core 0 panic'ed (Store access fault). Exception was unhandled.
Merci a tous!


