Hi,
I’m using a M5Stack Core 2 board and the Arduino framework and need to use sprites for display but my code (simple demo code from M5Stack) always crashes with Guru Meditation Error. The crash occurs in the line:
img.createSprite(320, 240); //Create a 320x240 canvas
I don’t understand what I’m doing wrong?
platformio.ini
[env:m5stack-core2]
platform = espressif32
board = m5stack-core2
framework = arduino
lib_deps = m5stack/M5Core2
monitor_speed = 115200
main.cpp
#include <M5Core2.h>
#include <Arduino.h>
TFT_eSprite img = TFT_eSprite(&M5.Lcd);
void setup() {
// Init Serial
Serial.begin(115200);
Serial.println("Starting...");
// Sprite Test
M5.begin(); //Initialize M5Core2
img.createSprite(320, 240); //Create a 320x240 canvas
img.fillSprite(RED); //Fill the canvas with red
img.fillCircle(100,100,20,GREEN);
img.pushSprite(0, 0, GREEN); //Push the canvas to Screen(0,0) and set white as the penetration color
}
void loop() {
// put your main code here, to run repeatedly:
}
Monitor output
rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5828
entry 0x400806a8
S�M5Core2 initializing…axp: vbus limit off
axp: gpio1 init
axp: gpio2 init
axp: rtc battery charging enabled
axp: esp32 power voltage was set to 3.35v
axp: lcd backlight voltage was set to 2.80v
axp: lcd logic and sdcard voltage preset to 3.3v
axp: vibrator voltage preset to 2v
touch: FT6336 ready (fw id 0x10 rel 1, lib 0x300E)
OK
Guru Meditation Error: Core 1 panic’ed (Interrupt wdt timeout on CPU1)
Core 1 register dump:
PC : 0x4008c6e9 PS : 0x00060134 A0 : 0x8008e722 A1 : 0x3ffb1e70
A2 : 0x37735134 A3 : 0x0000abab A4 : 0xb33fffff A5 : 0x00000001
A6 : 0x00060f20 A7 : 0x0000cdcd A8 : 0x400d9ccc A9 : 0x3ffb1f60
A10 : 0x3f41567c A11 : 0x00000069 A12 : 0x3f4159b0 A13 : 0x3f415708
A14 : 0x3ffc0a00 A15 : 0x00000000 SAR : 0x0000001c EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000 LBEG : 0x40088f78 LEND : 0x40088f94 LCOUNT : 0x00000000
ELF file SHA256: 0000000000000000
Backtrace: 0x4008c6e9:0x3ffb1e70 0x4008e71f:0x3ffb1ea0 0x4008ed49:0x3ffb1ec0 0x400819a5:0x3ffb1ee0 0x40081b7c:0x3ffb1f00 0x400815af:0x3ffb1f20 0x400d5a3a:0x3ffb1f40 0x400d5ab6:0x3ffb1f60 0x400d13fb:0x3ffb1f80 0x400d81d6:0x3ffb1fb0 0x4008b6b6:0x3ffb1fd0
Core 0 register dump:
PC : 0x400fba1a PS : 0x00060b34 A0 : 0x800e7b56 A1 : 0x3ffbc1b0
A2 : 0x00000000 A3 : 0x00000001 A4 : 0x00000000 A5 : 0x00000001
A6 : 0x00060d20 A7 : 0x00000000 A8 : 0x800e784a A9 : 0x3ffbc180
A10 : 0x00000000 A11 : 0x40085ba8 A12 : 0x00060d20 A13 : 0x3ffbb910
A14 : 0x3ffc0ccc A15 : 0x3ffc0cd0 SAR : 0x00000000 EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000
ELF file SHA256: 0000000000000000
Backtrace: 0x400fba1a:0x3ffbc1b0 0x400e7b53:0x3ffbc1d0 0x4008ce71:0x3ffbc1f0 0x4008b6b6:0x3ffbc210
Rebooting…