Skip to content

Commit 67e19d3

Browse files
author
Deepika
committed
Add RAM/ROM stats to the application
1 parent 46707ac commit 67e19d3

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
@@ -36,5 +36,16 @@ int main()
3636
*/
3737
printf("Compiler Version: %d \n", stats.compiler_version);
3838

39+
/* RAM / ROM memory start and size information */
40+
for (int i = 0; i < MBED_MAX_MEM_REGIONS; i++) {
41+
if (stats.ram_size[i] != 0) {
42+
printf("RAM: Start 0x%x Size: 0x%x \n", stats.ram_start[i], stats.ram_size[i]);
43+
}
44+
}
45+
for (int i = 0; i < MBED_MAX_MEM_REGIONS; i++) {
46+
if (stats.rom_size[i] != 0) {
47+
printf("ROM: Start 0x%x Size: 0x%x \n", stats.rom_start[i], stats.rom_size[i]);
48+
}
49+
}
3950
return 0;
4051
}

0 commit comments

Comments
 (0)