-
Notifications
You must be signed in to change notification settings - Fork 506
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
ESP8266 issue #39
Comments
Let me know when you find the problem. I really depend on users to support ESP8266. I ran the bench example on a Adafruit HUZZAH ESP8266 Breakout and it will write and read a 5 MB file.
|
you mean I provide you a test sketch to reproduce issue ? |
No you must find the problem since I don't want to dig through your code and my examples work. I tried the VolumeFreeSpace example and it also works.
|
Yes it is what I wrote VolumeFreeSpace works on your Git version but not on https://github.com/tannewt/SdFat fork. but using https://github.com/tannewt/SdFat which is based on your git before last big changes I did not asked you to dig in the my code I wrote :
I was looking for advice to find the problem - seems not possible so I won't bother you anymore - no problem |
Why did you expect me to debug the tannewt fork? It is almost two years old. |
No but you did several changes since and you may know which could lead me to search - anyway please do not bother - I can handle it |
I solved my issue by changing
now big files can also be read without generating an error and no side effects - issue solved |
Strange, must be a bug in the ESP8266 you are using. yield() works for me. See this: https://github.com/esp8266/Arduino/blob/master/doc/reference.md
I use yield() since it also works for schedulers in other systems. Also yield() is a weak function so if you replace it with your own version you can do other scheduler stuff. |
I tested bench with this version of SysCall::yield() and it works.
If I comment out ::yield(); it crashes so something you are using replaces yield or there is a bug in your version of ESP8266. I used yield instead of delay(0) since it allow more flexible scheduling. |
I use https://github.com/esp8266/Arduino, 2.3.0 and git version - I did not change anything in core version |
That's the version I am using. You don't need to change anything in the core version to have yield replaced. If some other code/library you are using defines yield, it replaces the core yield. I assume you know what a weak function is. You may still have a problem. Some SD cards have long latencies so another yield call may be needed in SdFat. |
I ran this test and the WDT timeout is about 2100 ms so no SD card should cause a problem.
Output at crash
If you wish, you can set this to less than 10,000 microseconds by editing SdFatConfig.h in the current SdFat.
|
Yes I know weak function but SdFat is the only library I am using, no other external code - I have no idea where the issue come from - I just shared what issue I experienced, asked for advice, and shared how I solved, that is all. |
Using like set in 2.30 for embedded SD: esp8266/Arduino@9172033 |
That means something is likely wrong with the weak function linking. optimistic_yield calls yield. Here is the code for all the yield functions.
I have seen something like this before with Arduino. I may just call delay(0) for ESP8266. Sad since the reason for a weak yield is so you can implement a custom scheduler. delay(0) is the same as __yield() which should be the same as yield(). One more thing. I found a version of yield() in some ESP8266 test code that would cause the problem if it were to replace the weak version. It's in this file. esp8266\hardware\esp8266\2.3.0\tests\host\common\Arduino.cpp Here is the function:
|
Everything above is wrong. I just noticed that the correct yield is called but __yield calls panic in your code.
It's not a WDT problem. delay(0) is the same as yield() except it doesn't call panic, it just returns if this is not true.
More terrible code int ESP8266. So it is a bug in ESP8266. optimistic_yield also just returns. |
wow !!! thanks so actually delay() and optimistic_yield hide the problem but issue is elsewhere |
I updated github with this change
|
should this reported to ESP8266 github ? as issue is on their side ? Thanks for you help on this - I learn something today |
I think it should be since there are many ported libraries that use yield() in the ESP8266 software. I develop for more than 10 platforms and stuff like this is killing my time but reporting and following up takes even more time. Recently I spent two days finding a bug in the Particle Electron SPI driver. So I wish you would report it. |
I have started to share the problem on gitter, as seems other people do not have the issue which is weird |
Hi I use latest git version of SdFat with my ESP8266 and got error when trying to download "big" files.
File 451B is ok but with 174KB and up I got this :
Using https://github.com/tannewt/SdFat fork, which is pre-SDFat-Beta and has some patch for ESP8266, this issue does not happen, I can even download 10M files, but tannewt one crash when using clustercount functions:
when yours do not, even answer is slow there is no watchdog issue.
I have applied same patch @tannewt did on his fork to your git version but this did not help.
Anything I can do to help to debug this issue ?
Thanks
I add decoded
The text was updated successfully, but these errors were encountered: