Skip to content

Commit cc63c6a

Browse files
author
Deepika Bhavnani
authored
Merge pull request #12 from ARMmbed/mem_stats
Add RAM/ROM stats to the application
2 parents cf51d1a + ba643a9 commit cc63c6a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

main.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,16 @@ int main()
4141
*/
4242
printf("Compiler Version: %d \n", stats.compiler_version);
4343

44+
/* RAM / ROM memory start and size information */
45+
for (int i = 0; i < MBED_MAX_MEM_REGIONS; i++) {
46+
if (stats.ram_size[i] != 0) {
47+
printf("RAM%d: Start 0x%x Size: 0x%x \n",i , stats.ram_start[i], stats.ram_size[i]);
48+
}
49+
}
50+
for (int i = 0; i < MBED_MAX_MEM_REGIONS; i++) {
51+
if (stats.rom_size[i] != 0) {
52+
printf("ROM%d: Start 0x%x Size: 0x%x \n",i, stats.rom_start[i], stats.rom_size[i]);
53+
}
54+
}
4455
return 0;
4556
}

0 commit comments

Comments
 (0)