ImpulseAdventure / GUIslice

GUIslice drag & drop embedded GUI in C for touchscreen TFT on Arduino, Raspberry Pi, ARM, ESP8266 / ESP32 / M5stack using Adafruit-GFX / TFT_eSPI / UTFT / SDL
https://www.impulseadventure.com/elec/guislice-gui.html
MIT License
1.17k stars 209 forks source link

WDT soft reset #208

Closed DynamicLoader closed 4 years ago

DynamicLoader commented 4 years ago

Describe the bug

I'm using esp8266.When I set up a base page as a taskbar,and setup a page (page1) as a window(just like windows),it works well.But when I open the window from base page,it will refresh the window.Then I open window from base page about 6 times,ESP8266 is restarted by watchdog...I think it's because the memory overflow.

On the base page,I just added a button and show page1 when press the button.Should I clean all the page before I show page1?

Device hardware

Checklist to try first

Please confirm whether:

Expected behavior

No WDT reset.

Initialization messages

Serial port output

GUIslice version [0.13.0]:

Soft WDT reset

stack>>>

ctx: cont sp: 3ffffb10 end: 3fffffc0 offset: 01b0 3ffffcc0: 3fff0408 3ffffd30 3ffefa84 3ffefcc4
3ffffcd0: 3ffef5c8 3ffefcc4 3fff0428 40205c89
3ffffce0: 0024011d 009d0014 00e0e0e0 40201514
3ffffcf0: 002a009a 001b007d 00c0c0c0 40201514
3ffffd00: 0024011d 009d0014 00e0e0e0 40201d73
3ffffd10: 00000021 00000000 00000005 40203f1f
3ffffd20: 00000000 3ffffd50 00240074 000a000a
3ffffd30: 46206f4e 20656c69 6e756f46 00e0e0e0
3ffffd40: 00000000 009a0000 007d002a 0095001b
3ffffd50: 3fff0428 00000126 00000072 00000000
3ffffd60: 0000011d 00000024 3ffefa8c 00000001
3ffffd70: 00000000 00000000 00000130 000000c0
3ffffd80: 00000092 00000000 00000005 01000000
3ffffd90: 00000001 0000001b 00000000 402014a4
3ffffda0: 00200092 00a500a0 3ffefa8c 3ffefcc4
3ffffdb0: 3ffefa8c 00000001 3fff0428 40201e82
3ffffdc0: 00000022 00ffffff 00ffb200 00000000
3ffffdd0: 00000000 3fff059c 0000e71c 00000030
3ffffde0: 00210093 00a3009e 00ffffff e0e00000
3ffffdf0: 000000e0 00000083 3ffef69c 40201b67
3ffffe00: 00000092 00000020 00000000 000000a0
3ffffe10: 000000a5 00000000 3ffef69c 00000001
3ffffe20: 00000000 3fff0428 3ffefa8c 00000000
3ffffe30: 00000001 3ffefa8c 3fff0428 40202150
3ffffe40: 00000001 3fffff02 3ffefa8c 00000000
3ffffe50: 000000c2 2e8a9ce2 002e6800 00000000
3ffffe60: 40105249 002e68cf 3fff0784 00000001
3ffffe70: 00000000 3fff03a4 00000009 40202ec5
3ffffe80: 00000001 3fffff02 3ffefa8c 00000000
3ffffe90: 00000001 3fffff02 3fff03a4 00000000
3ffffea0: 3fff0428 3fff0528 3fff0428 40205c89
3ffffeb0: 00050005 00cf0136 00e0e0e0 00000001
3ffffec0: 3fff0429 00000001 3fff0428 40202f38
3ffffed0: 00000001 3fffff02 3ffef6a4 00000000
3ffffee0: 00000000 00f00140 3fff03cc 3fff0728
3ffffef0: 00000000 3fff0528 3fff0428 40202fd6
3fffff00: 00000001 3fffff02 3fff03a4 00000000
3fffff10: 3fff042b 3fff042c 00000001 00000000
3fffff20: 00000002 2e75c300 00000002 00000000
3fffff30: 3fffdad0 00000000 3fff0428 3fff0728
3fffff40: 00000000 00000005 3fff0428 402031e3
3fffff50: 3fff05e0 00000002 3fff0428 402027aa
3fffff60: 007a1200 2e75c300 00000000 4020a0a0
3fffff70: 00000001 000000c0 000000c0 00c20000
3fffff80: 00000048 00000000 00000001 40100154
3fffff90: 3fffdad0 00000000 3fff06e8 4020530c
3fffffa0: feefeffe feefeffe 3fff06e8 4020a010
3fffffb0: feefeffe feefeffe 3ffe84f8 40100c4d
<<<stack<<<

