AM very new to the platform. i wish to use it as part of a library i working on for the AVR platform mostly Arduino Mega baord.
I have tested the library code blink(niblink and chblink) example using Arduino 1.8.2 IDE with arduino mega(atmega 2560)
The example did work. although i wanted to check the amount of memory being use
sso i made a call to the function below inside the thread function.
Code: Select all
int freeMemory() {
int free_memory;
if ((int)__brkval == 0) {
free_memory = ((int)&free_memory) - ((int)&__heap_start);
} else {
free_memory = ((int)&free_memory) - ((int)__brkval);
free_memory += freeListSize();
}
return free_memory;
}
i Have tested the function with other code and it does return acceptable result
Although in this case i can see that the difereece between Stack pointer and Heap pointer is -2265(niBlink) and -461(chBlinks in this case i still can see the led flash). however, this show an overflow of memory. i wish to use chibios as part of a larger project so this behavior is unexpected as i come to chibios understanding that it was lightweight and stack only.
can one suggest some help here! Also i havnet touch any config file as yet.
Regards!