-
Notifications
You must be signed in to change notification settings - Fork 13.3k
delay(1) in library sometimes causes exception(9) #5838
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
Comments
Are you doing eeprom ops from an async server callback? |
lol well, yeah. never put it that way but as you're pointing it out now, and as I have just closed all VS Code windows and released the pressure from my brain, it is completely obvious. may I slap myself now? :-D won't this EVER work reliably or will this only be a problem if it takes too long? is an async callback always an interrupt where I only should set flags? edit: I feel stupid as sh** now. thanks for pointing me in the right direction. |
Closing due to user error. Async callbacks exexute in the SYS context, and there are restrictions that apply. In general, blocking ops are a big NO, unless you know exactly what you're doing. |
i have now made a function processCallbacks() which is called in the loop and which looks in a vector of a "callback" called struct which contains stuff to do. |
You're reinventing the wheel, that's more or less what the scheduled functions do: when you schedule a function, it gets added to a container, then all functions in the container get called together with the next loop. Look at the scheduled functions api, I think that using it will simplify your code. |
Basic Infos
Platform
Settings in IDE
Problem Description
I'm using this library for EEPROM access: https://github.com/JChristensen/extEEPROM
and it seems this thing is kind of incompatible with the ESP8266. See here, I have already figured some things out: JChristensen/extEEPROM#19
From then on, I only sometimes got crashes but they were still there. recently they started to annoy me so I tracked them down to delay(1) which is called in my customized version of extEEPROM.cpp:
(original file, see here: https://github.com/JChristensen/extEEPROM/blob/master/extEEPROM.cpp starting at line 134)
When I removed delay(1), the crashes disappeared.
This is, how I was writing data to the EEPROM:
this is the stack trace i was receiving:
decoded:
is this somehow related to #5722 or to "trying to use yield/delay, or libs that use yield/delay, from inside async callbacks"?
This is not an async callback...
Thanks!
The text was updated successfully, but these errors were encountered: