How to debug random crash/reset ? #5876
Replies: 1 comment
-
Posted at 2017-09-27 by @allObjects Did you check the flags? E.getFlags() or something alike... that can help you. Since you know your code you may have an idea where it is heavy... so after certain buffer and move-around operations checking the flags can give you indication. Furthermore, try to break up code into setTimeout()s because that breaks the JavaScript thread an lets the ESP8266 do its things... there is anyway only a limited window that you can use before the Wifi tries to take over and crashes or takes over and JavaScript portion crashes. The single processor is just not the setup for doing much next to the Wifi job... not for nothing the ESP32 got launched which has the dual processor - one to deal with the Wifi/Bluetooth and one with the rest... Similar 'combination structures' I'm running successfully with Espruino Original and CC300, Pico with ESP8266, Espruino-Wifi. The money saved on the ESP8266 is just not worth your troubles... Posted at 2017-09-27 by Polypod From E.getFlags(), I only get : { "deepSleep": 0, "pretokenise": 0 }. is it supposed to return something else ? Posted at 2017-09-27 by @allObjects 2 ESP8266 will not solve your problem, except you put a totally different binary on it that does ignore the Wifi... or you disable the Wifi (switch it off)... but it still will use you memory resources. Best is to get yourself a Pico. Posted at 2017-09-27 by Wilberforce Line 2 of your output is This means the watchdog was triggered, due to the CPU being tried up - what have you got in a tight loop that ties up the CPU? Posted at 2017-09-30 by Polypod Ok, thanks, @allObjects, what do you call 'combination structures' ? I thought the problem was the cpu not the memory. What is so good about the pico ? Posted at 2017-09-30 by Polypod @allObjects, Finally you was right. The bug came back, and went away when I used more setTimeOut as you suggested to break the function calls that pile too much. To me, it looks a lot like a lack of memory when piling too many local calls context. More than 10 in my case, i broke up in 5 and 5. Posted at 2017-09-30 by @allObjects Lack of memory is probably less the issue... it is that ESP8266 has a watchdog that kicks in when in 'uninteruptable'/busy/'tied up'/in 'tight loop' (even though it is not really a loop) state for more than a set time. ESP8266 firmware can only take a break from serving the Wifi communication part for that set time to serve other things. I wonder now if one wire gets ESP8266 in such a tied up state... and you cannot break up the code into small enough pieces that this watchdog does not kick in. So it is not directly
It is that one processor takes care of the tying up things, such as talking 1-Wire, while the other one takes care of the high-maintenance drama queen called Wifi... And when both have some time in between their first/high priority tasks, they have a great time together - exchanging a few bytes over slow serial, which is interruptable and buffered... - they work in combination... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-09-27 by Polypod
Hi all,
I started having this error lately on esp8266. It's not triggered by a particular line of code. My code is a bit large to be included here, it makes a data model and read from a sensor.
It looks like I am doing something that make the esp unstable, but the code continue running to some point where the esp is stressed then the crash happens. I tried another esp8266 board and with v1.94, no change. It's probably my code then. I would like to find the code part responsible for this instability. How to learn more about what happens ?
Any idea how to debug this problem ? is an abuse of callstack a possible cause ?
Polypod
Beta Was this translation helpful? Give feedback.
All reactions