mbed-os-examples
/
mbed-os-example-mbed5-sys-info
Example to get the System Information from Mbed OS
Revision 18:84717aecb01a, committed 2018-11-27
- Comitter:
- mbed_official
- Date:
- Tue Nov 27 04:45:35 2018 +0000
- Parent:
- 17:123ea9d5b79f
- Child:
- 19:907415fb0a88
- Commit message:
- Merge pull request #12 from ARMmbed/mem_stats
Add RAM/ROM stats to the application
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-sys-info
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Nov 19 21:30:40 2018 +0000 +++ b/main.cpp Tue Nov 27 04:45:35 2018 +0000 @@ -41,5 +41,16 @@ */ printf("Compiler Version: %d \n", stats.compiler_version); + /* RAM / ROM memory start and size information */ + for (int i = 0; i < MBED_MAX_MEM_REGIONS; i++) { + if (stats.ram_size[i] != 0) { + printf("RAM%d: Start 0x%x Size: 0x%x \n",i , stats.ram_start[i], stats.ram_size[i]); + } + } + for (int i = 0; i < MBED_MAX_MEM_REGIONS; i++) { + if (stats.rom_size[i] != 0) { + printf("ROM%d: Start 0x%x Size: 0x%x \n",i, stats.rom_start[i], stats.rom_size[i]); + } + } return 0; }