Using the new Arduino IDE for ESP8266 and found bugs, report them here

Moderator: igrr

User avatar
By OldBikerPete
#53533 OK. I've given up!

Delving into the SD and SdFat libraries to try to find the problems, I've been adding Serial.print statements for debugging, using a callback function in the sketch to get that to work within the libraries.
As I've added these statements, the non-performance has got steadily worse until finally the execution crashes and the sketch gets woken up by a watchdog timer, only to repeat.
I've traced the crash to File::File(SdFile f, const char *n) in File.cpp and by inserting return; at various places, have found that the crash occurs deeper in a malloc() or memcpy() call within that function.
Interestingly, using the String() family of operations, seems to use the heap as well as malloc().
Although the freeRAM() function I submitted here earlier is reporting heaps(:->) of heap available, thus perhaps ruling out a memory leak, my gut feeling is that somewhere the heap management system is running out of some resource - probably related to the number of calls on its services rather than the amount of heap allocated.

Anyway, I'm transferring my development to a Raspberry Pi zero for now although the PCB I've prototyped and the MCP2301x I2C I/O expander library will probably be useful elsewhere.
'bye for now.
Peter.
User avatar
By martinayotte
#53576 For the SD.remove() issue, I mentioned what was the reason behind the crashes, recursion due to method calling itself. It been fixed but not merged yet.
https://github.com/esp8266/Arduino/pull/2398
In the meantime, the workaround is to cast to get the proper method being called.

For your other issues, you didn't details them, so it is difficult to help then.

EDIT : Ok ! It is now merged into github ...