-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force Watchdog Feeder #5276
Comments
I could be wrong, but I understand that feeding the sw WD also feeds the hw WD. Are you disabling the sw WD manually? Depending on your answer: Some debugging techniques as suggestions:
|
As a developer, I must admit its extremely discouraging to just see "oh, we're going to close this outright, put it out of sight, out of mine" without any actual investigation. Its far too common to just throw out the idea "its user error, never us" - as an FYI: this is code that is working perfectly on ARM and AVR without issue, but I wanted to switch to a more powerful platform (the ESP series of chips). GPIO is write-only, so no interrupts. I never disable software WDT. No infinite loops are happening, the application enters a static execution state and just repeats this particular state indifferently every ~20ms (as mentioned in the initial post). It simply sends the exact same data through multiple GPIO channels over and over again. Serial is output only as well. The only input is wifi, which would just be random broadcast packets on the LAN, nothing is targeting the ESP directly itself. The serial code mentioned in my initial post is exactly what you suggested, outputting a log of checkpoints of several points within the code. Yes, by default it consistently failed at the exact same point in code, always. Removing that piece of code just shifted where it would die at. If any sort of minor modification happened in the code, then it would change where the WDT set would occur. If you want more notes: setting the device to Soft AP mode instead of Station, no other code change whatsoever, the WDT resets happen significantly faster. I've asked about this particular issue before in IRC and here on another thread dealing with the web server by itself, with no reply on that particular topic at all. Once I started seeing it happen in Station mode as well, I realized the issue is more global, not just in AP, so decided to create a dedicated issue. If you want to see my notes on resource exhaustion, please see my other issue: #4823 (which you've personally commented on, so should already be familiar with!?) Yes, I'm more than aware of the limitations of this particular board. I've already put in significant work in to this library itself to reduce its memory consumption. But a lot of the wifi code is hidden, so I cannot get in and debug/fix that myself. I've already had to do this with a BlueTooth stack on ARM with only 8KiB RAM. |
@darkain I'm sorry that you feel discouraged, but we currently have over 400 issues to deal with, so expecting an investigation from someone here for your particular use case is unrealistic. |
Can you enable all debug options, instrument your code with Esp.getFreeHeap&bro, watch for |
I also like to suggest that latest master improved stability for my application without any code changes on my side, so, @darkain I would give it another shot. my firmware is also pretty complex (~30k loc) and I can understand why providing MCVE can be a big PITA. nevertheless, there is only so much the devs can do here without one. |
I upgraded to release 2.5.0, and all seems to be stable now. I've ran a pair of tests so far that ran stable for over 12 hours each without a single error. It appears that which ever it happened to be within the core ESP8266 for Arduino library was causing this issue (possibly the race condition crash listed in the bug fix list) appears to be resolved at this point! Also, the code in question I was initially having an issue with is a fully scriptable wifi enabled LED controller. It was recently approved to be released publicly: https://github.com/cosplaylighting/spider2 |
Basic Infos
Platform
Settings in IDE
Problem Description
Is there an actual way to FORCE feed the hardware watchdog timer to be fed? I keep getting resets as listed below. Resets happen anywhere between ~1 minute and ~3 hours, no consistency whatsoever. The actual sketch code is too complex to show here. I can say with absolute certainty though through performance profiling that the main loop() function completes in under 20ms. Inside of this loop, in my main inner-loop, I've also tried calling ESP.wdtFeed(), which means this function is being called about every 0.1ms. Even with this, the WTD will still randomly reset like mentioned.
Before getting into the boards and power supplies debate:
I have an entire array of boards. EVERY single one does this.
I have several different power supplies. I've used a variety of USB battery banks and wall outlets (all supply a minimum of 5V 2A very stable power). I've also used a 300w ATX power supply with nothing else attached. I have 1000uf caps on both the 5v line and 3.3v line. I've used the controller's own 3.3v regulators. I've used my own 3.3v buck-boost converters.
Some of these boards are in breadboards for testing. Some of them a soldered directly into custom motherboards with 5000uf on the 5v line for power stability and 60w max power.
The code in question is running just shy of 1MHz on multiple GPIO channels simultaneously, plus pushing nearly full bandwidth of 115200 serial, and wifi in station mode. During a small portion of the loop (~10ms) interrupts are also disabled. I'm wondering if maybe there is an actual design flaw inside these CPUs where one of these may be causing voltage leaks/sags into the hardware register for the WDT?
The text was updated successfully, but these errors were encountered: