xperiments-in / xtouch

Other
570 stars 54 forks source link

Crash on loadScreen() #128

Closed wi1k1n closed 2 weeks ago

wi1k1n commented 3 weeks ago

Hi,

First of all, thank you so much for such a great project and for keeping it open source! Highly appreciated!

I've compiled the latest version of the firmware 0.9.100 (commit 99aa056cebe6) and uploaded it to the hardware (2.8-inch ESP32-2432S028R) using VSCode + PlatformIO, The screen boots up, connects to BBL, however, at some point crashes and hence reboots. Have you experienced any similar issue and what could be the reason? Below is my platformio.ini config and the log output + callstack of the crash.

Worth to mention, if I flash 0.9.100 from the online web installer (the way it's described in readme), I don't have this issue: everything boots, connects and successfully passes to the home screen. Could this be due to some library versions mismatch? Could you please share the exact dependency versions you're using for the release firmware?

I'm also using the lv_conf.h and the User_Setup.h from the resources/ folder, are you using exactly them for your firmware or do I need any adjustments there?

In platformio.ini I've:

  1. commented out the post-build.py execution (looks like this is something I don't need to run everything locally)
  2. added the resources/ folder to the headers search path
  3. exported definitions from the User_Setup.h as build flags (together with USER_SETUP_LOADED define), as otherwise TFT_eSPI uses its own User_Setup.h file that's stored in the library.

I also had to remove #include "date.h" from the cloud.hpp file, as there's no such file in repo.

Thank you in advance for any info you could share! Ilia

My platformio.ini:

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
board_build.filesystem = littlefs  
board_build.partitions = min_spiffs.csv

monitor_speed = 115200
monitor_filters = esp32_exception_decoder
upload_speed = 921600

lib_deps = 
    https://github.com/Bodmer/TFT_eSPI.git
    https://github.com/PaulStoffregen/XPT2046_Touchscreen.git
    lvgl/lvgl@^8.3
    https://github.com/knolleary/pubsubclient.git
    https://github.com/bblanchon/ArduinoJson/releases/download/v6.21.4/ArduinoJson-v6.21.4.zip
    FS
    SD
    https://github.com/PaulStoffregen/OneWire.git#v2.3.7
    https://github.com/milesburton/Arduino-Temperature-Control-Library.git
build_flags =
  -D__XTOUCH_SCREEN_28__
  !python scripts/version.py
  -I resources/
  -DUSER_SETUP_LOADED
  -DILI9341_2_DRIVER
  -DTFT_WIDTH=240
  -DTFT_HEIGHT=320
  -DTFT_BL=21
  -DTFT_BACKLIGHT_ON=HIGH
  -DTFT_MOSI=13
  -DTFT_SCLK=14
  -DTFT_CS=15
  -DTFT_DC=2
  -DTFT_RST=12
  -DTOUCH_CS=33
  -DSPI_FREQUENCY=40000000
  -DSPI_READ_FREQUENCY=20000000
  -DSPI_TOUCH_FREQUENCY=2500000

  ; -DXTOUCH_DEBUG_LOG=false
  ; -DXTOUCH_DEBUG_INFO=false
  ; -DXTOUCH_DEBUG_DEBUG=false

extra_scripts = 
  scripts/pre-build.py   
;     post:scripts/post-build.py

Logs I'm getting from the PlatformIO serial monitor:

rst:0x1 (POWERON_RESET),boot:0x13 (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:0x3fff0030,len:1184
load:0x40078000,len:13232
load:0x40080400,len:3028
entry 0x400805e4
[XTouch][SCREEN] Setup
[   673][E][esp32-hal-cpu.c:110] addApbChangeCallback(): duplicate func=0x40113654 arg=0x3ffbfdb4
XTouch][SD] SD Card Type: [XTouch][SD] SDHC
[XTouch][SD] SD Card Size: 30436MB
[XTouch][SD] Reading JSON file: /config.json
[XTouch][SD] Reading JSON file: /xtouch/settings.json
[XTouch][FS] Checking for touch config
[XTouch][TOUCH] Load from disk
[XTouch][SD] Reading JSON file: /config.json
[XTOUCH][CONNECTION] Connecting to WiFi ..
[XTOUCH][CONNECTION] Connected to the WiFi network with IP: //a valid IP address I'm not going to share here//
[XTouch][SD] Reading JSON file: /config.json
Getting accessToken from Bambu Cloud
Getting device list from Bambu Cloud
[XTouch][SD] Reading JSON file: /xtouch/printer.json
{
  "//a valid dev_id here//": {
    "dev_id": "//a valid dev_id here//",
    "name": "//exactly the name of the printer//",
    "online": true,
    "print_status": "ACTIVE",
    "dev_model_name": "C12",
    "dev_product_name": "P1S",
    "dev_access_code": "//I'm not sharing this//",
    "nozzle_diameter": 0.4
  }
}[XTouch][SD] Writting JSON file: /xtouch/printer.json
π-----DISCONNECTED-----
[XTouch][MQTT] Connecting
[XTouch][MQTT] ---- CONNECTED ----
Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x400ede57  PS      : 0x00060930  A0      : 0x800eab28  A1      : 0x3ffd7770  
A2      : 0x00000000  A3      : 0x00000007  A4      : 0x3ffd779c  A5      : 0x00000000
A6      : 0x00000008  A7      : 0x3ffce42c  A8      : 0x800ee392  A9      : 0x3ffd7750  
A10     : 0x3ffca41c  A11     : 0x00000008  A12     : 0x00000000  A13     : 0x00000000
A14     : 0x01000000  A15     : 0x00ffffff  SAR     : 0x00000020  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000020  LBEG    : 0x400f6884  LEND    : 0x400f68a2  LCOUNT  : 0x00000000

Backtrace: 0x400ede54:0x3ffd7770 0x400eab25:0x3ffd7790 0x400eab85:0x3ffd77c0 0x400e753c:0x3ffd77e0 0x400e7779:0x3ffd78a0 0x400e4a84:0x3ffd78c0 0x400d2c54:0x3ffd78e0 0x400db5dc:0x3ffd7900 0x400db7e7:0x3ffd79c0 0x400db7fd:0x3ffd79e0 0x40114115:0x3ffd7a00

  #0  0x400ede54:0x3ffd7770 in lv_obj_get_local_style_prop at .pio/libdeps/esp32dev/lvgl/src/core/lv_obj_style.c:288
  #1  0x400eab25:0x3ffd7790 in lv_obj_set_x at .pio/libdeps/esp32dev/lvgl/src/core/lv_obj_pos.c:59
  #2  0x400eab85:0x3ffd77c0 in lv_obj_set_pos at .pio/libdeps/esp32dev/lvgl/src/core/lv_obj_pos.c:48
  #3  0x400e753c:0x3ffd77e0 in lv_scr_load_anim at .pio/libdeps/esp32dev/lvgl/src/core/lv_disp.c:262
  #4  0x400e7779:0x3ffd78a0 in lv_disp_load_scr at .pio/libdeps/esp32dev/lvgl/src/core/lv_disp.c:84
  #5  0x400e4a84:0x3ffd78c0 in loadScreen at src/ui/ui_loaders.c:86
  #6  0x400d2c54:0x3ffd78e0 in xtouch_mqtt_onMqttReady() at src/xtouch/mqtt.h:711
  #7  0x400db5dc:0x3ffd7900 in xtouch_mqtt_connect() at src/xtouch/mqtt.h:742
  #8  0x400db7e7:0x3ffd79c0 in xtouch_mqtt_loop() at src/xtouch/mqtt.h:868
      (inlined by) xtouch_mqtt_loop() at src/xtouch/mqtt.h:862
  #9  0x400db7fd:0x3ffd79e0 in loop() at src/main.cpp:84
  #10 0x40114115:0x3ffd7a00 in loopTask(void*) at C:/Users/vfpkj/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:50

ELF file SHA256: 988c07573eda6df6

Rebooting...
xperiments commented 2 weeks ago

Hi, as this is a custom build, please comment it in Discord so we can help live