-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Settings api hangs #27928
Comments
@CodingGhost thanks for the potential bug report. Can you please post a minimum working example that has this issue so that others can easily compile the code to reproduce it? |
Ok, I made a small test: https://pastebin.com/32Ufzgy7 adding to that, I just tried the zephyr supplied settings sample, and I get nothing but errors...?! I used the same config and the same code, so how is that possible?? only thing I added was snippet of my output of the example:
am I just stupid or is there something strange going on? EDIT: adding |
this is still happening. |
OK. I figured it out, its a mix of stupidity and bad documentation: the first thing I was missing was CONFIG_NVS=y. then everything worked except for that I couldnt get it running inside a timer function. That is because the timer function executes in ISR context, which I didnt know and is described nowhere I looked. Maybe this is clear as day for everyone deeply involved with zephyr, but Im coming from mbed, and there are timer functions that execute on the main thread and not on ISR context. after I changed my code to submit work items from the timer ISR, and execute my code inside the system workqueue, everything now works as expected! Edit: ok, scratch bad documentation, its just stupidity, I found it! |
Is |
Describe the bug
I have something like the following in my code:
this will work completly normal. But as soon as I move the settings_save_one out of the main, it will just hang until my wdt resets the chip. Debugging looks like its hanging in idle.
also, If I first save the key in the main function, and then save it again somewhere else, it will work flawlessly. Sometimes it does not hang but I will get error -116.
EDIT: ok, it will not work flawlessly if I first save it in the main. I just seemed like it, because I was trying to save the same value that I tried saving in the main, because of that, the value did not change and didnt get written at all (I was getting ret code 0)
when I try to save another value, I will get err -116 for a few times now, and then it hangs ( calling it every second from a timer)
Im not 100% sure if this really is a bug, but i think its super strange and I cannot imagine what is happening.
The text was updated successfully, but these errors were encountered: