Report Bugs Here

Moderator: Mmiscool

User avatar
By Mmiscool
#72329 If you use 1.6.5 at the top of the main sketch there is a compiler directive that controls if it will be compiled with all the libraries or not.

If you uncomment the following line it will build the 4 meg version.
//#define BASIC_TFT
User avatar
By Oldbod
#72333 Thanks very much Mmiscool, really helpful. It's been a while since I skimmed through the source - I can't say I immediately grasped it, its a huge project written in a language I only have a superficial understanding of - but it must be immensely frustrating and saddening for you to have this seemingly insoluble bug endangering such an enormous achievement. Really hard to debug with the limited tools available, with all the layers and complexities of the silicon, the underlying os, the complier/SDK, and the imported libraries, then the vagaries of the internet and browsers on top.

Apologies to Heckler and Electroguard if I've misremembered what they've said, but I think for Heckler once a basic script is properly stored on the esp, provided that the esp is rebooted before the basic program runs, he doesn't have an issue. Not sure if this applies for him if using Electroguard's test script.Heckler?

Electroguard has seen times where once a program is stored correct ly, and the esp has been rebooted, what is displayed on the browser is inconsistent. Rebooting the esp and rerunning the basic script may sometimes give different results on the browser (after shutting down and restarting the browser / device browser is running on?)

Eventually electrogard sees evidence of interpreter corruption. (Not sure how this is apparent? The esp then needs reformatting/reflashing.

If a save fails part way through, the esp reboots (or save may be interrupted and fail because the esp reboots). However the save OK message may still be displayed, indicating that this is not a true reboot - at least part of the interpreter tries to pick itself up and carry on. Is this espbasic trying to preserve things and recover, intentional bejaviour because to run a modified program espbasic needs reset, or the esp only restarting certain aspects?
My thought would be that after a program is modified and run the execution part of espbasic would stop, clear all user variables and close all files etc, then restart. It needs to be able to distinguish between a restart for a modified program and launching a chained program, when some variables might be preserved.

I'm wondering too about the life of the memory. On a heavily used file system presumably the index areas take a bit of a bashing....

All this is just half formed thoughts on my part. Essentially I think this is pain to track down because of the available tools. But I don't know what they are so I may be being unfair....
User avatar
By Oldbod
#72782 @Heckler Experimenting a little before Christmas I notice that for me, using eectroguards test script, a save after a power cycle works fine(nodemcu).

However, repeating the save multiple times, doing nothing else in between, causes a crash - usually after 5 or 6 consecutive saves.

I also note that though edit sometimes displays a much reduced script after issues, power cycling the esp then going into edit shows the original.

Does this match your experience?

Once I have some time (!?) I'm hoping to dig a little deeper. I suspect resources are the problem, and things various may not be being freed due to either the esp or the browser / browser host os. This is potentially hideously complicated. I need first to understand the traffic between browser and esp....ack delays maybe?

Any thoughts all?
User avatar
By _lele_
#79473
Mmiscool wrote:Yeah. I have been trying to figure this one out for months.

It has been a real pain in the a**. Still have not managed to figure it out.


Here my findings in case this topic is still of your interest.
Version 3.0alpha69 with Hello World program loaded as default.bas, Chrome browser.

4MB image running on Wemos D1 mini board: system crashes with stack coredump after hitting 'save' several times, let's say 20 or 30 times. No need to edit or run anything.

512KB image running on blue ESP01: system also crashes however, just a few 'save' hits before the actual system crash, I can see these messages on the system console:

BUFFER TOO BIG! PROGRAM STOPPED
/default.bas/3
end of save!!
Error at line 0:
BUFFER TOO BIG! PROGRAM STOPPED
Error at line 0: Halted
BUFFER TOO BIG! PROGRAM STOPPED
Done...
BUFFER TOO BIG! PROGRAM STOPPED
Error at line 0:
BUFFER TOO BIG! PROGRAM STOPPED
Error at line 0: Halted

Exception (28):
epc1=0x4000bf0e epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: cont
sp: 3fff2860 end: 3fff2c80 offset: 01a0

>>>stack>>>
...



I hope this helps,

gd