Closed dsyleixa closed 4 years ago
You are out of RAM due to RODATA constants and very large heap arrays, so BSS can't fit w/in the ~50KB free for core use.
Try float
instead of double
(4 bytes vs. 8 bytes), moving constant arrays to PMEM (and using appropriate pgm_read_xxx macros), etc.
float has too few digits for convergence. (sigma + error function) the error msg is confusing and ambiguous: How to retrieve the free RAM/stack/heap?
That's some serious dynamic range problem in the algorithm, ouch.
The error message is from GCC, not us, and it's pretty clear. BSS == your uninitted memory arrays. It doesn't fit in the RAM segment, so it can't link properly.
Just build an empty sketch and you'll see the total heap space available printed as part of the Arduino output ("Program uses XXX bytes out of YYYY of RAM" or similar). Assume ~50KB total w/o any WiFi. And that's obviously not going to include any dynamically allocated stuff.
Stack is 4K always.
I actually do not see or remember having allocated any dynamic memory at all. OTOH, A free mem avail function during runtime would be fine too (does actually exist for Arduino Due (Cortex M3 ATSAM3X8E), but does not work for ESP8266
ESP.getFreeHeap()
is the runtime command. It's not going to help you, though, if your heap variables are too big since you can't make an executable in that case.
Your hidden weights matrix alone is 57KB or so, plus all the other stuff.
yes, I see, thanks! I'll try to migrate to esp32. At least I finally know now what the strange error msg means, thank you!
strange compile error using double: collect2.exe: error: ld returned 1 exit status does not happen with float vs. double
Basic Infos
Platform
Settings in IDE
MCVE Sketch
Debug Messages