Flash, RAM and Heap Usages Calculation at Run time

Hi,

1. How to calculate the Flash and RAM usages at runtime? I am able to do it static way but wanted to analyze this at runtime. 

2. How to calculate the Heap usages at runtime? I have gone through some documents those referring to "size_t sys_heap_usable_size(struct sys_heap * heap, void *mem)" for heap usage, To use this api,  we need to populate "struct sys_heap". Not getting how to use this and Is there any other API which we can provide us the whole RAM Heap usages. 

Thanks & Regards

Vimal Verma

Related