最近在准备毕设,需要使用屏幕,我使用ESP32-S3-CAM 作为核心开发板,使用SPI与ST7735S 驱动的1.8寸屏幕通信。弄了一天,屏幕一直白屏,串口监视器一直显示core1崩溃并重启。
开发环境:Arduino IDE 2.3.4
ESP32 开发板版本:3.0.6
TFT_eSPI 版本:2.5.34
版本太新了,后面可能有新的问题,建议降低版本。
最后偶然看到这篇文章
https://blog.csdn.net/raybbs/article/details/144473110
最后成功点亮屏幕,以下是TFT_eSPI的 User_Setup.h 配置内容,可以看情况更改参数
#define USER_SETUP_INFO "User_Setup"
// 此处解决无限重启问题
#define USE_HSPI_PORT
#define ST7735_DRIVER
#define TFT_RGB_ORDER TFT_RGB
#define TFT_WIDTH 128
#define TFT_HEIGHT 160
#define ST7735_REDTAB
#define TFT_MOSI 45
#define TFT_SCLK 3
#define TFT_CS 14 // Chip select control pin
#define TFT_DC 47 // Data Command control pin
#define TFT_RST 21 // Reset pin (could connect to Arduino RESET pin)
#define TFT_BL 0 // LED back-light (required for M5Stack)
#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_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
// Comment out the #define below to stop the SPIFFS filing system and smooth font code being loaded
// this will save ~20kbytes of FLASH
#define SMOOTH_FONT
#define SPI_FREQUENCY 20000000
//#define SPI_FREQUENCY 27000000
//#define SPI_FREQUENCY 40000000
// #define SPI_FREQUENCY 55000000 // STM32 SPI1 only (SPI2 maximum is 27MHz)
// #define SPI_FREQUENCY 80000000
// Optional reduced SPI frequency for reading TFT
#define SPI_READ_FREQUENCY 20000000
可能是库的版本冲突导致。