GrumpyOldPizza / ArduinoCore-stm32l0

Arduino Core for STM32L0
125 stars 67 forks source link

Checking free memory #49

Open SloMusti opened 5 years ago

SloMusti commented 5 years ago

While debugging an application which is mis-behaving, I have discovered the need to determine the free memory available in real-time to see if something is going wrong.

For Arduino there is the library https://github.com/maniacbug/MemoryFree which does not work because:

...\Arduino\libraries\MemoryFree-master/MemoryFree.cpp:18: undefined reference to `__brkval'
...\Arduino\libraries\MemoryFree-master/MemoryFree.cpp:18: undefined reference to `__bss_end'

I believe it would be useful to have this feature in the core itself or have a known method that works to check this.

GrumpyOldPizza commented 5 years ago

This library will not work with ArduinoCore-stm32l0. Mainly because the heap/malloc layout in memory is different as to what the code assumes.

On Mon, Nov 26, 2018 at 3:23 AM SloMusti notifications@github.com wrote:

While debugging an application which is mis-behaving, I have discovered the need to determine the free memory available in real-time to see if something is going wrong.

For Arduino there is the library https://github.com/maniacbug/MemoryFree which does not work because:

...\Arduino\libraries\MemoryFree-master/MemoryFree.cpp:18: undefined reference to __brkval' ...\Arduino\libraries\MemoryFree-master/MemoryFree.cpp:18: undefined reference to__bss_end'

I believe it would be useful to have this feature in the core itself or have a known method that works to check this.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/GrumpyOldPizza/ArduinoCore-stm32l0/issues/49, or mute the thread https://github.com/notifications/unsubscribe-auth/AG4QfO_eGGheyYVgkNr5WSzcGy7C91tfks5uy8EIgaJpZM4Yyuo- .