mbed-os-examples
/
mbed-os-example-mbed5-sys-info
Example to get the System Information from Mbed OS
Diff: main.cpp
- Revision:
- 18:84717aecb01a
- Parent:
- 16:49a99fd4085c
- Child:
- 19:907415fb0a88
--- 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; }