build_memory_info: Report used, free, and total memory
.. intead of just free and total as before.
This commit is contained in:
parent
7eff89e9f9
commit
1efa7076b0
|
@ -66,10 +66,12 @@ for region in regions:
|
|||
firmware_region = regions["FLASH_FIRMWARE"]
|
||||
ram_region = regions["RAM"]
|
||||
|
||||
free_flash = firmware_region - text - data
|
||||
free_ram = ram_region - data - bss
|
||||
print("{} bytes free in flash firmware space out of {} bytes ({}kB).".format(free_flash, firmware_region, firmware_region / 1024))
|
||||
print("{} bytes free in ram for stack and heap out of {} bytes ({}kB).".format(free_ram, ram_region, ram_region / 1024))
|
||||
used_flash = data + text
|
||||
free_flash = firmware_region - used_flash
|
||||
used_ram = data + bss
|
||||
free_ram = ram_region - used_ram
|
||||
print("{} bytes used, {} bytes free in flash firmware space out of {} bytes ({}kB).".format(used_flash, free_flash, firmware_region, firmware_region / 1024))
|
||||
print("{} bytes used, {} bytes free in ram for stack and heap out of {} bytes ({}kB).".format(used_ram, free_ram, ram_region, ram_region / 1024))
|
||||
print()
|
||||
|
||||
# Check that we have free flash space. GCC doesn't fail when the text + data
|
||||
|
|
Loading…
Reference in New Issue