Comments (4)
@tobozo
Thanks for the report.
I was not able to reproduce the problem,
but I updated the develop branch with a change to discard the sprites once when setPsram is changed.
Are there any other prerequisites to reproduce the problem?
If you change the board type, will the problem go away?
from lovyangfx.
[edit] simplified POC code
[edit2] : pinpointed the issue
static LGFX_Sprite *sprite = new LGFX_Sprite( &tft ); // no crash when using this
static TFT_eSprite *sprite = new TFT_eSprite( &tft ); // will crash on createSprite()
The problem seems to be isolated to LoLin D32 Pro + TFT-2.4. No other component is connected.
I can't reproduce this issue on M5Stack or Odroid-Go.
Updating the develop branch did not solve it,
Are there any other prerequisites to reproduce the problem?
I have reduced the crash code to this:
#include <ESP32-Chimera-Core.h>
#define tft M5.Lcd
class BLAH {
public:
BLAH(){
if( !psramInit() ) {
log_e("Failed to init psram, crash will probably occur");
} else {
log_d("Psram successfully detected");
}
};
~BLAH() { };
};
static BLAH bleb;
// static LGFX_Sprite *keyNoteSprite = new LGFX_Sprite( &tft ); // no crash when using this
static TFT_eSprite *keyNoteSprite = new TFT_eSprite( &tft );
void setup()
{
M5.begin();
void* sptr = keyNoteSprite->createSprite( tft.width(), tft.height() );
if( !sptr ) {
log_e("Can't create sprite, aborting");
while(1) vTaskDelay(1);
}
}
void loop()
{
}
... is premature psramInit()
causing this ?
from lovyangfx.
The psramInit function seems to be called at startup in the initArduino function.
I don't see any need to call it explicitly from user code.
If you call it in the constructor of a static object, I think it is called before initArduino.
Therefore, this is sufficient to reproduce the problem.
#include <Arduino.h>
#include <esp_log.h>
class BLAH {
public:
BLAH(){
if( !psramInit() ) {
log_e("Failed to init psram, crash will probably occur");
} else {
log_d("Psram successfully detected");
}
};
~BLAH() { };
};
static BLAH bleb;
void setup()
{
void* sptr = heap_caps_malloc(320*240*2, MALLOC_CAP_SPIRAM);
if( !sptr ) {
log_e("Can't heap_caps_malloc, aborting");
}
else
{
log_e("success !");
}
}
void loop()
{
vTaskDelay(1);
}
from lovyangfx.
ok I understand this is a bad practice causing that, I'm not sure why it only crashes with LoLin D32 Pro + TFT-2.4 though.
closing this issue as not a LGFX problem
from lovyangfx.
Related Issues (20)
- Dealing with M5stack Core2 V1.1 HOT 3
- So much problem to convert a working code from TFT_eSPI HOT 9
- ESP32S3 HOT 2
- ILI9488 working with arduinoIDE but not working with espIDF HOT 7
- setWindow not affecting fillRect?! HOT 1
- Support of emulated ARDUINO Projects with Portdunio using native SDL2 Lib for X11 support HOT 2
- LVGL drawing freezes on Sunton ESP32-S3 8048S050 board. HOT 4
- drawJPG does not work HOT 7
- Core Panic'ed on ESP32-S3 board with ILI9488 on 8-bit parallel mode HOT 10
- Problem with ESP32_S3 and ILI9488 16 bit-parallel display HOT 12
- Allocate a static buffer for 1bpp/2bpp/4bpp greyscale sprites and draw bitmaps on it HOT 6
- ST7701 / GC9503 ESP32-S3 wrong colors behaviour HOT 4
- The screen is initialized correctly every 2 times HOT 9
- drawEllipseとfillEllipseの、rxとryの一方だけが0のときの挙動について HOT 2
- Freeze using tft.getTouch(...) with a FT5x06 I2C capacitive touch screen HOT 3
- I need support for the CYD board (cheap yellow display) ESP32-2432S028R HOT 8
- Lilygo AMOLED series HOT 20
- Support for MakerFab 2.1 inch round MaTouch ESP32-S3 based controller HOT 3
- LilyGo AMOLED Series HOT 1
- Expose XPT2046 ability to measure VBAT HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lovyangfx.