Decoding stack results:

0x40205c89: gslc_DrvDrawFillRect(gslc_tsGui, gslc_tsRect, gslc_tsColor) at G:\ESP8266lib\libraries\GUIslice\src\GUIslice_drv_tft_espi.cpp line 552 0x40201514: gslc_DrawFillRect at G:\ESP8266lib\libraries\GUIslice\src\GUIslice.c line 2298 0x40201514: gslc_DrawFillRect at G:\ESP8266lib\libraries\GUIslice\src\GUIslice.c line 2298 0x40201d73: gslc_ElemGetGlow at G:\ESP8266lib\libraries\GUIslice\src\GUIslice.c line 3414 0x40203f1f: gslc_ElemXSliderDraw at G:\ESP8266lib\libraries\GUIslice\src\elem\XSlider.c line 287 0x402014a4: gslc_DrawFrameRect at G:\ESP8266lib\libraries\GUIslice\src\GUIslice.c line 2298 0x40201e82: gslc_ElemDrawByRef at G:\ESP8266lib\libraries\GUIslice\src\GUIslice.c line 3007 0x40201b67: gslc_ElemSetRedraw at G:\ESP8266lib\libraries\GUIslice\src\GUIslice.c line 3347 0x40202150: gslc_ElemEvent at G:\ESP8266lib\libraries\GUIslice\src\GUIslice.c line 2786 0x40202ec5: gslc_CollectEvent at G:\ESP8266lib\libraries\GUIslice\src\GUIslice.c line 4367 0x40205c89: gslc_DrvDrawFillRect(gslc_tsGui, gslc_tsRect, gslc_tsColor) at G:\ESP8266lib\libraries\GUIslice\src\GUIslice_drv_tft_espi.cpp line 552 0x40202f38: gslc_PageEvent at G:\ESP8266lib\libraries\GUIslice\src\GUIslice.c line 1932 0x40202fd6: gslc_PageRedrawGo at G:\ESP8266lib\libraries\GUIslice\src\GUIslice.c line 2275 0x402031e3: gslc_Update at G:\ESP8266lib\libraries\GUIslice\src\GUIslice.c line 719 0x402027aa: gslc_FontSetBase at G:\ESP8266lib\libraries\GUIslice\src\GUIslice.c line 1810 0x4020a0a0: uart_write_char_d(char) at C:\Users\lucy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\cores\esp8266\core_esp8266_postmortem.cpp line 222 0x40100154: ets_post(uint8, ETSSignal, ETSParam) at C:\Users\lucy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\cores\esp8266\core_esp8266_main.cpp line 160 0x4020530c: loop() at G:\ESP8266lib\TestGUI/TestGUI.ino line 539 0x4020a010: loop_wrapper() at C:\Users\lucy\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\cores\esp8266\core_esp8266_main.cpp line 180

Additional info

Here is my test program: TestGUI.zip

Pconti31 commented 4 years ago

It's not much help but I ran your program on my Adafruit ESP32 Feather with Adafruit's Feather 3.5 TFT screen and once I commented out setting pin D2 it compiled and ran fine.

Looks Cool by the way!

Any chance setting D2 Boot mode select TX1 is causing a problem?

FYI, Heap size was always reported as 318156 bytes.

Now GUIslice only uses global memory pre-allocated once at startup so it's not directly the problem as far as I can see. So no you don't need to cleanup pages.

Hopefully, Calvin can help you out.

Paul--

ImpulseAdventure commented 4 years ago

Hi @Lucy2003 -- good job on the interface you have created!

I ran your TestGUI on the following setup:

With the above, I didn't observe any faults after swapping between various pages. Can you confirm the steps you are using to recreate the problem? For example:

As Paul points out, GUIslice should not use any dynamic memory allocation, and we appear to have a good amount of memory left after compilation.

Thanks

DynamicLoader commented 4 years ago

I'm using WeMos D1 R1,and the D2 pin is connected to LED pin so that I can control the screen background LED.The D2 is also connected to GPIO16(Boot mode select),but LED pin won't pull down the D2 so the ESP8266 can be boot normally.

I reconnected all wires and found the problem disappear.It seems that the problem causes by my wire.

I'm sorry to disturb you!

Lucy2003

ImpulseAdventure commented 4 years ago

Great - thank you for the confirmation!