Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp32 2.0.15 and tft_espi keeps restarting esp32c3 mini #3284

Open
sjorsvr opened this issue Apr 17, 2024 · 14 comments
Open

esp32 2.0.15 and tft_espi keeps restarting esp32c3 mini #3284

sjorsvr opened this issue Apr 17, 2024 · 14 comments

Comments

@sjorsvr
Copy link

sjorsvr commented Apr 17, 2024

Hi,
I use arduino ide 2.3.0, tft_espi 2.5.43 library, and esp32 by espressif 2.0.15 package , and the esp32c3 super mini module.
The following code lights the led 1 time.
But when I uncomment // tft.init() the led keeps blinking, so the module keeps restarting.

It does not happen when I use esp32 package 2.0.14

Any idea what the problem is ?
Regards
Sjors

code :
/*

*/

#include <TFT_eSPI.h>
TFT_eSPI tft = TFT_eSPI();

const byte led8 = 8;
byte UseFont;
char str[80];

void setup(){
// Serial.begin(115200);
// delay(2000);

pinMode(8, OUTPUT);
digitalWrite(8, HIGH);
delay(1000);
digitalWrite(8, LOW);
delay(1000);
digitalWrite(8, HIGH);

// tft.init(); // tft.begin(); zijn hetzelfde
}

void loop(){
}

@elgerg
Copy link

elgerg commented Apr 17, 2024

I think you will need to post your user setup so people know what pins you are trying to use.

@sjorsvr
Copy link
Author

sjorsvr commented Apr 17, 2024

my user setup :
// ST7789 240 x 280 display with no chip select line
#define USER_SETUP_ID 203

#define ST7789_DRIVER // Configure all registers

#define TFT_WIDTH 240
#define TFT_HEIGHT 320

//#define CGRAM_OFFSET // Library will add offsets required

//#define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red

//#define TFT_INVERSION_ON
//#define TFT_INVERSION_OFF

// DSTIKE stepup
//#define TFT_DC 23
//#define TFT_RST 32
//#define TFT_MOSI 26
//#define TFT_SCLK 27

// Generic ESP32 setup
//#define TFT_MISO 19
//#define TFT_MOSI 23
//#define TFT_SCLK 18
//#define TFT_CS -1 // Not connected
//#define TFT_DC 2
//#define TFT_RST 4 // Connect reset to ensure display initialises

//ESP32 C3 generic default
//TFT_CS 7
//TFT_MOSI 6
//TFT_MISO 5
//TFT_SCLK 4

#define TFT_CS 1
#define TFT_MOSI 6
#define TFT_MISO -1 //5
#define TFT_SCLK 4

#define TFT_DC 10
//#define TFT_RST 10
#define TFT_RST -1

//#define TOUCH_CS 1 // Optional for touch screen
#define TOUCH_CS -1 // Optional for touch screen

// For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation
//#define TFT_CS 7 // Define as not used
//#define TFT_DC 8 // Data Command control pin
//#define TFT_RST PIN_D4 // TFT reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST -1 // TFT reset pin connect to NodeMCU RST, must also then add 10K pull down to TFT SCK

//#define TOUCH_CS -1

#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

#define SMOOTH_FONT

#define SPI_FREQUENCY 27000000
// #define SPI_FREQUENCY 40000000

#define SPI_READ_FREQUENCY 20000000

#define SPI_TOUCH_FREQUENCY 2500000

// #define SUPPORT_TRANSACTIONS

@cgrobi
Copy link

cgrobi commented Apr 23, 2024

The same happened to me. I use an ESP32-S3 and the TFT_eSPI library and an ST7796 display. With version 2.0.14 everything works fine. Under 2.0.15 the controller reboots everytime I call tft.init(). Even some old projects that worked for months or even years are not unsable under 2.0.15.

@HSBallina
Copy link

HSBallina commented Apr 23, 2024

I can confirm @cgrobi 's findings. When rolling back to 2.0.14 everything works as expected. Looking at the release notes for 2.0.15 there's a known issue regarding UART pins changes. Can't say if that's got anything to do with it though.

#3289 Linking in this issue as well, since it's related.

@sjorsvr
Copy link
Author

sjorsvr commented May 4, 2024

esp32 2.0.16 same behaviour as 2.0.15.
Is this a esp32 or a tft_espi issue ?

@HSBallina
Copy link

Not sure TBH. Seems like there were some 3.0 features that snuck into the 2.0.15 release that ended up being breaking changes. I just realized there's a new release out since two days back: https://github.com/espressif/arduino-esp32/releases/tag/2.0.16. Too late for me to test it out now, but I'll give it a go tomorrow.

@SergePD
Copy link

SergePD commented May 5, 2024

ESP32-S3 2.0.14 was working with TFT_eSPI, 2.015 and 2.0.16 - Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.

@dbtronics
Copy link

Plese refer to this issue: #3304 (comment)

Revert your esp32 board package to 2.0.14 and that should solve the reset loop. The latest version are causing issues with memory and is not compatible with the TFT_eSPI library. This is tested for ESP32-S3 and I can confirm for this.

@HSBallina
Copy link

@dbtronics it has already been established that there's an incompatibility with both 2.0.15 and 2.0.16.

@moeburn
Copy link

moeburn commented May 6, 2024

Thanks for these comments guys, I was pulling my hair out trying to figure out why my code no longer worked on my ESP32-C3, just reboots forever.

It was a Store Access Fault at MTVAL 0x00000010 if that helps.

@JimDrewGH
Copy link

I can also confirm the same issues exists with a custom board using a ESP32-C3-Mini module. Ironically, PlatformIO worked perfectly with the same Arduino setup that did not - until I upgraded the ESP32 core from v6.6.0 to v6.7.0 and the same thing happens (constant panic/reset) with PlatformIO.

@HSBallina
Copy link

I can also confirm the same issues exists with a custom board using a ESP32-C3-Mini module. Ironically, PlatformIO worked perfectly with the same Arduino setup that did not - until I upgraded the ESP32 core from v6.6.0 to v6.7.0 and the same thing happens (constant panic/reset) with PlatformIO.

IIRC PlatformIO v. 6.6.0 uses ESP32 v. 2.0.14. Probably got updated to either 2.0.15 or 2.0.16 in v. 6.7.0.

@dbtronics
Copy link

dbtronics commented May 15, 2024

Yes I can confirm for ESP32-S3-devkitc-1 for PlatformIO. Have to go with V6.6.0 for screens to work.

@Jason2866
Copy link

Jason2866 commented May 16, 2024

The bug is here in the library

// Fix IDF problems with ESP32C3
#if CONFIG_IDF_TARGET_ESP32C3
// Fix ESP32C3 IDF bug for missing definition (VSPI/FSPI only tested at the moment)
#ifndef REG_SPI_BASE
#define REG_SPI_BASE(i) DR_REG_SPI2_BASE
#endif

same for the S3.
See open issue in Arduino repo espressif/arduino-esp32#9618 (comment)
@Bodmer please correct the wrong fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants