maniacbug / MemoryFree

Arduino MemoryFree library. Hosting it on github for easy access
http://www.arduino.cc/playground/Code/AvailableMemory
63 stars 54 forks source link

Fails compiling on Nano (ATSAMD21) #4

Open kb- opened 7 years ago

kb- commented 7 years ago

Hi,

I get the following error when I compile the code:

Arduino: 1.8.1 Hourly Build 2017/01/05 05:34 (Windows 8.1), Board: "Nano Zero (Native USB Port)"

libraries\MemoryFree\MemoryFree.cpp.o: In function `freeMemory':

C:\Users\Olivier\Documents\Arduino\libraries\MemoryFree/MemoryFree.cpp:18: undefined reference to `__brkval'

C:\Users\Olivier\Documents\Arduino\libraries\MemoryFree/MemoryFree.cpp:18: undefined reference to `__bss_end'

collect2.exe: error: ld returned 1 exit status

exit status 1 Error compiling for board Nano Zero (Native USB Port).

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.

surfsoft commented 6 years ago

Also happens on Adafruit Feather Huzzah with ESP8266

per1234 commented 6 years ago

I'm pretty sure this is an AVR-only library. So no, it's not going to work on your SAMD (e.g. Zero, MKR) or ESP8266.

The ESP8266 Core for Arduino has built-in functions for this: https://arduino-esp8266.readthedocs.io/en/latest/libraries.html#esp-specific-apis

surfsoft commented 6 years ago

Yeah, just found that too. Thanks for the response though.